fix: timestamp пропадал при streaming — сохранять при re-render

innerHTML = renderMarkdown() стирал .msg-time element.
Теперь сохраняем timeEl перед re-render и prepend обратно.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-27 02:35:25 +10:00
co-authored by Claude Opus 4.6
parent c6276357e1
commit fb37abd2b3
+3 -1
View File
@@ -379,9 +379,11 @@ async function sendMessage() {
}
aiText += data.text;
aiDiv._rawText = aiText;
// Re-render markdown (keep copy button)
// Re-render markdown (keep time + copy button)
const copyBtn = aiDiv.querySelector('.copy-btn');
const timeEl = aiDiv.querySelector('.msg-time');
aiDiv.innerHTML = renderMarkdown(aiText);
if (timeEl) aiDiv.prepend(timeEl);
if (copyBtn) aiDiv.appendChild(copyBtn);
msgs.scrollTop = msgs.scrollHeight;
} else if (eventType === 'tool') {