Skip to content

feat(app): cycle side-panel tabs when side panel is focused - #54899

Merged
kitlangton merged 1 commit into
devfrom
side-panel-tabs
Oct 13, 2026
Merged

kitlangton merged 1 commit into
devfrom
side-panel-tabs

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Pressing the tab-cycling shortcuts (⌃Tab / ⌃⇧Tab, ⌘⌥← / ⌘⌥→) while keyboard focus is inside the right side panel (#review-panel) always switches the top-level session tab instead of cycling the open side-panel tabs. When reviewing diffs alongside open files, users expect tab-switching shortcuts inside a focused side panel with multiple tabs to cycle those side-panel tabs, matching desktop apps like ChatGPT/Codex.

What Changes

Side panel state Keyboard focus tab.prev / tab.next (⌘⌥← / ⌘⌥→, ⌃⇧Tab / ⌃Tab)
Open with > 1 drawn tab Inside #review-panel (outside extension-scoped subtrees) Cycles the drawn side-panel tabs (actions.region.keys(), wrapping around) and preserves focus inside #review-panel
Open with > 1 drawn tab Outside #review-panel (e.g. prompt composer or session timeline) Cycles top-level session tabs
Closed or <= 1 drawn tab Anywhere Cycles top-level session tabs

Demo

side-panel-tabs-demo.mp4

Left (Before): pressing ⌃Tab / ⌃⇧Tab with focus inside the side panel switches the active session tab to Beta session. Right (After): pressing ⌃Tab / ⌃⇧Tab with focus inside the side panel cycles between greet.ts and Files Changed 2 while keeping Alpha session active; moving focus back to the prompt composer and pressing ⌃Tab switches to Beta session.

Scope

Owns focus-scoped side-panel tab cycling (file.tab.prev / file.tab.next) in useSessionCommands and focus containment on #review-panel in SideRegion.

Verification

bun run lint:changed
cd packages/app && bun test src/shell/commands/command.test.ts
cd packages/app && bunx playwright test e2e/regression/tabs.spec.ts e2e/regression/side-panels.spec.ts --workers=2
bun run check
  • lint:changed: 0 problems in 3 changed files.
  • e2e/regression/tabs.spec.ts and e2e/regression/side-panels.spec.ts: 19 passed (including new regression test covering composer focus vs side-panel focus and falling back to session tabs once only one side-panel tab remains).
  • bun run check: 34/34 packages passed typecheck and lint.

@opencode-agent opencode-agent Bot left a comment

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.

Looks good. I ran the new e2e test on the base branch, where it fails as described: with focus in the side panel, Control+Tab switches to the other session. With this PR it passes, along with the rest of tabs.spec.ts and side-panels.spec.ts (19 tests). command.test.ts and the packages/app type check also pass.

The new commands follow the existing file.close pattern. They're registered only when the panel is open with more than one tab, and they only fire while focus is in #review-panel outside extension-scoped subtrees. Everywhere else, the session-level tab.prev/tab.next commands still handle these shortcuts.

Public API is unchanged (app-internal commands only; they reuse the existing tab.prev/tab.next keybind settings).

@kitlangton
kitlangton merged commit 573fd29 into dev Oct 13, 2026
17 of 18 checks passed
@kitlangton
kitlangton deleted the side-panel-tabs branch October 13, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant