Skip to content

feat(vscode): add searchable session tab switcher - #12462

Merged
marius-kilocode merged 7 commits into
Kilo-Org:mainfrom
hdcodedev:feat/session-tab-switcher
Jul 23, 2026
Merged

feat(vscode): add searchable session tab switcher#12462
marius-kilocode merged 7 commits into
Kilo-Org:mainfrom
hdcodedev:feat/session-tab-switcher

Conversation

@hdcodedev

Copy link
Copy Markdown
Contributor

Issue

No linked issue. This is a standalone sidebar navigation enhancement.

Context

When several sessions are open in the sidebar, tab titles become compressed or move outside the visible portion of the tab strip. Add a searchable open-tabs switcher so users can quickly find, activate, or close a session without navigating the strip manually.

Implementation

The tab strip now derives a searchable list from the existing local-tab order and session status state. The switcher distinguishes the current, pending, and working sessions; supports fuzzy title filtering and keyboard navigation; and lets users close a result without clearing the active filter. Selection and close flows explicitly restore focus to the chat prompt when the popover closes or the tab strip unmounts.

The switcher is composed from the shared Kilo UI popover, list, icon-button, spinner, and tooltip primitives. Search-menu presentation previously owned by Agent Manager was extracted into shared webview styles so both search surfaces use the same layout and interaction states. The new labels are localized across the extension's supported languages, with focused unit, Storybook accessibility, and RTL coverage.

Screenshots / Video

Screen.Recording.2026-07-22.at.17.17.52.mov
before after
Screenshot 2026-07-22 at 17 24 47 Screenshot 2026-07-22 at 17 24 18
Screenshot 2026-07-22 at 18 06 05

How to Test

Manual/local verification

  • Agent-executed bun test ./tests/unit/session-tab-switcher.test.ts: 2 tests passed.
  • Agent-executed bun run typecheck, bun run lint, bun run knip, bun run format:check, and bun run check-kilocode-change: passed.
  • Agent-executed bun run test:a11y: all 13 accessibility and keyboard-flow tests passed, including the new session switcher and the refactored Agent Manager search.

Reviewer test steps

  1. Open at least three sessions in the Kilo sidebar so the session tab strip is visible.
  2. Select Show open tabs at the end of the tab strip and confirm the search field receives focus.
  3. Enter a partial or fuzzy session-title match and confirm the results narrow appropriately.
  4. Use Arrow Down and Enter to choose a result; confirm the corresponding session becomes active and focus returns to the chat prompt.
  5. Reopen the switcher, filter to a session, and close it with its close button or the Delete/Backspace key while its row is focused. Confirm the tab closes and the filter remains intact while more than one tab remains.
  6. Confirm current, new, and working sessions display the expected status, and that the existing Agent Manager sidebar search still filters and selects results normally.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Comment thread packages/kilo-vscode/webview-ui/src/i18n/ar.ts
@kilo-code-bot

kilo-code-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/ui/src/components/list.tsx 185 Enter-selects-first fallback changes behavior for every List consumer (ProviderSelectDialog, SessionList, Agent Manager sidebar search), not just the new tab switcher
Files Reviewed (3 files, incremental since previous review)
  • packages/kilo-vscode/tests/accessibility.spec.ts - no issues (test coverage addition)
  • packages/kilo-vscode/tests/fixtures/session-tab-switcher.tsx - no issues (test coverage addition)
  • packages/ui/src/components/list.tsx - 1 issue

Fix these issues in Kilo Cloud

Previous Review Summaries (2 snapshots, latest commit 6bde89f)

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

Previous review (commit 6bde89f)

Status: No Issues Found | Recommendation: Merge

Notes:

  • Previously flagged WARNING (SessionTabSwitcher.tsx:109 — popover content with no accessible name) is fixed in e6e4f3e53b: Popover now accepts a contentLabel prop and sets aria-label on the Kobalte content element (packages/ui/src/components/popover.tsx), and both SessionTabSwitcher and SidebarSearchMenu now pass contentLabel={props.labels.open} / contentLabel={props.labels.search}. A new Playwright test (accessibility.spec.ts:200-205) asserts both search popovers expose an accessible dialog name.
Files Reviewed (4 files, incremental)
  • packages/kilo-vscode/tests/accessibility.spec.ts
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/SessionTabSwitcher.tsx
  • packages/ui/src/components/popover.tsx

