Skip to content
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

Multiselection hints are too obscure #436

Open
InAnYan opened this issue Mar 13, 2025 · 0 comments
Open

Multiselection hints are too obscure #436

InAnYan opened this issue Mar 13, 2025 · 0 comments
Labels
Enhancement New feature or request

Comments

@InAnYan
Copy link

InAnYan commented Mar 13, 2025

Describe the problem

Originally, I raised this issue in copier repo. Pasting it here, as copier relies on this library.

Image

Code:

import questionary

questionary.checkbox(
   'tags',
   choices=[
       "A",
       "B",
       "C",
   ]).ask()
  • <space> to select - select what?
  • <a> to toggle - toggle what?
  • <i> to invert - invert what?

Initially, I thought that all these actions refer to a (one) selection. But in this case, all these actions would do the same thing.

Only after playing around with all keys, I understood everything

Describe the solution

Let's address this bit by bit.

What actions do:

  • <space> to select - toggles a single option under the arrow.
  • <a> to toggle - either:
    • Selects every option.
    • Deselects every option.
  • <i> to invert - inverts current assignments. What was selected become deselected, what was deselected became selected.

Scopes:

  • <space> to select - single choice.
  • <a> to toggle - all choices.
  • <i> to invert - all choices.

Maybe rewrite it like this:

  • <space> to select - <space> toggle
  • <a> to toggle - <a> select all
  • <i> to invert - <i> invert selection

If we came to consensus, I can make a PR.

@pawamoy also suggested this:

  • <space> (un)select
  • <a> (un)select all
  • <i> invert selection

And also we had an idea for new option:

  • <enter> confirm

Alternatives considered

questionary.checkbox has option instruction with which we can configure what hinting text is displayed.

Which is awesome!

But still IMHO default hints can be improved a bit. Free to discuss 😄

@InAnYan InAnYan added the Enhancement New feature or request label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant