bevry / dorothy

🧙🏻‍♀️ Bring your dotfile commands and configuration to any shell. Sensible defaults and hundreds of commands preloaded. Supports Bash, Zsh, Fish, Nu, Xonsh, Elvish, Dash, KornShell, macOS, Linux, Windows.
Other
277 stars 21 forks source link

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

Open balupton opened 8 months ago

balupton commented 8 months ago

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 commented 1 month ago

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 commented 1 month ago

Progress is going well. There's a lot of new functionality added and I believe it will be significantly more usable now. Nearly there.

balupton commented 1 month ago

Verified the new styling makes sense with @molleweide, who also gave a good suggestion that I'll experiment with: a complete legend toggle.

The remaining todos are:

All up, I think everyone is going to be really ecstatic with the new choose command.

balupton commented 3 weeks ago

Made great progress on this with @molleweide, only trivial things remaining.

balupton commented 3 weeks ago

Preview of the upcoming styles for:

choose-path 'Which one?' 'Your selection is important' --confirm --multi --default-fuzzy=echo -- "$DOROTHY/commands/"*

CleanShot 2024-06-12 at 01 09 04@2x

CleanShot 2024-06-12 at 01 09 26@2x

The prior version of this:

choose-path --question=$'Which one?\nIt is important' --multi --confirm --filter=echo- -- "$DOROTHY/commands/"*

Doesn't actually support fuzzy default matching, and is so slow on my macbook pro 2017 model that it takes about a minute to load... with the confirm and filter functionality being an unintuitive mess...

edit: more improvements have been made since above screenshots

balupton commented 3 weeks ago

Remaining todos:

balupton commented 3 weeks ago

Current preview of latest functionality in this WIP:

https://github.com/bevry/dorothy/assets/61148/a0af26a2-1493-4000-8f26-16e542384fba

balupton commented 1 week ago

Today's changes also:

Remaining todos: