Giter VIP home page Giter VIP logo

Comments (7)

balupton avatar balupton commented on June 16, 2024 1

Current preview of latest functionality in this WIP:

  • fuzzy defaults, selections, multi-select
  • paging header, footer, and visible bars
  • confirm menu and cancel menu
  • page up and down, home and end
CleanShot.2024-06-12.at.19.51.49.mp4

from dorothy.

balupton avatar balupton commented on June 16, 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]

from dorothy.

balupton avatar balupton commented on June 16, 2024

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

from dorothy.

balupton avatar balupton commented on June 16, 2024

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:

  • fix a paging edge case (yes it has support for page jumping now)
  • implement the new confirm styling (the interactions are already done)
  • experiment with the legend suggestion
  • implement a smart confirm default if a selection is on another page
  • consider a confirm hotkey to enforce a confirm

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

from dorothy.

balupton avatar balupton commented on June 16, 2024

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

from dorothy.

balupton avatar balupton commented on June 16, 2024

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

from dorothy.

balupton avatar balupton commented on June 16, 2024

Remaining todos:

  • improve paging iteration
  • light mode theme compat
  • tests for the changes
  • as the legend size will always be the same as the content is always the same, cache each legend item size, and keep adding until fill - extras still needed as need to seperate from essentials that will go on multiple lines if not enough horizontal space - however not sure what happens if also not enough vertical space - should it truncate, or hide
  • disable page header and footer if not enough vertical size
  • Truncate page header and footer if not enough horizontal size, to keep it to a single line
  • Consider truncating legend
  • cancel menu different than confirm menu
  • "Choose one of" for non-multi

from dorothy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.