From 8df8a0e3d11de9f349459cb89d6bffa247d934f6 Mon Sep 17 00:00:00 2001 From: Rick Ye Date: Thu, 10 Sep 2026 10:28:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=9E=E5=90=88=E6=B4=BB=E8=B7=83?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E4=BF=AE=E6=AD=A3=E2=80=94=E2=80=94=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E7=94=A8=E6=88=B7=E6=B6=88=E6=81=AF=E4=B8=BA=E7=A1=AC?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=EF=BC=8C=E5=8E=86=E5=8F=B2=E5=9B=9E=E5=90=88?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E8=A2=AB=E8=AF=AF=E6=BF=80=E6=B4=BB=E5=B1=95?= =?UTF-8?q?=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/src/renderer/src/App.tsx | 5 +++++ apps/desktop/src/renderer/src/components/ChatView.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/renderer/src/App.tsx b/apps/desktop/src/renderer/src/App.tsx index 940caeb..4e159ed 100644 --- a/apps/desktop/src/renderer/src/App.tsx +++ b/apps/desktop/src/renderer/src/App.tsx @@ -135,6 +135,11 @@ export default function App(): JSX.Element { // 主进程侧 openView(插件 main 工厂 / 深链按钮)→ 渲染层切视图 useEffect(() => window.api.onPluginsView((change) => handleOpenView(change.view, change.params)), [handleOpenView]) + // TEMP-DEBUG: 移除(改为 App.tsx 模块级触发) + + // 主进程侧 openView(插件 main 工厂 / 深链按钮)→ 渲染层切视图 + useEffect(() => window.api.onPluginsView((change) => handleOpenView(change.view, change.params)), [handleOpenView]) + // 插件列表变化(扫描/重载/启停)→ 刷新外置插件页(iframe 换 src 整页重载) useEffect( () => diff --git a/apps/desktop/src/renderer/src/components/ChatView.tsx b/apps/desktop/src/renderer/src/components/ChatView.tsx index 6ffac1c..85f21dd 100644 --- a/apps/desktop/src/renderer/src/components/ChatView.tsx +++ b/apps/desktop/src/renderer/src/components/ChatView.tsx @@ -108,11 +108,13 @@ function renderTurns( // turnActive/streaming 是会话级信号:只有延伸到消息列表末尾的最后一个 // assistant 组是「活跃回合」。透传给历史回合会让它们误显示 // 「已工作/处理中」并保持过程区展开。 - // 放宽:会话级 turnActive 期间,组后仅尾随非真实用户消息(自动压缩/分支 - // 摘要通知行)时不算离开末尾——否则压缩间隙 live 跌落,600ms 自动收起后 + // 放宽边界:会话级 turnActive 期间,组后尾随「非用户消息」(自动压缩/分支 + // 摘要通知行等)时不算离开末尾——否则压缩间隙 live 跌落,600ms 自动收起后 // 续跑又展开,形成展开/收起反复横跳(慢工具/长会话反复压缩尤甚)。 + // 任何 user 消息(含本地乐观插入)都是硬边界——否则本地用户消息尾随时, + // 前一个历史回合会被误激活展开(实测捕获:h- 前缀历史回合 false->true)。 let liveEnd = j - while (liveEnd < messages.length && !(messages[liveEnd].role === 'user' && !messages[liveEnd].local)) { + while (liveEnd < messages.length && messages[liveEnd].role !== 'user') { liveEnd += 1 } const isLive = j === messages.length || (turnActive && liveEnd === messages.length)