-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Make interactive confirm optionally accept return key for confirmation #644
Comments
@elfrucool I've added a draft that includes this new functionality. Would you like to take a look and offer some feedback? |
I'll take a look once I get a moment |
Thanks for the feedback! I understand your point. Although, in situations where pressing Enter is associated with confirmation, it might be confusing if the default action is "No" or "Cancel". Also, most CLI prompts don't include a "confirmation helper text", so it might not be necessary here. In my view, removing the helper text seems like the better option. However, let's wait for the maintainers to decide if they prefer your suggestion (adds more complexity to the printer) or if it's best to remove "confirmation helper text" altogether. |
@MarvinJWendt, could you please share your thoughts on this? |
What I could imagine is this:
Any objections? :) |
I agree with it the suggested solution
But I don't know if having default options as `true` and having to disable
them (e.g. `.WithInstantSelect(false)`) is a familiar pattern in other
parts of the library, if not, I would recommend to use
`.WithRequiresConfirmation(true)` instead.
In either case, adding a legend that says something like `Press Enter to
Confirm` may not be necessary, *or* it would be configurable too.
…On Sun, Mar 24, 2024 at 11:25 AM Marvin Wendt ***@***.***> wrote:
What I could imagine is this:
- New option in the InteractiveConfirmPrinter called InstantSelect
- If InstantSelect is true: Pressing y or n will instantly confirm
or abort the printer.
- If QuickSelect is false: Return is needed after pressing y or n
to select
- While Return is not pressed, the user should be able to switch
between y or n
- InstantSelect should be true in DefaultInteractiveConfirm
- That way, it can be disabled with .WithInstantSelect(false).
Any objections? :)
—
Reply to this email directly, view it on GitHub
<#644 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJIGO6MG7ZAPXCHSFLQAHTYZ4D6ZAVCNFSM6AAAAABDP5N2I2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWHA3TQMZUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I had a similar idea, and I agree with @elfrucool. It seems more logical to have it disabled by default. In my PR, I added a new option |
Any updates on this? Waiting on this since its a great feature that helps prevent confusion on how the interactive confirm works in sequence with other inputs, such as the select or text input, which both require "Enter" |
For some users, it is confusing that the interactive confirm component accepts their
y
orn
answer immediately without requiring a confirmation through typing<enter>
key; this is specially true when adoptingpterm
the first time.It would be great to have something like
pterm.DefaultInteractiveConfirm.WithWaitReturn(true).Show()
to enable this behavior.(note: this feature request came from this question: #643 )
The text was updated successfully, but these errors were encountered: