feat(chat): 打字机输出/智能滚动跟随/切会话清空/回到底部按钮

- AI 流式输出改打字机效果:逐字推进+末尾闪烁光标,结束补足 markdown 渲染
- 智能滚动跟随:贴近底部自动滚;用户向上滚(wheel/touchmove)立即暂停,回底部恢复
- 切会话先清空旧内容并显示加载中,避免短暂展示上一会话内容
- 右下角「回到底部」按钮:上翻历史时出现;AI 输出中叠加加载转圈(模拟 deepseek)
This commit is contained in:
2026-09-02 19:20:58 +08:00
parent a370f5d7bb
commit fedfd8a659
4 changed files with 173 additions and 6 deletions
+3
View File
@@ -21,6 +21,9 @@ const state = {
pendingEl: null,
pendingTimer: null,
pendingStart: 0,
// 滚动跟随相关:用户是否在底部附近、是否因手动向上翻阅而暂停自动跟随
autoScroll: true,
streaming: false, // AI 是否正在输出(用于滚动到底部按钮显示加载提示)
};
window.tabModules = window.tabModules || {};