Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto open sidebar on first installation #57

Merged
merged 8 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://marketplace.visualstudio.com/items?itemName=kilocode.Kilo-Code" target="_blank" rel="noopener noreferrer">
<img width="120" src="https://kilocode.ai/kilo-v1.svg" alt="Kilo Code logo">
<img width="120" src="assets/icons/Logo Outline - Black.png" alt="Kilo Code logo">
</a>

</p>
Expand Down
Binary file added assets/icons/Logo Outline - Black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export type GlobalStateKey =
| "remoteBrowserEnabled"
| "fireworksModelId"
| "fireworksModelInfo"
| "firstInstallCompleted" // Flag to track if the extension has been opened after installation

export type ConfigurationKey = GlobalStateKey | SecretKey

Expand Down
18 changes: 16 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function activate(context: vscode.ExtensionContext) {
extensionContext = context
outputChannel = vscode.window.createOutputChannel("Kilo-Code")
context.subscriptions.push(outputChannel)
outputChannel.appendLine("Kilo-Code extension activated")
outputChannel.appendLine("Kilo Code extension activated")

// Initialize terminal shell execution handlers.
TerminalRegistry.initialize()
Expand All @@ -60,6 +60,20 @@ export function activate(context: vscode.ExtensionContext) {
}),
)

if (!context.globalState.get("firstInstallCompleted")) {
// This is the first installation, open the sidebar
outputChannel.appendLine("First installation detected, opening Kilo Code sidebar")
// Use Promise.resolve to ensure we have a proper Promise with catch method
Promise.resolve(vscode.commands.executeCommand("kilo-code.SidebarProvider.focus"))
.then(() => {
// Set the flag to prevent this from happening again
context.globalState.update("firstInstallCompleted", true)
})
.catch((error: Error) => {
outputChannel.appendLine(`Error opening sidebar: ${error.message}`)
})
}

registerCommands({ context, outputChannel, provider })

/**
Expand Down Expand Up @@ -106,7 +120,7 @@ export function activate(context: vscode.ExtensionContext) {

// This method is called when your extension is deactivated
export async function deactivate() {
outputChannel.appendLine("Kilo-Code extension deactivated")
outputChannel.appendLine("Kilo Code extension deactivated")
// Clean up MCP server manager
await McpServerManager.cleanup(extensionContext)

Expand Down
1 change: 1 addition & 0 deletions src/shared/globalState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const GLOBAL_STATE_KEYS = [
"fireworksModelId",
"fireworksModelInfo",
"remoteBrowserEnabled",
"firstInstallCompleted", // Flag to track if the extension has been opened after installation
] as const

type CheckGlobalStateKeysExhaustiveness =
Expand Down