Skip to content

fix(cli): limit provider selector height - #10474

Closed
michaelneale wants to merge 1 commit into
mainfrom
micn/long-provider-list
Closed

fix(cli): limit provider selector height#10474
michaelneale wants to merge 1 commit into
mainfrom
micn/long-provider-list

Conversation

@michaelneale

@michaelneale michaelneale commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This builds on top of PR: #10474 as an example

Caps the goose configure provider picker at 10 visible rows so the provider list is no longer too long to navigate. Fixes #10415.

Why

On goose configure, the provider selector rendered every provider (35+) at once because cliclack::select shows all items unless max_rows is set, making the list unwieldy.

How

  • Cap the selector at MAX_PROVIDER_ROWS = 10 via .max_rows(10).
  • For long lists, insert a "Search all providers..." entry that opens a dedicated fuzzy-search step (jaro-winkler similarity + word-match bonus), with a "Search again..." escape hatch. cliclack 0.5.5 doesn't reset its internal list offset when filtering a paginated select, so a separate search step is used rather than inline filter_mode for long lists.
  • Short lists (≤10) keep the original filter_mode behaviour.
  • Move the currently-configured provider into view if it would fall outside the visible window.
  • Provider entries are modeled with a ProviderChoice enum (Provider(String) / Search / SearchAgain) rather than sentinel string keys, so the picker's control flow is checked by the compiler and real providers can never collide with UI actions.

Testing

  • cargo fmt / cargo clippy -p goose-cli --lib clean
  • cargo test -p goose-cli — unit tests for the fuzzy filter and view-window logic pass
  • Ran goose configure end-to-end: provider screen shows 10 rows with "Search all providers..." as the last entry, arrow-key scrolling works, and the search flow filters correctly.

Cap the provider picker at 10 visible rows so the list is no longer too
long to navigate (#10415). Long lists get a "Search all providers..."
entry that opens a fuzzy-search step; short lists keep filter mode.

Provider selection entries are modeled with a ProviderChoice enum rather
than sentinel string keys, so the picker's control flow is checked by the
compiler and real providers can never collide with UI actions.
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.

provider list too long

1 participant