diff --git a/.changeset/steady-sidebar-reload.md b/.changeset/steady-sidebar-reload.md new file mode 100644 index 00000000000..5617e44ee8a --- /dev/null +++ b/.changeset/steady-sidebar-reload.md @@ -0,0 +1,5 @@ +--- +"kilo-code": patch +--- + +Keep the Explorer and other primary sidebar views open when VS Code reloads while Kilo Code is hidden. diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 58b3d11b3ee..353724d1103 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -500,7 +500,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper private setSidebarVisible(visible: boolean): void { this.setStreamVisibility(visible) vscode.commands.executeCommand("setContext", "kilo-code.new.sidebarVisible", visible) - this.opts.onSidebarVisibilityChange?.(visible) } /** Resolve a WebviewPanel for displaying Kilo in an editor tab. */ diff --git a/packages/kilo-vscode/src/extension.ts b/packages/kilo-vscode/src/extension.ts index 63e75d9e3d0..2d956ed825e 100644 --- a/packages/kilo-vscode/src/extension.ts +++ b/packages/kilo-vscode/src/extension.ts @@ -29,7 +29,6 @@ let shuttingDown = false const RESTORE_KEY = "kilo.workbench.restore" type RestoreState = { - sidebar?: boolean agentManager?: boolean } @@ -50,10 +49,8 @@ export function activate(context: vscode.ExtensionContext) { // Create shared connection service (one server for all webviews) const connectionService = new KiloConnectionService(context) let restore = context.workspaceState.get(RESTORE_KEY) ?? {} - const closeSidebar = restore.sidebar === false const remember = (patch: RestoreState) => { const next = { ...restore, ...patch } - if (shuttingDown && patch.sidebar === false) next.sidebar = restore.sidebar if (shuttingDown && patch.agentManager === false) next.agentManager = restore.agentManager restore = next void context.workspaceState.update(RESTORE_KEY, restore) @@ -124,9 +121,7 @@ export function activate(context: vscode.ExtensionContext) { } // Create the provider with shared service - const provider = new KiloProvider(context.extensionUri, connectionService, context, { - onSidebarVisibilityChange: (visible) => remember({ sidebar: visible }), - }) + const provider = new KiloProvider(context.extensionUri, connectionService, context) provider.setRemoteService(remoteService) // Register the webview view provider for the sidebar. @@ -136,7 +131,6 @@ export function activate(context: vscode.ExtensionContext) { webviewOptions: { retainContextWhenHidden: true }, }), ) - if (closeSidebar) void vscode.commands.executeCommand("workbench.action.closeSidebar") // Ensure Agent Manager navigation keybindings work when a VS Code terminal has focus. // The terminal intercepts all keystrokes unless the command is listed in diff --git a/packages/kilo-vscode/src/kilo-provider/options.ts b/packages/kilo-vscode/src/kilo-provider/options.ts index e8f747ff8f2..32f5d3793ce 100644 --- a/packages/kilo-vscode/src/kilo-provider/options.ts +++ b/packages/kilo-vscode/src/kilo-provider/options.ts @@ -4,6 +4,5 @@ export type KiloProviderOptions = { snapshotInitialization?: "wait" slimEditMetadata?: boolean tabTitle?: (title: string) => void - onSidebarVisibilityChange?: (visible: boolean) => void worktreeDirectories?: () => string[] }