Repository navigation
fix(cli): use spacebar for toggling multi-select items in Question Tool - #12329
Closed
saakshigupta2002 wants to merge 1 commit into
Closed
saakshigupta2002 wants to merge 1 commit into
saakshigupta2002 wants to merge 1 commit into
Conversation
The Question Tool's multiple-choice mode used Enter to toggle checkbox items, which was inconsistent with every other toggleable UI element in the application (command palette, MCP dialogs, export options) that uses Spacebar for toggling. This also misaligned with standard browser behavior where checkboxes are toggled with Spacebar. - Spacebar now toggles checkbox items in multi-select questions - Enter advances to the next tab/question in multi-select mode - Updated hint bar to show "space toggle" and "enter next" for multi-select questions - Single-select and confirm behavior remains unchanged closes #12296
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found: PR #11476 - feat(tui): space to toggle answers in multi-select and enter for submit in questions tool This appears to be directly related or potentially a duplicate. The title and description both describe implementing spacebar toggling for multi-select items and Enter for advancing to the next question - which is exactly what PR #12329 addresses. You should check if #11476 is already merged or if it was closed/abandoned, as it may address the same feature request (issue #12296). |
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.
fix(cli): use spacebar for toggling multi-select items in Question Tool
Summary
space toggle,enter next) for multi-select questionsMotivation
The Question Tool is the primary interface through which agents ask users structured questions. In its multiple-choice mode, pressing Enter toggled checkbox items on and off. However, this was inconsistent with:
This inconsistency caused confusion, particularly for users who switch between the Question Tool and other dialogs frequently.
Changes
All changes are in
packages/opencode/src/cli/cmd/tui/routes/session/question.tsx:Keyboard Handler Logic
Before:
Enterin multi-select mode calledselectOption()which triggeredtoggle()on the highlighted itemAfter:
Spacebarin multi-select mode callsselectOption()which triggerstoggle()on the highlighted itemEnterin multi-select mode advances to the next tab/question viaselectTab((store.tab + 1) % tabs())Hint Bar
Before:
After:
The
space togglehint is conditionally rendered only when the user is on a multi-select question (not on the confirm tab), matching the pattern used indialog-export-options.tsxwhich showsPress space to toggle, return to confirm.Behavioral Matrix
Consistency Reference
This change aligns the Question Tool with the existing toggle pattern in the codebase:
Test Plan
space toggleandenter nextin multi-select modecloses #12296