fix: QA-found defect — streamed assistant rows missing Copy/Translate/Regenerate actions

This commit is contained in:
Daniel 2026-09-08 19:39:39 +02:00
parent 79de7ccddb
commit 3626f590d8

View file

@ -392,6 +392,14 @@ import {
row.classList.remove('assistant-loading-msg');
bubble.classList.remove('assistant-thinking');
fillMessageBubble(bubble, 'assistant', content, sources, suggestions, rawHtml);
if (!row.querySelector('.assistant-msg-actions')) {
var actions = document.createElement('div');
actions.className = 'assistant-msg-actions';
actions.innerHTML = '<button type="button" data-assistant-msg-copy title="Copy raw message"><i class="fas fa-copy"></i></button>' +
'<button type="button" data-assistant-msg-translate title="Translate"><i class="fas fa-language"></i></button>' +
'<button type="button" data-assistant-msg-regenerate title="Regenerate"><i class="fas fa-rotate-right"></i></button>';
row.appendChild(actions);
}
var wrap = document.getElementById('assistant-messages');
if (wrap) wrap.scrollTop = wrap.scrollHeight;
messages.push({ role: 'assistant', content: content, sources: sources || [] });