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
+6
View File
@@ -161,6 +161,12 @@
<div class="messages" id="messages"></div>
<!-- 滚动到底部按钮:上翻历史时显示;AI 输出中显示加载转圈 -->
<button class="scroll-bottom-btn hidden" id="scroll-bottom-btn" onclick="clickScrollBottom()" title="回到底部">
<svg class="sb-arrow" viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"></polyline></svg>
<svg class="sb-spinner hidden" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M22 12a10 10 0 0 1-10 10"></path></svg>
</button>
<!-- 文件面板 -->
<div class="files-panel hidden" id="files-panel">
<div class="files-panel-header">