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

Allow going back on menu #729

Open
stacksjb opened this issue May 13, 2024 · 10 comments
Open

Allow going back on menu #729

stacksjb opened this issue May 13, 2024 · 10 comments
Labels
feature New Features (Code doesn't exist)

Comments

@stacksjb
Copy link
Collaborator

If I incorrectly select "Pick project" and really wanted to delete, there is no way to go back.

This should probably be a default universal thing, such as pressing left arrow when no text is present, pressing escape (currently exits the program instead of going back a menu), another keyboard shortcut, or simply a "Go back to previous" option added to all menus.

@stacksjb
Copy link
Collaborator Author

It appears this does not work on "Select Project", but it does work as expected on each task under "tod list process" so it may be inconsistent.

I can go through and test each function(s) if needed.

@stacksjb
Copy link
Collaborator Author

I think using "escape" may be appropriate (I can always ctrl-c to break).

"Tod list process" also simply cancels if I hit escape and exits.

@alanvardy
Copy link
Owner

I can go through and test each function(s) if needed.

This would be a big help if you can 🙏

@stacksjb
Copy link
Collaborator Author

I will look through this, thx.

@stacksjb
Copy link
Collaborator Author

stacksjb commented May 24, 2024

I'm not super familiar with inquire and need to test this - but can you re-map the escape key? so instead of "operation cancelled" it just goes back to the previous option?

That would accomplish the required result much more easily instead of having to add a "back" option to every single menu option.

Otherwise we would need to add something like
menu_options.push("q. Back".to_string());
to ever single menu option, and then keep track of the next and previous menus.

Below is a validation of all of the current menus in Tod (and the structure).

Note that most sub-menus need it as well, and many single command (but prompts) have no way of exit/cancel/back - I opened an issue on Inquire to check into this further and see if it might be possible (since that would certainly be easier!)

For the most part, every single "project selection" and "filter selection" option menu needs it - not sure if you're calling the same function universally, but if so that might make keeping track of previous/next menu a bit of work (would need to probably pass in/keep track of the previous menu?)

Also there are a few menus (Such as list process) that do have a "quit" option, which exits the program - this could be reassigned to "back", I don't think we need both "Back" and "Quit"

  • tod
  • project
  •   list -> Single command output ✅
    
  •   remove -> No back/cancel menu option
    
  •   rename -> No back/cancel menu option
    
  •   import -> no back/cancel menu option
    
  •   empty -> no back cancel menu option
    
  • task
  •   quick-add -> Single command, though no way to cancel/go back
    
  •   create -> single command, no way to cancel/go back
    
  •   edit -> no back/cancel menu option
    
  •   next -> no back/cancel menu option
    
  •   complete -> single command ✅
    
  • list
  •   view -> No back/cancel from project/filter selection option
    
  •   process -> no back/cancel from project/filter, but the end options do have a “Quit” (I think this could be remapped ot back instead - if I want to quit I can always just ctrl-c or close the terminal window)
    
  •   label -> no back/cancel once labels are entered (in seleciton menu)
    
  •   schedule -> no back/cancel option 
    
  • config -> All single command outputs
  • help -> all single command ouputs

@alanvardy
Copy link
Owner

alanvardy commented May 25, 2024

I don't think that I can remap, but I can definitely match on the error call the function again so that the user can select from the beginning if they hit escape.

"Operation was canceled by the user"

Based on my testing, Ctrl+c and Esc are treated the same way, so I would need to provide a quit option to allow the user to escape the menu.

@stacksjb
Copy link
Collaborator Author

If you can go back to the first menu, that might be a good middle ground.

@stacksjb stacksjb added the feature New Features (Code doesn't exist) label May 29, 2024
@alanvardy
Copy link
Owner

alanvardy commented May 30, 2024

  • project
    • remove -> No back/cancel menu option
    • rename -> No back/cancel menu option
    • import -> no back/cancel menu option
    • empty -> no back cancel menu option
  • task
    • quick-add -> Single command, though no way to cancel/go back
    • create -> single command, no way to cancel/go back
    • edit -> no back/cancel menu option
    • next -> no back/cancel menu option
    • complete -> single command ✅
  • list
    • view -> No back/cancel from project/filter selection option
    • process -> no back/cancel from project/filter, but the end options do have a “Quit” (I think this could be remapped ot back instead - if I want to quit I can always just ctrl-c or close the terminal window)
    • label -> no back/cancel once labels are entered (in seleciton menu)
    • schedule -> no back/cancel option

@stacksjb
Copy link
Collaborator Author

stacksjb commented Aug 9, 2024

I ran into this again recently on teh schedule option - when selecting date, no "q" or "esc" option listed.

So linked with this would be a need to add documentation to the prompt, i.e.

[arrows to move, []{} move months and years, enter to select, esc to cancel]

@alanvardy
Copy link
Owner

^ Split out into a different issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New Features (Code doesn't exist)
Projects
None yet
Development

No branches or pull requests

2 participants