Skip to content

feat: arrow-key pickers for setup, /backend, and /model#23

Open
nelopuchades wants to merge 3 commits into
GetSmallAI:mainfrom
nelopuchades:feat/interactive-select-menus
Open

feat: arrow-key pickers for setup, /backend, and /model#23
nelopuchades wants to merge 3 commits into
GetSmallAI:mainfrom
nelopuchades:feat/interactive-select-menus

Conversation

@nelopuchades

Copy link
Copy Markdown
Contributor

Motivation

Setup and the /backend / /model flows 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)

  • Add an interactive single-choice menu: ↑/↓ (or j/k), Enter to confirm,
    19 jump-and-confirm, q/Esc to cancel
  • Window long lists (12 visible rows) with … N above / … +N more
  • Highlight the focused row with the accent pointer; callers mark the live
    choice with *
  • Park the cursor at column 0 after raw-mode line input (\r\n) and before
    the first select frame (\r) so the bold title/gutter don't start mid-line
    and jump left on the first arrow redraw

Setup wizard

  • Backend, model, approval policy, and tool mode prompts use the shared menu
  • Model step fetches /models when possible, builds a sorted menu (default /
    current override injected), and keeps a free-text fallback when the list is
    empty or unreachable

/backend and /model

  • Replace numbered type-to-select (and the old model filter list) with the
    same arrow menu
  • Cloud models still append catalog cost/context labels where known
  • Free-text model entry remains available as the last menu option / fallback

Verified by

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test (input select-menu tests + suite)

Screenshots

image image image

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.
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