Skip to content

feat(web): pick models with Ctrl/Cmd+1..9 - #2273

Merged
chuks-qua merged 3 commits into
mainfrom
feat/issue-2226
Oct 21, 2026
Merged

chuks-qua merged 3 commits into
mainfrom
feat/issue-2226

Conversation

@chuks-qua

@chuks-qua chuks-qua commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Before, the model picker had no number shortcuts. Picking a model meant arrowing down or reaching for the mouse.

Now, while the picker is open, Ctrl+1..9 (Cmd+1..9 on macOS) pick the Nth selectable row of the active tab and close the picker. This works on every tab, Favourites included. Each numbered row shows its keycap. Disabled or gated rows get no number and do not use one up. Search renumbers the rows that remain.

New favourites now append instead of prepend. Starring a model no longer shifts every existing favourite down a row, so a favourite keeps its number. The order already saved on disk loads as it is, with no migration. At the 40-entry cap, the oldest favourite drops.

Picker gains an opt-in numberedShortcuts prop. Only ModelSelector turns it on, so the other pickers are unchanged.

Verified with tests and in the running web app:

  • Picker tests cover numbering that skips disabled rows, Ctrl and Meta both picking, renumbering after search, and no effect without the prop.
  • ModelSelector tests cover Ctrl+2 picking and closing. A second test runs the real global shortcut handler and shows that Ctrl+1 with the picker open picks a model and does not switch threads. That test first checks that Ctrl+1 outside the picker does reach thread.goTo1.
  • New store tests cover appending, unstarring, a persisted order loaded from storage, and the 40 cap.
  • Reverting the store change and the numberedShortcuts opt-in made 6 of these tests fail.
  • In the live web app, the Codex tab showed Ctrl+1 to Ctrl+7. Pressing Ctrl+2 switched the model to GPT-6 Astra and closed the picker.
  • Live keyboard check: arrow keys, Home, End, and Enter still move and pick. Clicking a tab and then pressing Ctrl+2 picks from that tab. Searching "luna" renumbers to Ctrl+1 and Ctrl+2. The Favourites tab numbers starred models and Ctrl+2 picks the second one.

Why

Users switch models many times a day. Number keys make that a single chord once the picker is open (#2226, part of #1813).

UI Changes

Before and after: the model picker, Codex tab, web app. The after shot shows a keycap on each selectable row.

Before
After

Review Notes

  • The chord is handled on the picker panel, not the search field, because clicking a tab moves focus onto the tab. The panel stops the event, so neither the browser's Ctrl+N tab switch nor the global thread.goTo* shortcut sees it. The global handler is unchanged.
  • Past the 40 cap, the oldest favourite is dropped. Before this PR, the newest-first order dropped the last entry, which was also the oldest. Say if you would rather refuse a 41st star instead.
  • The shortcut help dialog does not list this chord, just as it does not list Ctrl+D. The keycaps document it in place.
  • Electron has no Ctrl+digit accelerators, so the desktop shell does not intercept the chord.

Closes #2226


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

Starring a model no longer shifts every existing favourite down one row,
so a favourite keeps its position and its Ctrl/Cmd+N number. At the
40-entry cap the oldest favourite drops. Persisted order loads as is.
While the model picker is open, Ctrl/Cmd+1..9 select the Nth selectable
row of the active tab and close the picker. Each numbered row shows its
keycap. Disabled rows get no number, and search renumbers the rows.

Picker gains an opt-in numberedShortcuts prop; only ModelSelector uses it.

Closes #2226
Clicking a picker tab moves focus onto the tab, so Ctrl/Cmd+1..9 bound
on the search field stopped picking rows, and Ctrl+1 could reach the
global thread switch. Handle the chord on the picker panel and stop it
there. The tests no longer refocus the search field after the tab
click, which had hidden the bug.
@chuks-qua
chuks-qua enabled auto-merge (squash) October 21, 2026 14:11
@chuks-qua
chuks-qua merged commit 392213a into main Oct 21, 2026
11 checks passed
@chuks-qua
chuks-qua deleted the feat/issue-2226 branch October 21, 2026 14:13
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.

feat(MPE-05): Ctrl/Cmd+1..9 pick models in the picker

1 participant