feat(ui): print explicit abort message on non-yes confirmation input - #17
Merged
Conversation
Previously any input other than y/yes was silently treated as a decline. A user who typoed (e.g. 'yse', 'asdf') saw the prompt disappear with no deletion and no acknowledgement. Now any non-yes answer prints 'not a yes -- aborting.' before returning, so the user knows the input was understood as a decline rather than dropped. Empty Enter still counts as the [y/N] default decline and now also gets the message; the goal is no silent dismissal. Extracts a small interpretConfirm helper so the yes-detection logic can be tested without faking stdin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Today the confirm prompt accepts `y` / `yes` (case-insensitive) and silently treats anything else -- including typos like `yse` or `asdf` -- as a decline. The user sees no acknowledgement; the program just exits without deleting.
This change keeps the safe-by-default semantics (anything that is not yes is still a decline) but prints `not a yes -- aborting.` whenever the input is not affirmative, so the user knows their input was understood:
```
Proceed with deleting 1 branch(es)? [y/N]: asdf
not a yes -- aborting.
```
The yes-detection logic is extracted into a small `interpretConfirm` helper so it can be unit-tested without faking stdin.
Test plan