fix(webchat): move action buttons outside message bubble

Wrap each message in a .message-wrapper div and render copy/edit buttons
below the bubble instead of overlapping inside it. Improves readability
and prevents buttons from covering message content.
This commit is contained in:
William Valentin
2026-02-10 21:26:22 -08:00
parent 25482b8516
commit aaaf4a361a
2 changed files with 36 additions and 12 deletions
+7 -3
View File
@@ -52,6 +52,9 @@ function highlightCode() {
}
function createMessageEl(role, content) {
const wrapper = document.createElement('div');
wrapper.className = 'message-wrapper';
const div = document.createElement('div');
div.className = `message ${role}`;
@@ -61,13 +64,14 @@ function createMessageEl(role, content) {
} else {
div.textContent = content;
}
wrapper.appendChild(div);
// Add action buttons (copy for all, edit for user)
// Add action buttons (copy for all, edit for user) outside the message box
if (role !== 'system') {
div.appendChild(createMessageActions(role));
wrapper.appendChild(createMessageActions(role));
}
return div;
return wrapper;
}
function createToolEventEl(event, data) {