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

refactor: select and multi select fields #332

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

bashbunni
Copy link
Member

@bashbunni bashbunni commented Jul 25, 2024

  • fix(SingleSelect): start at selected index
  • refactor: track selected values in map
  • wip: re-add selected field to option; broken examples due to API
  • refactor: restore Key to Option, clean

How to test:

  • go test ./... -v in root dir
  • run examples using Select and MultiSelect (burger, gum, theme, readme/multiselect)
  • you can also test with Gum (after a lil go get -u github.com/charmbracelet/huh@refactor-select) then try seq 22 | go run . choose --selected=2,21 --limit=2 (or set limit to one or none for single select)

Behavioral Changes:

  • the selections returned are not ordered

@bashbunni bashbunni marked this pull request as draft July 25, 2024 20:31
@bashbunni
Copy link
Member Author

Need to update this to use ayman's Selector type

aymanbagabas and others added 3 commits August 5, 2024 13:19
Use a proper type to keep track of selected items. The paginator bubble
shouldn't be abused like this if it's not intended to be part of the
program UI.
Use selector as a generic item container that holds different types.
Note: `selector.Selector` is _not_ concurrent safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants