kazhala / InquirerPy

:snake: Python port of Inquirer.js (A collection of common interactive command-line user interfaces)
https://inquirerpy.readthedocs.io
MIT License
357 stars 19 forks source link

Feature Request - Keybinding to go back to previous question #6

Open iancote opened 3 years ago

iancote commented 3 years ago

Hello!

I really appreciate the work you did on this. The fuzzy search is pretty key. I was wondering how hard it would be or if it's possible to return to a previous question in case the user needed to change the input?

My use case is a group of questions:

and as the user answers the questions, realizes at the take our/delivery question that they forgot an item on the pizza. How could they return back to that to add more items or change the selection?

Thanks, -ian

kazhala commented 3 years ago

Hi @iancote ,

The feature you are describing was in my consideration a while back. But it would require a lot of architecture changes and quite a lot of development effort.

On a high level, the UI class is destroyed every time an answer is answered and simply print a formatted text. In the case of editing the previous answer, it would either don't destroy the UI class (which I'm not willing to do as it breaks the alternative API) or it could destroy the UI class but don't print any text and take in UI class as part of a parameter to each question so that we can draw the previous questions and have the capability to navigate back.

I'll leave this issue open for now and hopefully will have some time to look into this capability in the near future.

Thanks, Kevin

vict0rsch commented 1 year ago

Thanks for the good work, just bumping this up if you have some time :)