fix: 回合活跃边界修正——本地用户消息为硬边界,历史回合不再被误激活展开
This commit is contained in:
@@ -135,6 +135,11 @@ export default function App(): JSX.Element {
|
|||||||
// 主进程侧 openView(插件 main 工厂 / 深链按钮)→ 渲染层切视图
|
// 主进程侧 openView(插件 main 工厂 / 深链按钮)→ 渲染层切视图
|
||||||
useEffect(() => window.api.onPluginsView((change) => handleOpenView(change.view, change.params)), [handleOpenView])
|
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 整页重载)
|
// 插件列表变化(扫描/重载/启停)→ 刷新外置插件页(iframe 换 src 整页重载)
|
||||||
useEffect(
|
useEffect(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
@@ -108,11 +108,13 @@ function renderTurns(
|
|||||||
// turnActive/streaming 是会话级信号:只有延伸到消息列表末尾的最后一个
|
// turnActive/streaming 是会话级信号:只有延伸到消息列表末尾的最后一个
|
||||||
// assistant 组是「活跃回合」。透传给历史回合会让它们误显示
|
// assistant 组是「活跃回合」。透传给历史回合会让它们误显示
|
||||||
// 「已工作/处理中」并保持过程区展开。
|
// 「已工作/处理中」并保持过程区展开。
|
||||||
// 放宽:会话级 turnActive 期间,组后仅尾随非真实用户消息(自动压缩/分支
|
// 放宽边界:会话级 turnActive 期间,组后尾随「非用户消息」(自动压缩/分支
|
||||||
// 摘要通知行)时不算离开末尾——否则压缩间隙 live 跌落,600ms 自动收起后
|
// 摘要通知行等)时不算离开末尾——否则压缩间隙 live 跌落,600ms 自动收起后
|
||||||
// 续跑又展开,形成展开/收起反复横跳(慢工具/长会话反复压缩尤甚)。
|
// 续跑又展开,形成展开/收起反复横跳(慢工具/长会话反复压缩尤甚)。
|
||||||
|
// 任何 user 消息(含本地乐观插入)都是硬边界——否则本地用户消息尾随时,
|
||||||
|
// 前一个历史回合会被误激活展开(实测捕获:h- 前缀历史回合 false->true)。
|
||||||
let liveEnd = j
|
let liveEnd = j
|
||||||
while (liveEnd < messages.length && !(messages[liveEnd].role === 'user' && !messages[liveEnd].local)) {
|
while (liveEnd < messages.length && messages[liveEnd].role !== 'user') {
|
||||||
liveEnd += 1
|
liveEnd += 1
|
||||||
}
|
}
|
||||||
const isLive = j === messages.length || (turnActive && liveEnd === messages.length)
|
const isLive = j === messages.length || (turnActive && liveEnd === messages.length)
|
||||||
|
|||||||
Reference in New Issue
Block a user