修复: 生成中历史轮次轨迹卡误降级不可点击

- 执行中降级分支仅锚定含 store 末条消息的轮次桶,历史桶保持可交互
- 原实现只要会话生成中就把全部轮次桶压成 step 摘要行(BUG-261001)
This commit is contained in:
lxy
2026-10-01 22:36:27 +08:00
parent 74cad6442b
commit ea20a465d6
+6 -5
View File
@@ -879,12 +879,13 @@ const renderItems = computed<RenderItem[]>(() => {
bucket = [] bucket = []
if (msgs.length === 0) return if (msgs.length === 0) return
if (isViewingGenerating.value) { // BUG-261001:执行中分支仅作用于「正在生成」的轮次桶(含 store 末条消息的桶)。
// 执行中:当前步骤锚定真实末条消息(agentic 新一轮 push 新空气泡,若按「末条有正文」 // 原实现只判 isViewingGenerating——只要会话在生成,全部轮次桶(含早已完成的历史轮次)
// 找锚点会错挂上一轮,致当前轮打字机/光标/工具卡整条不渲染);先前步骤收进一行实时摘要。 // 都被降级为不可交互的 step 摘要行,历史轨迹卡展开/折叠点击全部失效
// 摘要统计取整个轮次桶(含当前消息):执行中工具挂在末条消息上(useAiToolEvents 取 // (用户表象:新一轮执行时,上一轮轨迹也"不可点击")。历史桶保持完成态轨迹卡可点。
// state.messages 末条),只统计 prev 拿不到 runningName,完成计数也滞后一轮(黑盒主因) const lastStoreId = store.state.messages[store.state.messages.length - 1]?.id
const cur = msgs[msgs.length - 1] const cur = msgs[msgs.length - 1]
if (isViewingGenerating.value && cur.id === lastStoreId) {
const prev = msgs.slice(0, -1) const prev = msgs.slice(0, -1)
if (prev.length > 0) { if (prev.length > 0) {
pushTimeSepIfNeeded(items, msgs[0].timestamp) pushTimeSepIfNeeded(items, msgs[0].timestamp)