feat: arrow-key pickers for setup, /backend, and /model#23
Open
nelopuchades wants to merge 3 commits into
Open
feat: arrow-key pickers for setup, /backend, and /model#23nelopuchades wants to merge 3 commits into
nelopuchades wants to merge 3 commits into
Conversation
Arrow-key single-choice picker with number jump, windowed scrolling, and cancel. Also park the cursor at column 0 after raw-mode line input (CR+LF) and before the first select frame so titles stay left-aligned.
Backend, model, approval policy, and tool mode prompts use the shared select menu. Model listing adds free-text fallback and menu helpers.
Replace numbered type-to-select prompts with the shared select menu, including catalog cost labels and free-text model entry.
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.
Motivation
Setup and the
/backend//modelflows still used type-a-number prompts:print a list, ask for a digit, hope the user typed the right one. That works
for a handful of backends, but model lists (OpenRouter, local servers, etc.)
are long, easy to mis-type, and don't show what's currently selected while
you browse.
This change adds a shared interactive select menu and wires it into the
setup wizard and the slash-command pickers, so choosing a backend or model
feels like the rest of the terminal UI: arrows, Enter, cancel — with the
current choice marked and the title staying left-aligned.
Summary of changes
Shared picker (
select_from_list)1–9jump-and-confirm,q/Esc to cancel… N above/… +N morechoice with
*\r\n) and beforethe first select frame (
\r) so the bold title/gutter don't start mid-lineand jump left on the first arrow redraw
Setup wizard
/modelswhen possible, builds a sorted menu (default /current override injected), and keeps a free-text fallback when the list is
empty or unreachable
/backendand/modelsame arrow menu
Verified by
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test(input select-menu tests + suite)Screenshots