【已审核】feat(tabs): Tab 预览展示完整迷你会话流 - #1428
Open
climashscape wants to merge 1 commit into
Open
Conversation
climashscape
marked this pull request as ready for review
August 4, 2026 19:17
While a session is streaming, hovering its Tab shows a full live mini session flow: thinking, tool calls and text output rendered in time order with auto-scroll, plus a run indicator (elapsed time + model). The preview collapses to a single stream section while running and falls back to the message minimap when idle. - chat-atoms: conversationStreamingStateAtomFamily (sliced subscription) - agent-atoms: agentSessionLiveMessagesAtomFamily + cleanup on delete - tab-atoms: TabStreamRunData / TabStreamActivity types - TabBar/TabBarItem: pass sessionId, subscribe to streaming states and assemble streamRun data - TabPreviewPanel: StreamRunSection + mini session flow renderer (buildAgentFlowEntries / buildChatFlowEntries), tool done/error backfill, fixed-id live text tail, bottom-aware auto-scroll - LeftSidebar: clear streaming/liveMessages family caches on delete
climashscape
force-pushed
the
feature/tab-preview-stream-run
branch
from
August 6, 2026 08:50
5b761fb to
815c860
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
Tab hover 预览面板新增会话流实时运行展示:当会话正在流式运行时,悬停 Tab 弹出的小窗展示完整迷你会话流——thinking、工具调用、文本输出按时间顺序滚动,顶部带运行指示条(耗时 + 模型名),并自动滚动贴底(用户上滚时暂停跟随)。运行中预览窗只保留流式区域一段(不再同时显示历史消息摘要),会话结束后恢复原有消息摘要预览,行为与改动前一致。
改动
apps/electron/src/renderer/atoms/agent-atoms.ts:新增agentSessionLiveMessagesAtomFamily(按 sessionId 切片订阅实时 SDK 消息,避免整树重渲染)apps/electron/src/renderer/atoms/chat-atoms.ts:新增conversationStreamingStateAtomFamily(Chat 流式状态切片订阅)apps/electron/src/renderer/atoms/tab-atoms.ts:新增TabStreamRunData/TabStreamActivity类型(含 liveMessages / reasoning 字段)apps/electron/src/renderer/components/tabs/TabBar.tsx:向TabBarItem传入sessionIdapps/electron/src/renderer/components/tabs/TabBarItem.tsx:订阅 agent/chat 流式状态,组装streamRun数据(Chat 工具事件 start/result 合并)apps/electron/src/renderer/components/tabs/TabPreviewPanel.tsx:新增StreamRunSection+ 迷你会话流渲染器(buildAgentFlowEntries/buildChatFlowEntries/FlowEntry);工具完成/出错态由 streamState 回填;实时文本用固定 id 追加不覆盖已完成块;Preview memo 化、计时器 250ms 节流apps/electron/src/renderer/components/app-shell/LeftSidebar.tsx:删除会话/对话时清理 streaming / liveMessages atomFamily 缓存测试
bun run typecheck通过。已通过 BDD 自审查(独立子会话审查两轮,修复工具完成态回填、实时文本合并误判、自动滚动劫持等 4 个问题)。dev 模式实测:Agent 会话运行时 hover Tab,可看到 thinking / 工具活动(进行中旋转 → 完成绿勾 → 出错红叉)/ 文本输出按序实时滚动,仅显示单段;会话结束后恢复原消息摘要预览。紧急度
常规
备注
无关联 upstream issue。