Skip to content

Right pane: Ctrl+1…9 jump to tabs - #790

Open
and-human wants to merge 1 commit into
zeronsh:mainfrom
and-human:right-panel-tab-shortcuts
Open

and-human wants to merge 1 commit into
zeronsh:mainfrom
and-human:right-panel-tab-shortcuts

Conversation

@and-human

@and-human and-human commented Oct 4, 2026 •

Copy link
Copy Markdown

Summary

Number shortcuts for the right pane's tabs, the way cmux pairs Cmd+1…9 (workspaces) with Ctrl+1…9 (the tabs inside a pane). Zeron already has the first half: ⌘1…9 jumps sidebar sessions. With several side chats, subagent transcripts, files and a browser open next to a chat, the only way between them today is the mouse, or Ctrl+Tab stepping one at a time once focus is already in the pane.

  • ⌃1…⌃8 select right pane tab 1…8 of the current chat, in tab-strip order (drag-reorders respected). ⌃9 selects the last tab, as in browsers.
  • If the pane is closed it opens on that tab. A number past the last tab does nothing. Like Ctrl+Tab, the jump is quiet under keyboard-owning overlays and only applies on the chat route.
  • Focus follows activation exactly as Ctrl+Tab's does (activate_right_surface): a side chat lands in its composer, a file in its editor, a browser in its address bar.
  • Off macOS the default is Alt+1…9. There mod is Ctrl, so Ctrl+1…9 already belongs to the session jumps. This is the same platform split the session-cycling shortcuts use.
  • Rebindable like every other shortcut: ShortcutId::JumpRightTab(slot), persisted as keymap.jumpRightTab: [...], which heals by slot like jumpSession. It gets its own "Jump to right pane tab" group on the Shortcuts page.

Please look closely at:

  • Defaults on macOS. ⌃1…9 is also macOS's "Switch to Desktop N", which is off by default. A user who has it enabled can rebind on the Shortcuts page, which already flags conflicts.
  • Terminal tabs. A matched app binding wins over a focused terminal, so ⌃1…9 switches tabs rather than reaching the shell. Terminals don't send anything distinct for Ctrl+digit, so I kept the panel behavior. Happy to exclude terminal focus instead if you prefer.
  • Compatibility. Settings-only (ui-settings.json, serde-defaulted). Older files load with the new defaults and keep their own combos. No wire or doc types change.
  • Not included: number badges on the tabs while the modifier is held, like the sidebar's jump hints. That touches the tab strip's rendering, so it would be a separate PR.

Test plan

  • settings::tests::right_tab_jumps_default_per_platform_without_conflicts: macOS ⌃N, elsewhere Alt+N; every default unique on both platforms; defaults spelled as each platform's recorder stores them; set, reset, and out-of-range slot
  • settings::tests::right_tab_slots_pick_their_tab_and_the_last_slot_the_last_tab: slot to tab index, last slot to last tab, empty and past-the-end
  • settings::tests::older_keymaps_gain_the_right_tab_jumps: a pre-existing keymap keeps its combos and gains the defaults; a short list heals by slot
  • shell::…::right_tab_jumps_select_by_strip_order: real keystrokes through apply_keymap select tabs 2, 1, then the last; past the end is a no-op; a closed pane reopens on the chosen tab
  • Existing: every_shortcut_lands_in_a_rendered_group, every_shortcut_default_is_unique_and_bindable, conflict_detection, the session-jump tests, and navigation_shortcuts_work_from_settings
  • cargo test --locked -p zeron-ui --lib -- --test-threads=1
  • cargo clippy -p zeron-ui --all-targets: nothing new in touched code. rustfmt applied to my changes only.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The right pane collects side chats, subagent transcripts, files, diffs and a
browser per chat, but moving between them took the mouse (or Ctrl+Tab one
step at a time once focus was already in the pane). Mirror cmux's surface
shortcuts next to the existing Cmd+1…9 session jumps.

- ShortcutId::JumpRightTab(slot): Ctrl+1…9 on macOS, Alt+1…9 elsewhere
  (where Ctrl is the primary and already jumps sessions). Slot 9 selects the
  last tab. Rebindable, persisted as keymap.jumpRightTab, healed by slot.
- The jump selects the tab in strip order, opens a closed pane, and moves
  focus like Ctrl+Tab (a side chat lands in its composer); quiet under
  keyboard-owning overlays and off the chat route.
- Shortcuts page: a "Jump to right pane tab" group.
@and-human
and-human marked this pull request as ready for review October 5, 2026 05:27
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.

1 participant