Repository navigation
feat(web): pick models with Ctrl/Cmd+1..9 - #2273
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Pickergains an opt-innumberedShortcutsprop. OnlyModelSelectorturns it on, so the other pickers are unchanged.Verified with tests and in the running web app:
ModelSelectortests 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 reachthread.goTo1.numberedShortcutsopt-in made 6 of these tests fail.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.
Review Notes
thread.goTo*shortcut sees it. The global handler is unchanged.Closes #2226
Need help on this PR? Tag
@codesmith-botwith what you need.