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:
+3
-1
@@ -379,9 +379,11 @@ async function sendMessage() {
|
|||||||
}
|
}
|
||||||
aiText += data.text;
|
aiText += data.text;
|
||||||
aiDiv._rawText = aiText;
|
aiDiv._rawText = aiText;
|
||||||
// Re-render markdown (keep copy button)
|
// Re-render markdown (keep time + copy button)
|
||||||
const copyBtn = aiDiv.querySelector('.copy-btn');
|
const copyBtn = aiDiv.querySelector('.copy-btn');
|
||||||
|
const timeEl = aiDiv.querySelector('.msg-time');
|
||||||
aiDiv.innerHTML = renderMarkdown(aiText);
|
aiDiv.innerHTML = renderMarkdown(aiText);
|
||||||
|
if (timeEl) aiDiv.prepend(timeEl);
|
||||||
if (copyBtn) aiDiv.appendChild(copyBtn);
|
if (copyBtn) aiDiv.appendChild(copyBtn);
|
||||||
msgs.scrollTop = msgs.scrollHeight;
|
msgs.scrollTop = msgs.scrollHeight;
|
||||||
} else if (eventType === 'tool') {
|
} else if (eventType === 'tool') {
|
||||||
|
|||||||
Reference in New Issue
Block a user