fix: ensure chat scrolls to bottom during streaming renders
Some checks failed
BotUI CI/CD / build (push) Has been cancelled
Some checks failed
BotUI CI/CD / build (push) Has been cancelled
This commit is contained in:
parent
1a4b39d6cf
commit
a46f6d20c3
1 changed files with 3 additions and 0 deletions
|
|
@ -994,6 +994,7 @@ function addMessage(sender, content, msgId) {
|
|||
if (isTagBalanced(cleanContent) || (Date.now() - lastRenderTime > 2000)) {
|
||||
msgContent.innerHTML = renderMentionInMessage(cleanContent);
|
||||
lastRenderTime = Date.now();
|
||||
if (!isUserScrolling) scrollToBottom(true);
|
||||
}
|
||||
} else {
|
||||
// Standard markdown/text rendering
|
||||
|
|
@ -1002,6 +1003,7 @@ function addMessage(sender, content, msgId) {
|
|||
: escapeHtml(cleanContent);
|
||||
parsed = renderMentionInMessage(parsed);
|
||||
msgContent.innerHTML = parsed;
|
||||
if (!isUserScrolling) scrollToBottom(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1019,6 +1021,7 @@ function addMessage(sender, content, msgId) {
|
|||
el.querySelector(".message-content").innerHTML = parsed;
|
||||
el.removeAttribute("id");
|
||||
setupMentionClickHandlers(el);
|
||||
if (!isUserScrolling) scrollToBottom(true);
|
||||
}
|
||||
streamingMessageId = null;
|
||||
currentStreamingContent = "";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue