fix: 流式日志原地更新 + 滚动用scrollIntoView

- 新增 logStreamProgress:同一ID日志更新不追加
- 定时器15s间隔,无新内容用累积闲置时长
- appendToolCardDOM 用 scrollIntoView + rAF
- renderToolCalls 用双重 rAF 等布局稳定
This commit is contained in:
thzxx
2026-06-13 08:15:06 +08:00
parent 87d3364886
commit 52026dbdd6
3 changed files with 28 additions and 6 deletions
+5 -3
View File
@@ -833,7 +833,7 @@ function appendToolCardDOM(tc: ToolCallRecord): void {
container.appendChild(card);
// 等浏览器完成布局后再滚到底部
requestAnimationFrame(() => {
container.scrollTop = container.scrollHeight;
container.lastElementChild?.scrollIntoView({ block: 'end' });
});
}
}
@@ -938,9 +938,11 @@ function renderToolCalls(): void {
html += renderToolCard(tc);
}
container.innerHTML = html;
// 等浏览器完成布局后再滚到底部
// 全量重建后等两帧让布局稳定,再滚到底部
requestAnimationFrame(() => {
container.scrollTop = container.scrollHeight;
requestAnimationFrame(() => {
container.lastElementChild?.scrollIntoView({ block: 'end' });
});
});
}