fix(cli): bind space to toggle in multi-select questions#12142
fix(cli): bind space to toggle in multi-select questions#12142IamCoder18 wants to merge 1 commit into
Conversation
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (5 files)
Previous Review Summaries (2 snapshots, latest commit 924fb36)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 924fb36)Status: 3 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (5 files)
Previous review (commit 422592b)Status: 5 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (4 files)
Reviewed by gpt-5.6-sol-20260709 · Input: 62.5K · Output: 6.1K · Cached: 252.6K Review guidance: REVIEW.md from base branch |
422592b to
924fb36
Compare
In the kilo run footer and interactive TUI, multi-select questions used Enter (and 1-9 digit shortcuts) to toggle options. This is inconsistent with the convention used by other CLI TUIs (fzf, lazygit, btop, etc.) where Space toggles and Enter confirms. Realign the keybinds: - Space now toggles the focused option in multi-select mode - Enter now advances to the next question tab or the review/confirm tab, and submits on single-question single-select as before - 1-9 digit shortcuts retain their previous "quick toggle" semantics in multi-select to avoid disrupting muscle memory - Enter and Space on the custom "type your own" row now follow the same rules: Space toggles a typed value (regardless of whether it is currently selected, so you can re-select an untoggled value), or opens the editor when empty; Enter advances in multi-select (or opens the editor in single-select) - Guard against picking an undefined option so Enter cannot submit an empty answer - The footer hint line swaps "toggle" for "continue" on Enter and adds a "space toggle" hint when multi-select is active Extract a pure questionToggleAction in question.shared.ts so the footer can route Space and digit shortcuts through the same state machine. Mirror the same split in the TUI QuestionPrompt with a new continueOption() helper. Update the shared test to cover the new advance semantics, the no-op behavior of toggle in single-select, the custom-row interactions, and the toggle-off-then-on cycle. Add a patch changeset for the user-facing keybind change.
924fb36 to
068aac7
Compare
Fixed all issuesKilo Code Review's comment didn't update (the inline review comments show |
|
@IamCoder18 thanks, but this would introduce quite some conflicts. I don't think the value is worth the tradeoff. Do you agree? |
I agree. |
Issue
Closes #12141
Context
Multi-select questions used
Enter(and the1-9digit shortcuts) to toggle options, which is inconsistent with the Space-toggles / Enter-confirms convention used by most checklist-style CLI tools (fzf,lazygit,btop, ...). It also left no obvious way to advance to the next question or the review tab without reaching forTab/→.This rebinds multi-select to match that convention without touching single-select behavior, and updates the visible hints to match.
Implementation
The change is symmetric across the two CLI surfaces.
question.shared.tsquestionSelect(Enter handler) no longer toggles in multi-select — it advances to the next tab or the confirm/review tab.questionToggleActioncarries the old toggle logic, including the custom-option branch (Space on a typed-but-unsaved value toggles it).space togglesegment and changes Enter's verb fromtoggle→continuewhenmultiple === true.kilo runfooter (footer.question.tsx)useKeyboardgets aspacecase that callsquestionToggleAction.choose(selected)(digit shortcuts) routes throughquestionToggleActionin multi-select so1-9keep their muscle-memory toggle, and throughquestionSelectin single-select so digits still submit.space togglerow when multi-select is active.Interactive TUI
QuestionPromptcontinueOption()helper handles Enter: advance in multi-select,pick+ advance/submit in single-select.picks in single-select.spacebinding toggles the focused option only in multi-select (omitted from the binding list otherwise so it can't accidentally fire).toggle→continueand adds aspace togglesegment when multi-select is active.Screenshots / Video
2026-07-12.13-16-31.mp4
How to Test
Manual/local verification
Verified locally.
Reviewer test steps
multiple: truespace toggleandenter continue.Checklist
Get in Touch
Discord: @IamCoder18