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

Suggestion: merge choose-menu and choose-option into choose #188

Open
balupton opened this issue Oct 27, 2023 · 1 comment
Open

Suggestion: merge choose-menu and choose-option into choose #188

balupton opened this issue Oct 27, 2023 · 1 comment
Assignees
Labels
enhancement Improvement or suggestion
Milestone

Comments

@balupton
Copy link
Member

balupton commented Oct 27, 2023

choose-menu returns indexes, choose-option supports filters. They should be the same command now, which would offer a better experience around timeouts and filters. The different functionality should just be via a choose --index option or so.

@balupton balupton added the enhancement Improvement or suggestion label Oct 27, 2023
@balupton balupton added this to the Better Input Handling milestone Nov 11, 2023
@balupton balupton self-assigned this Apr 23, 2024
balupton added a commit that referenced this issue May 1, 2024
Still need to imlpement:
- `--linger`
- `--confirm-default=no`
- `--confirm-input`

...and to make them consistent between ask, confirm, choose.

This removes `--filter` from choose, as it is better facilitated by the new `--default(s)-fuzzy=`

/close #188
@balupton balupton changed the title Suggestion: merge choose-menu and choose-option Suggestion: merge choose-menu and choose-option into choose May 27, 2024
@balupton
Copy link
Member Author

balupton commented May 27, 2024

So this was done during my trip to Bali in April, and I'm now fixing up the tests. Updates were posted to the discord server.

One issue is that I removed filter functionality in favour of a new --default-fuzzy= option, however that causes echo-checksum --algorithm=sha to fail currently as it does not support multiple defaults with the default --no-multi behaviour.

As such, after some prototyping and discussion with @molleweide I'll go with the last option in this brainstorm below, which introduces the idea of preferences:

Which ones?
   ▣ a
   ▣ aa
>  ▣ aaa
   □ b
SELECT [SPACE]   CONFIRM [ENTER] [E]   CANCEL [ESC] [Q]   UP [↑] [W] [K]   DOWN [↓] [S] [J]   FIRST [HOME] [A]   LAST [END] [D]   ALL/NONE [T]
4 ITEMS, 4 SELECTED, 3 PREFERENCES | NEXT [A]   PRIOR [D]   RESET [Z]   NONE [T]

Which one?
>  ◉ a
   ☉ aa
   ○ b
   ○ b
   ○ b
   ○ b
   ☉ aaa
   ○ b
SELECT [SPACE] [ENTER] [E]   CANCEL [ESC] [Q]   UP  [↑] [W] [K]   DOWN [↓] [S] [J]   FIRST [HOME] [A]   LAST [END] [D]   SEARCH [/]
9 ITEMS, 1 SELECTED, 3 PREFERENCES, 5 CONCEALED | NEXT [A]   PRIOR [D]   RESET [Z]   ALL/NONE [T]
/ SEARCHING FOR: > sha


Which one?
   [ 5 items above ]
>  ◉ a
   ☉ aa
   ○ b
   ○ b
   ○ b
   ○ b
   ☉ aaa
   ○ b
   [ 1 item below ]
SELECT [SPACE] [ENTER] [E]   CANCEL [ESC] [Q]   UP  [↑] [W] [K]   DOWN [↓] [S] [J]   FIRST [HOME] [A]   LAST [END] [D]   NEXT [A]   PRIOR [D]   RESET [Z]

balupton added a commit that referenced this issue May 27, 2024
…ults, which unfortunately was left behind on my mac mini when I did the rebase on my macbook

# Conflicts:
#	commands/ask
#	commands/choose-menu
#	commands/confirm
#	commands/setup-git
#	commands/sparse-vault

Also:

- implement better timeout and error handling, no need for a delay anymore, and now commentary visible in linger
- update callers accordingly, also update `dorothy` to remove unnecessary indentation, update `echo-lines` to remove typo in comment
- add tests for the `echo-trim-colors` new handling of inline

Still need to:

- `choose`:
    - update tests for rewrite
    - fix duplicate `DEFAULTS` in choose (probably a long-standing regression)
    - support multiple default matches in `--no-multi` (as done by `echo-checksum`) by adding the concept of preferences
    - see details at #188 (comment)
- add linger and timeout tests to `ask`, `choose`, `confirm`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement or suggestion
Development

No branches or pull requests

1 participant