Skip to content

fix(vscode/cursor): keep sidebar navigation visible in the secondary side bar - #12894

Merged
bagatao-anaconda merged 14 commits into
mainfrom
fix/kilo-navigation-secondary-sidebar
Aug 6, 2026
Merged

fix(vscode/cursor): keep sidebar navigation visible in the secondary side bar#12894
bagatao-anaconda merged 14 commits into
mainfrom
fix/kilo-navigation-secondary-sidebar

Conversation

@bagatao-anaconda

@bagatao-anaconda bagatao-anaconda commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Issue

No tracked issue — reported directly during a support/debugging session.

Context

The Kilo sidebar's navigation bar (New Task, History, Agent Manager, KiloClaw, Marketplace, Profile, Settings) disappeared entirely when the Kilo view was moved from the primary Activity Bar sidebar into the Secondary Side Bar.

This turned out to be Cursor-specific, not a VS Code issue — real VS Code (v1.132.0) renders the native toolbar correctly there. This matches a known category of bug in Cursor's Secondary Sidebar/Auxiliary Bar support for extension-contributed view/title toolbars, reported independently for other extensions — not something Kilo's package.json contributions were doing wrong.

Implementation

The nav bar was never rendered by Kilo's webview — it was the native view/title toolbar, contributed declaratively in package.json and rendered by the host shell outside the webview's DOM. There's no API to detect a host dropping it, so the fix moves navigation into the webview itself, where Kilo fully controls rendering regardless of host or dock location:

  • Added SidebarTopBar.tsx, an icon-button row wired to the same actions as the old native buttons (New Task/History dispatch locally; Agent Manager/KiloClaw/Marketplace/Settings reuse existing postMessage types). Added one new message type, openProfilePanel, routed through sidebar-worktree.ts to avoid KiloProvider's handleWebviewMessage switch, already at the ESLint complexity cap.
  • Rendered SidebarTopBar at the top of App.tsx, shared by both the sidebar and the "Open in Tab" panel.
  • Removed the now-redundant view/title menu contributions and the sidebarTitle.* command wrappers in extension.ts, which became dead code once the menus were removed.
  • Each click emits the same TITLE_BUTTON_CLICKED telemetry event the native wrappers used to record, via the existing "telemetry" webview message.
  • Icons render the real VS Code codicon font (@vscode/codicons), matching the icons on the removed native commands exactly, rather than an approximation — so the glyphs look identical to native in both VS Code and Cursor.
  • Added a Storybook story and translated the new sidebar.topBar.* strings for all 20 supported locales.

Note for reviewers: the bar's chrome changes in VS Code too, even though VS Code's native rendering already worked fine — it moves from native title-bar buttons to a webview-rendered row (with its own hover/ghost styling and a border separating it from the native pane title above). The icon glyphs themselves are unchanged, since they render the same codicon font. Functionality is equivalent everywhere.

Screenshots / Video

VS Code (nav bar already worked natively; shows the new webview-rendered row)

vscode

Cursor (primary bug — nav bar missing in Secondary Side Bar before this fix, present after)

cursor

How to Test

Manual/local verification

  • Built and launched against both Cursor and real VS Code (1.132.0) in isolated dev instances.
  • Confirmed the nav bar is missing in Cursor's Secondary Side Bar without this fix, present with it; VS Code already rendered it natively either way.
  • Clicked every button (New Task, History, Agent Manager, KiloClaw, Marketplace, Profile, Settings) in both hosts — same behavior as before.
  • Ran typecheck, lint, knip, and format in packages/kilo-vscode — all pass.

Reviewer test steps

  1. Build and launch the extension in dev mode (bun run extension from packages/kilo-vscode; see AGENTS.md for isolated-instance variants).
  2. Open the Kilo sidebar and confirm the nav bar (7 icons) appears above the chat.
  3. Right-click the Kilo Activity Bar icon → Move ViewSecondary Side Bar.
  4. Confirm the same nav bar appears there, and each button works.
  5. Run Kilo Code: Open in Tab and confirm the nav bar appears there too.

@bagatao-anaconda bagatao-anaconda self-assigned this Aug 5, 2026
Comment thread packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of commits since cccbdc3f. The new commit 4c263e3 removes the stale sidebarTitle.* comment, resolving the previous SUGGESTION. The merge from main touched two PR files (KiloProvider.ts, extension.ts); both resolutions were verified — no stale references (TelemetryEventName, localDiffSummary cleanly removed), no conflict markers, and the PR's own changes (openProfile wiring, topBar/topBarSurface options, sidebarTitle.* command removal) are intact. Earlier findings (telemetry surface prop, Storybook story) were addressed in prior rounds. No memory-leak concerns: the change adds no listeners, timers, or subscriptions, and the merged statsPoller?.stop() / statsGitOps?.dispose() cleanup improves disposal when the git directory changes.

Files Reviewed (4 files)
  • packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/chat/sidebar-top-bar-default-chromium-linux.png
