From 7888d15a3897a9243dad6c725961d4a34f8c3402 Mon Sep 17 00:00:00 2001 From: cruldra Date: Thu, 24 Sep 2026 15:33:25 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(vscode):=20profiles.json=20?= =?UTF-8?q?=E5=9C=A8=E5=A4=96=E9=83=A8=E8=A2=AB=E6=94=B9=E5=8A=A8=E5=90=8E?= =?UTF-8?q?=20Profile=20tab=20=E5=AE=9E=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vscode/src/panel/KanbanPanel.ts | 4 ++++ vscode/src/panel/handlers/settings.ts | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/vscode/src/panel/KanbanPanel.ts b/vscode/src/panel/KanbanPanel.ts index 2d4e519..93b7a63 100644 --- a/vscode/src/panel/KanbanPanel.ts +++ b/vscode/src/panel/KanbanPanel.ts @@ -317,6 +317,10 @@ export class KanbanWebviewPanel { // toolbar button whenever the working tree is clean. Fire-and-forget — // `setupGitWatcher` handles its own activation + retry logic. toolbar.setupGitWatcher(this) + + const profilesWatcher = settings.watchProfilesFile(this) + if (profilesWatcher) + this.disposables.push(profilesWatcher) } private syncFocusedTerminalTab(): void { diff --git a/vscode/src/panel/handlers/settings.ts b/vscode/src/panel/handlers/settings.ts index c1321cb..e7954df 100644 --- a/vscode/src/panel/handlers/settings.ts +++ b/vscode/src/panel/handlers/settings.ts @@ -1,3 +1,4 @@ +import type { Disposable } from 'vscode' import type { ProfilesData } from '../../profiles/store' import type { KanbanWebviewPanel } from '../KanbanPanel' import { execFile } from 'node:child_process' @@ -5,7 +6,7 @@ import * as fs from 'node:fs' import * as os from 'node:os' import * as path from 'node:path' import process from 'node:process' -import { commands, env, Uri, workspace } from 'vscode' +import { commands, env, RelativePattern, Uri, workspace } from 'vscode' import { clearIdentityCache, initIdentity } from '../../auth/identity' import { getToken, getYouTrackToken, setToken, setYouTrackToken } from '../../auth/secrets' import { listClaudeProfiles, setProfilesDirOverride } from '../../cc/profiles' @@ -329,6 +330,24 @@ export async function handleProfilesGet(panel: KanbanWebviewPanel): Promise { + void handleProfilesGet(panel) + } + watcher.onDidChange(refresh) + watcher.onDidCreate(refresh) + watcher.onDidDelete(refresh) + return watcher +} + /** * Read profiles from the hardcoded directory and push the list to the * webview. Failures are swallowed and surfaced as an empty list so the