fix(cli): limit provider selector height - #10474
Closed
michaelneale wants to merge 1 commit into
Closed
Conversation
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.
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.
This builds on top of PR: #10474 as an example
Caps the
goose configureprovider 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 becausecliclack::selectshows all items unlessmax_rowsis set, making the list unwieldy.How
MAX_PROVIDER_ROWS = 10via.max_rows(10).cliclack0.5.5 doesn't reset its internal list offset when filtering a paginated select, so a separate search step is used rather than inlinefilter_modefor long lists.filter_modebehaviour.ProviderChoiceenum (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 --libcleancargo test -p goose-cli— unit tests for the fuzzy filter and view-window logic passgoose configureend-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.