⚡ perf(vscode): 开会话去掉多余远程往返,spinner 跟随真实进度

开会话原先要先全量拉工单(含每张工单的评论、依赖、PR)做前置锁检查,
再各读一次 state JSON 给 pre-create 钩子和终端图标,几秒后才 createTerminal。

- 锁检查改用主进程已算好的工单快照,快照里没有该工单才回落全量拉取
- state JSON 一次读两处用,且提前发起与本地准备重叠
- 会话行 spinner 由扩展的 session/tab-settled 消息驱动,不再是固定 1.5s 假动画,
  消息丢失时 60s 超时兜底

Claude-Session: https://claude.ai/code/session_01Kgmb1LvrPmFX3NoUDB4zZC
This commit is contained in:
cruldra committed 2026-09-13 10:14:48 +08:00
1 parent b182e0ac5b
commit 70b826123c
12 files changed
+218 -71

No files matched your search

@@ -39,6 +39,8 @@ interface IssueDetailPanelProps {
globalAutoReview: boolean
onOpenInBrowser: (url: string) => void
onResumeSession: (sessionId: string, kind: 'implement' | 'brainstorm', profilePath?: string, cwd?: string, issueNumber?: number) => void
/** 会话 id 行的 spinner:该会话的开 tab 请求还没被扩展处理完就为 true。 */
isSessionTabPending: (sessionId: string) => boolean
/**
* Open a new terminal that runs `codex resume <id>` for the auto-review
* conversation associated with this issue.
@@ -153,6 +155,7 @@ export function IssueDetailPanel({
onUpdateTestProfilePath,
onOpenLogs,
me,
isSessionTabPending,
onStartHandoff,
onAcceptHandoff,
isHandoffRunning,
@@ -252,6 +255,7 @@ export function IssueDetailPanel({
key: 'sessionId',
label: '头脑风暴会话id',
type: 'action' as const,
pending: hasSession ? isSessionTabPending(issue!.sessionId!) : false,
description: hasSession
? '双击在新终端运行 claude --resume <id> 恢复对话;点 ▶ 续聊'
: '工单尚未关联 cc 会话;点 ▶ 新开一个规划会话并续聊',
@@ -274,6 +278,7 @@ export function IssueDetailPanel({
key: 'implementSessionId',
label: '实施会话id',
type: 'action',
pending: issue?.implementSessionId ? isSessionTabPending(issue.implementSessionId) : false,
description: issue?.worktreeExists
? '双击在新终端运行 claude --resume <id> 恢复实施对话(cwd 为 worktree)'
: 'worktree 已清理,将在工作区根目录恢复(cc 可能提示原 cwd 不存在)',
@@ -298,6 +303,7 @@ export function IssueDetailPanel({
key: 'reviewSessionId',
label: '审查会话id',
type: 'action',
pending: issue.reviewSessionId ? isSessionTabPending(issue.reviewSessionId) : false,
description: '双击在新终端运行 codex resume <id> 查看审查会话(worktree 在则用之,否则工作区根目录)',
actionIcon: <Terminal className="size-3.5" />,
onAction: (v) => {
@@ -355,6 +361,7 @@ export function IssueDetailPanel({
key: 'testSessionId',
label: '测试会话id',
type: 'action' as const,
pending: hasSession ? isSessionTabPending(issue!.testSessionId!) : false,
description: hasSession
? '双击在新终端运行 claude --resume <id> 在工作区根(main)恢复测试对话'
: '工单 PR 合并后点击右侧 ▶ 在工作区根(main)启动一个测试 cc tab(让 cc 了解代码后告诉你怎么测试)',
@@ -535,7 +542,7 @@ export function IssueDetailPanel({
],
},
],
[onResumeSession, onResumeReviewSession, onResumeTestSession, onStartTestSession, onOpenFile, onImplement, onOpenPr, onGeneratePrDiffSummary, onOpenWorktree, onDeleteWorktree, onMergeBranch, onCloseSessionTab, onContinueBrainstorm, onClearBrainstormSession, onOpenLogs, issue, locked, lockTitle, globalAutoReview, prDiffSummaryRunning, profiles],
[onResumeSession, onResumeReviewSession, onResumeTestSession, onStartTestSession, onOpenFile, onImplement, onOpenPr, onGeneratePrDiffSummary, onOpenWorktree, onDeleteWorktree, onMergeBranch, onCloseSessionTab, onContinueBrainstorm, onClearBrainstormSession, onOpenLogs, issue, locked, lockTitle, globalAutoReview, prDiffSummaryRunning, profiles, isSessionTabPending],
)
// 同事的工单只读:属性表统一消毒,顶部只留查看类按钮。