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

Handle user_choices for more than 3 options #99

Open
pazzarpj opened this issue Apr 2, 2019 · 3 comments
Open

Handle user_choices for more than 3 options #99

pazzarpj opened this issue Apr 2, 2019 · 3 comments

Comments

@pazzarpj
Copy link
Collaborator

pazzarpj commented Apr 2, 2019

Currently, user_choices allows an arbitrary amount of choices to be parsed to it.
However the UI does not handle this gracefully.

Separate out the common functions such as user_yes_no, user_ok, user_retry_abort_fail etc. into their own api and have the user_choices have a different way of selecting options.

@clint-lawrence
Copy link
Collaborator

clint-lawrence commented May 19, 2019

Have to got a use case in mind for user_choices?

Assuming #108 gets merged, there won't be a user_choices anymore, so we will be able to just close this issue :)

@pazzarpj
Copy link
Collaborator Author

A current use case would be the natabase. Selecting location, gas bottles etc have an arbitrary amount of options to select. For the GUI we had to re-implement this use case with user input and manually verify the inputs.

@clint-lawrence
Copy link
Collaborator

How many possible entries do you think we need to practically support? Up to a dozen or so is probably practical with a fairly simple UI.

So thinking about possible alternatives that are more universal going forward.
For command line:
print a numbered list of choices. The user would type the number & hit enter to make a selection. The number entered would be checked to make sure it was in range then return.
If the user hits ESC an exception would be raised, failing/erroring the test and allowed a way to exit (or retry).

For GUI:
Open a modal dialog (or use the image panel?). Display a list of radio buttons with and O.K. and cancel button. O.K. would return the selected choice and cancel would raise and exception, similar to cli ESC. Possibly at some point it could switch from radio buttons in a grid to a list box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants