From e1d69bc43307b08cb8df0e3b06b44733f35d059f Mon Sep 17 00:00:00 2001 From: tikitoki Date: Fri, 15 May 2026 15:05:04 +0800 Subject: [PATCH] fix(ui): enable sidebar markdown code copying Summary: - Add the existing delegated markdown code-block copy handler to the Control UI chat sidebar container. - Fix sidebar-rendered markdown code copy buttons that previously emitted no clipboard write because `.chat-sidebar` sits outside `.chat-thread`. Verification: - Unpatched current `origin/main` (`b24a6d2cbd636b0b39b732c962d58e574c748abe`) + temporary regression assertion: `pnpm test ui/src/ui/views/chat.test.ts -t "chat sidebar markdown copy"` failed with 0 `navigator.clipboard.writeText` calls. - PR patch applied onto current `origin/main` + same temporary regression assertion: `pnpm test ui/src/ui/views/chat.test.ts -t "chat sidebar markdown copy"` passed, 1 test passed and 32 skipped. - Live PR state before merge: `MERGEABLE`, `CLEAN`, head `2e04e981e992b32920476edc648009ddff7976d0`. - Duplicate sweep found no same-failure duplicate PR/issue. - Security check clear: UI event binding only; no dependency, workflow, auth, secret, network, or command-execution surface changes. Known proof gap: - No full browser walkthrough was run; the focused jsdom proof covers the exact DOM delegation boundary. Thanks @tikitoki. --- ui/src/ui/views/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index 096a83f0341..d8255a1c466 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -1313,7 +1313,7 @@ export function renderChat(props: ChatProps) { .label=${t("nav.resize")} @resize=${(e: CustomEvent) => props.onSplitRatioChange?.(e.detail.splitRatio)} > -
+
${renderMarkdownSidebar({ content: props.sidebarContent ?? null, error: props.sidebarError ?? null,