Add interactive arrow-key Yes/No prompt#283
Merged
Conversation
- Replace text-based askYesNo with horizontal arrow-key selector on TTY (left/right toggle, y/n shortcuts, non-TTY fallback unchanged) - Extract withRawTerminal, readCSIArrowKey, and isInteractiveTerminal helpers to eliminate duplicated raw terminal setup across all three interactive prompts
- Relocate keyboard hint from top (inline prose) to bottom (dim with · separators) - Matches the hint position and style used by single-select and yes/no prompts
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
Upgrades
askYesNofrom plain text input (type y or n) to an interactive horizontal arrow-key selector, consistent with the existingsingleSelectandmultiSelectUX. Also refactors shared raw terminal infrastructure to eliminate duplication across all three interactive prompts, and standardizes hint line placement and style.Changes
interactiveYesNowith horizontal› Yes Nolayout using left/right arrows, y/n shortcuts, Enter/Space to confirmwithRawTerminal(_:)helper replacing 3 duplicated raw terminal setup/teardown blocksreadCSIArrowKey()helper replacing 3 duplicated CSI escape sequence parsersisInteractiveTerminalproperty replacing 3 identical TTY checks·separators), matching single-select and yes/no style[Y/n]text input behavior — all 10 call sites unchangedTest plan
swift testpasses locally (866 tests)swiftformat --lint .andswiftlintpass without violationsmcs sync,mcs cleanup,mcs pack remove,mcs doctor --fix)