fix: implement interactive list selection and fix default value display (#69) - #70
Conversation
…ay (#69) - Replaces manual numeric input with arrow-key navigation for list prompts. - Displays numeric indices (1, 2, 3) alongside a green selection indicator (>). - Fixes the bug where default numeric values were not visible to the user. - Implements a robust fallback for non-TTY environments (CI/GitHub Actions) to support both numeric input and ANSI arrow sequences. - Fixes a terminal hang issue by ensuring stdin is properly paused on close. - Updates interactive test cases to align with the new selection method.
📝 WalkthroughWalkthroughEnhanced list-type prompts with interactive TTY navigation using arrow keys and cursor control, while preserving non-TTY fallback supporting numeric or text-based selection. Terminal state properly managed across both modes. Updated interactive tests to use keyboard navigation sequences. Changes
Sequence DiagramsequenceDiagram
participant User
participant PromptHandler as Prompt Handler
participant Terminal
participant InputParser as Input Parser
User->>PromptHandler: Initiate list prompt
PromptHandler->>Terminal: Render options with default highlighted
alt TTY Mode (Interactive)
loop Navigation
User->>InputParser: Press Up/Down arrow
InputParser->>PromptHandler: Parse navigation command
PromptHandler->>Terminal: Update selection highlight in place
Terminal->>User: Display updated cursor position
end
User->>InputParser: Press Enter
InputParser->>PromptHandler: Confirm selection
PromptHandler->>Terminal: Print final selection
PromptHandler->>Terminal: Restore terminal state & show cursor
PromptHandler->>User: Resolve with selected option
else Non-TTY Mode (Piped)
User->>InputParser: Provide numeric or text input
InputParser->>PromptHandler: Parse and validate input
PromptHandler->>PromptHandler: Match against options or use default
PromptHandler->>User: Resolve with matched option
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Cache: Disabled due to Reviews > Disable Cache setting 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)src/test/interactive.test.js (2)
src/lib/prompts.js (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Comment |
✅ CI/CD Test ResultsOverall Status: success |
|
Caution Docstrings generation - FAILED No docstrings were generated. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Closes #69
Description
Related Issue
Fixes #
Closes #
Type of Change
Testing
Checklist
Screenshots
Additional Notes
Summary by CodeRabbit
New Features
Tests