From fbe02b19562eded44f9649851eeb3be2b87e15a0 Mon Sep 17 00:00:00 2001 From: gramps Date: Mon, 13 Jul 2026 15:49:52 -0700 Subject: [PATCH] feat: add copy/toolbar to user messages - msg-toolbar now rendered for all roles, not just assistant - addCopyButtons and addMessageToolbar applied to any message with content --- templates/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index b31832e..0256ffe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1433,7 +1433,7 @@ function appendMessage(role, content, animate, isSearch = false, afterEl = null) const months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; const ms = now.getMilliseconds(); const timeStr = months[now.getMonth()] + ' ' + String(now.getDate()).padStart(2,'0') + ', ' + now.getFullYear() + ' ' + String(now.getHours()).padStart(2,'0') + ':' + String(now.getMinutes()).padStart(2,'0') + ':' + String(now.getSeconds()).padStart(2,'0') + '.' + String(Math.floor(ms / 10)).padStart(2,'0'); - div.innerHTML = `
${role === 'user' ? 'YOU' : 'AI'}
${role}${role === 'user' ? ' ' + timeStr + '' : ''}
${content ? renderMarkdown(content) : ''}
${role === 'assistant' ? '
' : ''}
`; + div.innerHTML = `
${role === 'user' ? 'YOU' : 'AI'}
${role}${role === 'user' ? ' ' + timeStr + '' : ''}
${content ? renderMarkdown(content) : ''}
`; if (role === 'user') { const pair = document.createElement('div'); pair.className = 'msg-pair' + (isSearch ? ' search-pair' : ''); @@ -1449,7 +1449,7 @@ function appendMessage(role, content, animate, isSearch = false, afterEl = null) } else { container.prepend(div); } - if (content && role === 'assistant') { addCopyButtons(div); addMessageToolbar(div); } + if (content) { addCopyButtons(div); addMessageToolbar(div); } scrollToTop(); return div; }