Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/steady-sidebar-reload.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion packages/kilo-vscode/src/KiloProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
8 changes: 1 addition & 7 deletions packages/kilo-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ let shuttingDown = false
const RESTORE_KEY = "kilo.workbench.restore"

type RestoreState = {
sidebar?: boolean
agentManager?: boolean
}

Expand All @@ -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<RestoreState>(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)
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion packages/kilo-vscode/src/kilo-provider/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export type KiloProviderOptions = {
snapshotInitialization?: "wait"
slimEditMetadata?: boolean
tabTitle?: (title: string) => void
onSidebarVisibilityChange?: (visible: boolean) => void
worktreeDirectories?: () => string[]
}
Loading