Open previews from the empty state and restore the last conversation on reload #49

Merged
weichen merged 1 commits from feature/empty-state-preview-fix into main 2026-10-10 08:24:30 +00:00
Owner

Why: headless Chromium 实测复现——空态(未选会话)点击工件行后仅工件弹层关闭、预览区完全不出现(requestPreview 写 currentConvId ?? '_' 键,渲染判 currentConvId 非空,键口径不一致);且 currentConvId 不持久化,刷新必回空态,构成高频触发路径(2026-10-10 用户实测问题 2)。

改动:

  • previewTabsKey() 统一读写键口径(App/PreviewPane/requestPreview/activate/close);
  • 进入会话时 mergeOrphanPreviewTabs 收编空态孤儿标签;
  • 上次会话 id 持久化(as.conv)并在首载恢复一次;
  • 交付卡片工件缺失时给 toast,不再无声无息。

Evidence: vitest 85/85(新增 preview-empty-state 3 测:键口径、孤儿收编、无孤儿不动);修复构建浏览器回放:空态点击→预览区挂载且 docx 渲染(bodyLen=157);刷新→会话恢复(stillEmpty=false)。截图与 Dev 任务卡。

Refs: Dev 任务 feature/empty-state-preview-fix。

Why: headless Chromium 实测复现——空态(未选会话)点击工件行后仅工件弹层关闭、预览区完全不出现(requestPreview 写 currentConvId ?? '_' 键,渲染判 currentConvId 非空,键口径不一致);且 currentConvId 不持久化,刷新必回空态,构成高频触发路径(2026-10-10 用户实测问题 2)。 改动: - previewTabsKey() 统一读写键口径(App/PreviewPane/requestPreview/activate/close); - 进入会话时 mergeOrphanPreviewTabs 收编空态孤儿标签; - 上次会话 id 持久化(as.conv)并在首载恢复一次; - 交付卡片工件缺失时给 toast,不再无声无息。 Evidence: vitest 85/85(新增 preview-empty-state 3 测:键口径、孤儿收编、无孤儿不动);修复构建浏览器回放:空态点击→预览区挂载且 docx 渲染(bodyLen=157);刷新→会话恢复(stillEmpty=false)。截图与 Dev 任务卡。 Refs: Dev 任务 feature/empty-state-preview-fix。
weichen added 1 commit 2026-10-10 08:02:34 +00:00
Why: reproduced with headless Chromium - clicking an artifact row with no
conversation selected closed the workspace overlay and nothing else appeared.
requestPreview stores tabs under currentConvId ?? '_' while the render side
required a non-null currentConvId, so the preview pane never mounted in the
empty state. The empty state was itself a trap: currentConvId was not
persisted, so every reload landed there.
Evidence: vitest 85/85 (new preview-empty-state tests for the key contract
and orphan-tab merge); browser replay on the fixed build shows the preview
pane mounting with rendered docx content from the empty state and the
conversation restoring after reload (screenshots in the Dev task card).
Impact: previewTabsKey() unifies the read/write key; entering a conversation
adopts orphan '_' tabs; the last conversation id persists and restores once
on boot; deliverable cards toast when the artifact is gone instead of
silently doing nothing.
Refs: Dev task feature/empty-state-preview-fix; diagnosis session 2026-10-10.
weichen merged commit 339a9ebc2d into main 2026-10-10 08:24:30 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Frontend#49