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
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "g1nation",
"displayName": "G1nation",
"description": "100% local AI coding agent for VS Code. Create files, edit code, run commands, and work offline with Ollama or LM Studio.",
"version": "2.2.60",
"version": "2.2.61",
"publisher": "connectailab",
"license": "MIT",
"icon": "assets/icon.png",
+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 };