Skip to content

fix(desktop): ⌘1–9 switch side-panel tabs inside the side panel - #57301

Draft
kitlangton wants to merge 1 commit into
betafrom
side-tab-numbers
Draft

kitlangton wants to merge 1 commit into
betafrom
side-tab-numbers

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Kit asked for the browser-style shortcuts to follow focus into the side panel: ⌘T (#57156) and ⌘⇧T (#57269) did; ⌘1–9 didn't.

Now, while focus is in the side panel, ⌘1–8 select side-panel tab N and ⌘9 the last one, as in Chrome. Outside the panel, ⌘1–9 switch session tabs as before.

  • sideTabNumbers() in closed-tabs.ts builds nine hidden, untitled commands (file.tab.1–file.tab.9) scoped with the same createSideFocus() predicate as ⌘⇧T, so they stay out of Settings › Shortcuts and win over the session tab.N binds only inside the panel. Keys match by typed character, so Dvorak is unaffected.
  • They reuse the ⌃Tab/⌃⇧Tab side-tab cycling's selection and focus handling (selectSideTab), and are only registered while the side panel is open.
  • A focused web page already forwards ⌘1–9 to the pane (fix(app): keep app shortcuts working inside the browser pane #56697), and the pane dispatches them on its root, so they land in the side panel even after clicking outside.

Stacked on #57269 (now merged); rebased onto beta.

Test: a component story — ⌘1 forwarded from a focused page after clicking outside selects side tab 1, ⌘2/⌘9 inside the panel select tab 2/the last, and ⌘2 outside still switches the session tab.

This branch has not been deployed

No deployments
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