From fedfd8a6596f393dd33817f94e68e4c55d929b54 Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 2 Sep 2026 19:20:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20=E6=89=93=E5=AD=97=E6=9C=BA?= =?UTF-8?q?=E8=BE=93=E5=87=BA/=E6=99=BA=E8=83=BD=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F/=E5=88=87=E4=BC=9A=E8=AF=9D=E6=B8=85?= =?UTF-8?q?=E7=A9=BA/=E5=9B=9E=E5=88=B0=E5=BA=95=E9=83=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AI 流式输出改打字机效果:逐字推进+末尾闪烁光标,结束补足 markdown 渲染 - 智能滚动跟随:贴近底部自动滚;用户向上滚(wheel/touchmove)立即暂停,回底部恢复 - 切会话先清空旧内容并显示加载中,避免短暂展示上一会话内容 - 右下角「回到底部」按钮:上翻历史时出现;AI 输出中叠加加载转圈(模拟 deepseek) --- app/server/public/css/style.css | 25 ++++++ app/server/public/index.html | 6 ++ app/server/public/js/core.js | 3 + app/server/public/js/tasks.js | 145 ++++++++++++++++++++++++++++++-- 4 files changed, 173 insertions(+), 6 deletions(-) diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index 8c408f4..5106576 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -480,3 +480,28 @@ body { display: block; max-width: 240px; max-height: 240px; border-radius: 6px; margin-top: 6px; cursor: zoom-in; } + + /* 右下角「回到底部」按钮:上翻历史时出现;AI 输出中显示加载转圈 */ + .scroll-bottom-btn { + position: absolute; right: 14px; bottom: 72px; + width: 38px; height: 38px; border-radius: 50%; + border: none; cursor: pointer; padding: 0; + display: flex; align-items: center; justify-content: center; + background: #fff; box-shadow: 0 2px 8px rgba(30,40,90,0.18); + z-index: 70; opacity: 0.95; + } + .scroll-bottom-btn:active { opacity: 1; } + .scroll-bottom-btn svg { width: 20px; height: 20px; fill: none; stroke: #556; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } + /* 加载转圈:AI 正在输出 */ + .scroll-bottom-btn .sb-spinner { animation: sb-spin 0.8s linear infinite; } + .scroll-bottom-btn .sb-spinner circle { stroke: #dde; stroke-width: 2.5; fill: none; } + .scroll-bottom-btn .sb-spinner path { stroke: #3964FE; stroke-width: 2.5; stroke-linecap: round; fill: none; } + @keyframes sb-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } } + + /* 打字机光标:AI 流式输出中,气泡末尾闪烁竖条 */ + .msg-bubble.typing::after { + content: ''; display: inline-block; width: 2px; height: 1em; + background: #556; margin-left: 2px; vertical-align: text-bottom; + animation: tw-cursor 1s steps(1) infinite; + } + @keyframes tw-cursor { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } } diff --git a/app/server/public/index.html b/app/server/public/index.html index 903df15..bdc160d 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -161,6 +161,12 @@
+ + +