Previous Review Summaries (3 snapshots, latest commit cccbdc3)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit cccbdc3)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Incremental review of commits since 013ce5a3 (codicon font rendering + top-bar border separation). The switch from kilo-ui IconButton to a raw <button> with codicon font glyphs was verified end-to-end: the <button> reproduces kilo-ui's exact DOM contract (data-component="icon-button"/data-variant/data-size + inner data-component="icon"), so existing kilo-ui styles apply unchanged; the codicon .ttf is covered by esbuild's file loader, cssPackageResolvePlugin, localResourceRoots, and CSP font-src; all seven codicon names are valid; and the CI-regenerated story baseline confirms the rendering pipeline. The bun.lock kilo-jetbrains bump matches that package's version on this branch (lockfile sync from main). No memory-leak concerns — the change adds no listeners, timers, or subscriptions. The only finding is a stale code comment referencing the sidebarTitle.* commands this PR deleted.

Fix these issues in Kilo Cloud

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx 13 New comment references kilo-code.new.sidebarTitle.* commands removed by this PR — dangling pointer for future readers
Files Reviewed (5 files)
  • bun.lock
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/chat/sidebar-top-bar-default-chromium-linux.png
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/styles/chat-layout.css

Previous review (commit 013ce5a)

Status: No Issues Found | Recommendation: Merge

Incremental review of commits since 9010494b. Both previous suggestions are resolved: the telemetry surface is now plumbed through as a prop (topBarSurface: "tab" set at both "Open in Tab" creation sites, injected via window.KILO_TOP_BAR_SURFACE, and passed to SidebarTopBar), and a SidebarTopBarDefault Storybook story was added with a matching CI baseline. The new hideTopBar option was verified end-to-end: Settings/Profile (including the restart deserialize path via wirePanel) and the Sub-Agent Viewer hide the bar, sidebar and tab surfaces show it with the correct telemetry surface, and other buildWebviewHtml callers (Marketplace, KiloClaw, Agent Manager, diff viewers) use separate bundles that never read the injected globals. No memory-leak concerns — the change adds no listeners, timers, or subscriptions.

Files Reviewed (10 files)
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/chat/sidebar-top-bar-default-chromium-linux.png
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/SettingsEditorProvider.ts
  • packages/kilo-vscode/src/SubAgentViewerProvider.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/src/kilo-provider/options.ts
  • packages/kilo-vscode/src/utils.ts
  • packages/kilo-vscode/webview-ui/src/App.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx

Previous review (commit 9010494)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2

Solid fix overall. The message wiring was verified end-to-end: all seven actions route to handlers that still exist (openProfilePanelhandleSidebarWorktreeMessagekilo-code.new.profileButtonClicked; the rest reuse existing KiloProvider cases), all icon names resolve in the kilo-ui icon set, the telemetry payload matches TelemetryRequest, every locale file carries the new keys, and no dangling sidebarTitle.* references remain. No memory-leak concerns — the change adds no listeners/timers and removes command subscriptions. Two optional follow-ups inline.

Fix these issues in Kilo Cloud

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx 46 Telemetry surface is hardcoded to "sidebar_title" even when the bar is clicked in the "Open in Tab" panel
packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx 35 New persistent UI component without a Storybook story under webview-ui/src/stories/
Files Reviewed (31 files)
  • .changeset/fix-secondary-sidebar-nav-bar.md
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/src/kilo-provider/sidebar-worktree.ts
  • packages/kilo-vscode/webview-ui/src/App.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx - 2 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts (+ 20 locale files: ar, br, bs, da, de, es, fa, fr, it, ja, ko, nl, no, pl, ru, th, tr, uk, zh, zht)
  • packages/kilo-vscode/webview-ui/src/styles/chat-layout.css
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts

Reviewed by kimi-k3 · Input: 57.7K · Output: 10K · Cached: 614.4K

Review guidance: REVIEW.md from base branch main

bagatao-anaconda and others added 3 commits August 5, 2026 15:55
SidebarTopBar rendered unconditionally at the top of App.tsx, but that
bundle is also used by the dedicated Settings, Profile, and Sub-Agent
Viewer panels (via KiloProvider.resolveWebviewPanel). Those panels now
showed the same nav bar, letting users navigate away from a panel
whose entire purpose is to show one focused view — e.g. clicking "New
Task" inside the Settings panel would replace it with a fresh chat.

KiloProvider now injects window.KILO_TOP_BAR / window.KILO_TOP_BAR_SURFACE
synchronously into the webview HTML it generates (same pattern as the
existing window.ICONS_BASE_URI), so App.tsx can gate the bar with no
postMessage race. Settings/Profile and the Sub-Agent Viewer set
hideTopBar: true; both "Open in Tab" construction sites set
topBarSurface: "tab" so their button clicks report a distinct
telemetry surface instead of being folded into "sidebar_title".
Agent Manager is unaffected — it renders a separate bundle via
attachToWebview, not resolveWebviewView/Panel.
Comment thread packages/kilo-vscode/webview-ui/src/components/chat/SidebarTopBar.tsx Outdated
@bagatao-anaconda
bagatao-anaconda merged commit 5bd4e53 into main Aug 6, 2026
32 checks passed
@bagatao-anaconda
bagatao-anaconda deleted the fix/kilo-navigation-secondary-sidebar branch August 6, 2026 14:21
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…econdary-sidebar

fix(vscode/cursor): keep sidebar navigation visible in the secondary side bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants