feat(ui): /model with no arg opens an interactive picker#387
Merged
Conversation
`/model <id>` required typing the model id by hand and `/models` was
a separate read-only listing. New users had no obvious way to switch
without prior knowledge of the catalog.
Bare `/model` now opens a modal picker that mirrors SessionPicker's
shape: arrow-key list, ⏎ confirm, [r] refresh the API catalog, esc
cancel, current model marked. The list seeds from the live DeepSeek
catalog (`useSessionInfo` already fetches it on mount); when the
catalog hasn't loaded yet the picker falls back to the four known
DeepSeek ids so it's never empty on first open. The current model
is always included even when the API didn't return it.
Confirming a row routes through `loop.configure({ model })` AND the
`session.model.change` event added in #372 — so the badge on the
NEXT card pill reflects the new selection.
`/model <id>` typed entry continues to work for power users.
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.
Closes #371.
Why
/model <id>required typing the model id by hand. New users in the issue thread report nearly closing the app on first use because there was no obvious way to switch —/modelsonly listed available ids read-only, with no built-in way to act on what you saw.What changes
Bare
/model(no arg) now opens an interactive modal picker./model <id>typed entry continues to work for users who know what they want.src/cli/ui/ModelPicker.tsx— new component, mirrors SessionPicker shape:↑↓navigate,⏎confirm,[r]refresh catalog,esccancel· currenttagmodelBadgeFor()pill (flash / pro / r1) so the kind is at-a-glanceuseSessionInfoalready fetches on mount); falls back to the four known ids when the catalog hasn't loaded yet so the picker isn't empty on first opensrc/cli/ui/slash/types.ts— addsopenModelPicker?: booleantoSlashResult, parallel to existingopenSessionsPicker/openMcpHubflags.src/cli/ui/slash/handlers/model.ts— bare/modelreturns{ openModelPicker: true }instead of the prior info-only hint.src/cli/ui/App.tsx—pendingModelPickerstate, slotted into themodalOpenguard and the modal-stack JSX. On select:loop.configure({ model: id })+ dispatchessession.model.change(the event added in Model badge on assistant card still shows flash after switching to pro #372) so the next card pill reflects the new selection.Tests
tests/ui-model-picker.test.tsx— 7 new render tests: catalog list, current marker, loading hint, fallback when null, empty-catalog hint, current id always included, keybind footer.tests/slash.test.ts— updated the bare-/modelcase from "shows hint" to "returnsopenModelPicker: true" (existing behavior changed).Test plan
npm run verify— 134 files / 2152 passed / 1 skipped/modelopens the picker, ↑↓ navigates, ⏎ selects, the next assistant card pill reflects the new model/model deepseek-v4-protyped entry still works (no picker shown)[r]to refresh