Previous review (commit 9b9dc02)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/SessionTabSwitcher.tsx 109 Popover content has no accessible name (title/aria-label), so the switcher opens an unnamed dialog for screen readers
Files Reviewed (31 files)
  • .changeset/session-tab-switcher.md
  • packages/kilo-vscode/tests/accessibility.spec.ts
  • packages/kilo-vscode/tests/fixtures/session-tab-switcher.tsx
  • packages/kilo-vscode/tests/unit/session-tab-switcher.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
  • packages/kilo-vscode/webview-ui/src/components/chat/SessionTabStrip.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/SessionTabSwitcher.tsx
  • packages/kilo-vscode/webview-ui/src/i18n/*.ts (24 locale files)
  • packages/kilo-vscode/webview-ui/src/stories/session-tabs.stories.tsx
  • packages/kilo-vscode/webview-ui/src/styles/chat.css
  • packages/kilo-vscode/webview-ui/src/styles/search-menu.css
  • packages/kilo-vscode/webview-ui/src/styles/session-tabs.css
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/session-tabs/switcher-open-chromium-linux.png

Notes:

  • The existing thread on SessionTabStrip.tsx:166 about the switcher rendering unconditionally is addressed: ChatView.tsx:336 gates the entire SessionTabStrip (including the switcher) behind showTabStrip(tabs.ids()), which requires more than one tab, so the concern doesn't reproduce in production.
  • Tests (tests/fixtures/session-tab-switcher.tsx, tests/unit/session-tab-switcher.test.ts) exercise the real SessionTabSwitcher implementation via Solid.js + happy-dom rather than mocks — good test quality.
  • The CSS extraction into search-menu.css is otherwise clean (no orphaned/duplicate rules), though the Agent Manager search popover width narrowed from 360px to 320px and the trigger's idle/hover icon color rule appears to have been dropped in the consolidation — worth a quick visual sanity check against the before/after screenshots, though not filed as a formal finding since it's a possible existing pre-PR discrepancy in polish and would need design confirmation.

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 42 · Output: 10K · Cached: 984.3K

Review guidance: REVIEW.md from base branch main

@marius-kilocode

Copy link
Copy Markdown
Collaborator

@hdcodedev looks all good can you polish the usability when pressing enter after having searched a session? It seems to not auto select the first selected element.

@marius-kilocode marius-kilocode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the session tab switcher end to end. The Enter-selects-first gap (noInitialSelection left active() empty, so Enter in the search field selected nothing) is now fixed in the shared List with a guarded fallback to the first filtered result. The fallback is isolated: SidebarSearchMenu always has an active item, so its behavior is unchanged. CSS uses logical properties throughout (RTL test covers it), i18n is consistent across all 20 languages, and unit plus accessibility tests pass. No blockers.

@marius-kilocode
marius-kilocode enabled auto-merge (squash) July 23, 2026 08:50
@marius-kilocode

Copy link
Copy Markdown
Collaborator

Thanks @hdcodedev !

e.preventDefault()
if (selected) handleSelect(selected, index)
// kilocode_change start - fall back to first result when no item is active (noInitialSelection)
const target = selected ?? all[0]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Enter-selects-first fallback changes behavior for every List consumer, not just the tab switcher

This PR modifies the shared packages/ui (@opencode-ai/ui) List component so that pressing Enter with no highlighted row now selects all[0] instead of doing nothing. This is a global change: ProviderSelectDialog.tsx, SessionList.tsx, and Agent Manager's SidebarSearchMenu.tsx all render <List search={...} onSelect={...}> with no onKeyEvent override, so they inherit this new "select first result on blind Enter" behavior too, even though this PR's tests/story only cover the new session tab switcher.

For a provider picker or session history list, silently activating the top filtered row on Enter (before the user has looked at/confirmed it) is a more consequential UX change than for the tab switcher, and it isn't mentioned in the PR description or exercised by tests for those other surfaces. Consider scoping this to an opt-in prop (e.g. noInitialSelection, which the code comment already references) so existing List consumers keep their current Enter behavior unless they explicitly opt in.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marius-kilocode should we address this with follow up PR?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'pressing Enter with no highlighted row now selects all[0]'. I guess the bot just worked around it but it does the job. Nicer would have been if the first one was actually selected. So yes we can address that. Do you want to take this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I am already working on fix. I will prepare PR soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marius-kilocode
marius-kilocode merged commit 8eeaa54 into Kilo-Org:main Jul 23, 2026
32 checks passed
unixcrh pushed a commit to unixcrh/kilocode that referenced this pull request Aug 1, 2026
@hdcodedev
hdcodedev deleted the feat/session-tab-switcher branch August 8, 2026 07:34
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
* feat(vscode): add searchable session tab switcher

* Add screenshot

* fix(vscode): label search popover dialogs

* fix(vscode): select first result on Enter in session tab switcher

* fix(ui): wrap kilocode_change marker around Enter fallback block

---------

Co-authored-by: marius-kilocode <marius@kilocode.ai>
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.

2 participants