Open mikecvet opened 3 months ago
I think this is pretty great, thanks a lot for the contributions!
The diff hooks into the key bindings for up and down arrows, currently used for suggestion navigation, to also potentially navigate upwards and downwards through prompt history.
This made me think of an approach that I believe would work really well, let me know your thoughts:
On a fundamental level, this is another approach on giving suggestions to the user. Think about normal bash "up and down" vs fzf
which displays a list to be selected.
Also, the current suggestion approach (a selection list) obviously conflicts with this in terms of keybindings, which leads me to think they are exclusive to each other.
I feel that inquire is reaching a stage where it's bloated with a ton of different pieces to use but it's missing a better UX story. I think there is a path here for a unified approach to suggestions/auto-completion/history
I think this is pretty great, thanks a lot for the contributions!
Thanks!
On a fundamental level, this is another approach on giving suggestions to the user. Think about normal bash "up and down" vs
fzf
which displays a list to be selected.
Yes, agreed.
Also, the current suggestion approach (a selection list) obviously conflicts with this in terms of keybindings, which leads me to think they are exclusive to each other.
I feel that inquire is reaching a stage where it's bloated with a ton of different pieces to use but it's missing a better UX story. I think there is a path here for a unified approach to suggestions/auto-completion/history
Yeah, while building this feature, and largely pairing it with autocomplete side-by-side, it seemed like supporting a generalized "navigation" framework, which can hook into suggestions, history, or whatever else, would be the right way to go. I'd love to be able to define some kind of callback or handler for specific keystrokes within my application, and feed outputs back into the prompt
I've been pondering over something like a "Query" prompt similar to what you're both describing. My notes which I haven't finished thinking through:
a retry for non-deterministic/waiting for something async to finish?
Tab changes mode between selection and completion
Limiting this to a MultiSelect could be wrong, and could instead be a configuration option allowing "Single" Select behavior if set.
Completion mode requires a separate completion handler function with a similar debounce mechanism as the one defined for the query handler.
Once selected modify the query and either
This is a suggested implementation of prompt history for
Text
proposed in https://github.com/mikaelmello/inquire/issues/224The diff hooks into the key bindings for up and down arrows, currently used for suggestion navigation, to also potentially navigate upwards and downwards through prompt history.
A user can set a prompt history when creating their new
Text
via something liek