UI: add copy button to user messages

This commit is contained in:
2026-04-29 10:47:46 +09:00
parent 6a4ea99449
commit 04c8f17cb7
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -1108,12 +1108,13 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
body.innerText = text;
} else {
body.innerHTML = fmt(text);
const copyBtn = document.createElement('button');
copyBtn.className = 'copy-btn'; copyBtn.innerText = '📋 Copy';
copyBtn.onclick = (e) => { e.stopPropagation(); copyToClipboard(msgEl._raw, copyBtn); };
msgEl.appendChild(copyBtn);
}
const copyBtn = document.createElement('button');
copyBtn.className = 'copy-btn'; copyBtn.innerText = '📋 Copy';
copyBtn.onclick = (e) => { e.stopPropagation(); copyToClipboard(msgEl._raw, copyBtn); };
msgEl.appendChild(copyBtn);
msgEl.appendChild(head); msgEl.appendChild(body);
chat.appendChild(msgEl); chat.scrollTop = chat.scrollHeight;
return { body, msgEl };