Skip to content

Use the search input for select lists with lots of options #6281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 13.x
Choose a base branch
from

Conversation

DieterHolvoet
Copy link
Contributor

Symfony Console has the possibility to filter option lists by default. This functionality was lost when we started using Laravel Prompts. Laravel Prompts does offer this functionality, but under the search input instead of the select input and the multisearch input instead of the multiselect input. I propose using the search inputs in cases where the option lists are (potentially) long, to improve UX.

@weitzman
Copy link
Member

IMO, the search UX is more cluttered than the select UX. Lets only use search when we expect 20 or more options. So that rules out cache:clear among others.

@DieterHolvoet
Copy link
Contributor Author

Okay, I reverted for the cache/site install/topic commands. An idea for commands where the amount of options depends on the size of the site: dynamically call either search or select if the amount of options is higher or lower than 20. Like this:

$this->io()->{count($choices) > 20 ? 'search' : 'select'}(...)

Could be good for eg. the image commands. There can be a lot of image styles depending on the site configuration.
Could we take 10 options as the threshold? Since that's the amount of options that are visible by default, without scrolling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants