diff --git a/vscode/package.json b/vscode/package.json index c729764..9d78367 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -2,7 +2,7 @@ "publisher": "clurdra", "name": "superpowers-vscode-clurdra", "displayName": "Superpowers-clurdra", - "version": "0.2.125", + "version": "0.2.126", "packageManager": "pnpm@10.27.0", "description": "Superpowers specs and plans Kanban explorer", "author": "clurdra", diff --git a/vscode/src/panel/KanbanPanel.ts b/vscode/src/panel/KanbanPanel.ts index 93ecdbb..9b33d82 100644 --- a/vscode/src/panel/KanbanPanel.ts +++ b/vscode/src/panel/KanbanPanel.ts @@ -912,8 +912,12 @@ export class KanbanWebviewPanel { async loadAndPush(): Promise { if (this.loadInFlight) return this.loadInFlight + // 每次真正开跑都成对推 loading/loaded,webview 据此转刷新图标; + // 无论成功、报错还是缺 token 中途返回,finally 都会收尾。 + this.postMessage({ type: 'issues/loading' }) this.loadInFlight = this.loadAndPushInner().finally(() => { this.loadInFlight = undefined + this.postMessage({ type: 'issues/loaded' }) }) return this.loadInFlight } diff --git a/vscode/src/panel/messages.ts b/vscode/src/panel/messages.ts index 8d4eaf4..8c7e95b 100644 --- a/vscode/src/panel/messages.ts +++ b/vscode/src/panel/messages.ts @@ -49,6 +49,7 @@ export type ToastLevel = 'info' | 'success' | 'error' export type ExtensionToWebview = | { type: 'issues/loading' } + | { type: 'issues/loaded' } | { type: 'issues/update', issues: Issue[], scope: 'mine' | 'all', globalAutoReview: boolean, youtrackConfigured: boolean, me?: string, avatars?: Record } | { type: 'issues/error', message: string } | { type: 'issue/patch', issueNumber: number, patch: { autoReview?: boolean, specFile?: string, planFile?: string, prDiffFile?: string | null, sessionId?: string | null, implementSessionId?: string | null, reviewSessionId?: string | null, reviewSessionFileExists?: boolean, testSessionId?: string | null, pr?: string | null, implementStatus?: 'running' | 'done' | 'failed' | null, column?: IssueColumn, worktreePath?: string | null, prMerged?: boolean, prMergedAt?: string | null, branch?: string | null, color?: string, worktreeExists?: boolean, brainstormTabOpen?: boolean, implementTabOpen?: boolean, reviewTabOpen?: boolean, testTabOpen?: boolean, profilePath?: string | null, brainstormProfilePath?: string | null, testProfilePath?: string | null, assignees?: string[], handoffAttachmentId?: string | null, handoffFrom?: string | null } } diff --git a/vscode/webview-ui/src/App.tsx b/vscode/webview-ui/src/App.tsx index 276c28b..16e2e29 100644 --- a/vscode/webview-ui/src/App.tsx +++ b/vscode/webview-ui/src/App.tsx @@ -30,6 +30,7 @@ export function App() { avatars, setIssues, refresh, + refreshing, saveSettings, listYouTrackProjects, youtrackProjects, @@ -305,6 +306,7 @@ export function App() { <> void + /** host 正在重拉看板;为 true 时刷新图标转起来。 */ + refreshing: boolean /** 看板范围:'mine' 只看我的(assigned/created),'all' 团队全部工单。 */ scope: 'mine' | 'all' onToggleScope: () => void @@ -65,6 +67,7 @@ function releaseTitle(release: ReleaseStatus | undefined): string { export function PanelHeader({ onRefresh, + refreshing, scope, onToggleScope, onEditAuth, @@ -207,11 +210,13 @@ export function PanelHeader({