fix(cli): auto-submit on number key press in AskUserQuestionDialog#3407
Merged
Conversation
) Number keys in AskUserQuestionDialog only moved the highlight cursor without submitting the selection, while the standard tool approval dialog (useSelectionList) auto-submits. This caused users to think their choice was confirmed when it was still waiting for Enter. For single-select predefined options, pressing a number key now auto-submits immediately, matching the behavior of RadioButtonSelect. Multi-select and "Other" custom input remain highlight-only. Also extract a shared selectAndAdvance helper to deduplicate the select-and-submit/advance logic across number key, Enter, multi-select submit, and custom input submit paths. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Verify that pressing a number key on the Submit tab only highlights the option without auto-submitting. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
wenshao
approved these changes
Apr 18, 2026
wenshao
left a comment
Collaborator
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.4 via Qwen Code /review
pomelo-nwu
reviewed
Apr 20, 2026
| answers: { [currentQuestionIndex]: value }, | ||
| }); | ||
| } else if (currentQuestionIndex < totalTabs - 1) { | ||
| setTimeout(() => { |
Collaborator
Author
There was a problem hiding this comment.
感谢 review!
分析了一下这个场景:setTimeout 的 150ms 窗口内,需要同时满足「用户取消/组件卸载」才会产生影响,实际触发概率极低。另外 React 18 已对 unmount 后调用 setState 做了静默处理,不会报错或崩溃。
综合考虑,这里暂不添加 clearTimeout 逻辑,保持代码简洁。如有不同意见欢迎继续讨论 :)
4 tasks
mabry1985
pushed a commit
to protoLabsAI/protoCLI
that referenced
this pull request
May 2, 2026
…wenLM#3407) Fixes QwenLM#500. Number keys in AskUserQuestionDialog previously only moved the highlight cursor without submitting, inconsistent with RadioButtonSelect and the standard tool approval dialog. Users pressed a number, saw the option highlight, and assumed it was selected, but the dialog was still waiting for Enter. - For single-select predefined options, pressing a number key now auto-submits immediately. - Multi-select, "Other" custom input, and the Submit tab remain highlight-only (unchanged). - Extracted a shared selectAndAdvance helper to deduplicate the select-and-submit/advance logic across 4 code paths (number key, Enter, multi-select submit, custom input submit). - Removed redundant isFocused guard inside the useKeypress callback; it is already handled via the isActive parameter. Tests cover all four behavioral branches: single-select auto-submits, multi-select does not, "Other" custom input does not, and the Submit tab does not.
mabry1985
added a commit
to protoLabsAI/protoCLI
that referenced
this pull request
May 2, 2026
…LM#3699) (#181) * fix(cli): guard gradient rendering without colors (QwenLM#3640) * fix(cli): auto-submit on number key press in AskUserQuestionDialog (QwenLM#3407) Fixes QwenLM#500. Number keys in AskUserQuestionDialog previously only moved the highlight cursor without submitting, inconsistent with RadioButtonSelect and the standard tool approval dialog. Users pressed a number, saw the option highlight, and assumed it was selected, but the dialog was still waiting for Enter. - For single-select predefined options, pressing a number key now auto-submits immediately. - Multi-select, "Other" custom input, and the Submit tab remain highlight-only (unchanged). - Extracted a shared selectAndAdvance helper to deduplicate the select-and-submit/advance logic across 4 code paths (number key, Enter, multi-select submit, custom input submit). - Removed redundant isFocused guard inside the useKeypress callback; it is already handled via the isActive parameter. Tests cover all four behavioral branches: single-select auto-submits, multi-select does not, "Other" custom input does not, and the Submit tab does not. * fix(core): treat ask_user_question multiSelect as optional (QwenLM#3699) Cherry-picked from QwenLM/qwen-code: 784b3ce Make `multiSelect` field optional in the askUserQuestion tool schema. Older / smaller models often omit the field entirely; treating it as required forced a validation failure when the model otherwise produced a well-formed question. Also refactors a pre-existing conditional expect that lint-staged now flags (no behavior change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: trigger PR mergeability recompute * ci: force CI re-trigger --------- Co-authored-by: 易良 <1204183885@qq.com> Co-authored-by: jinye <djy1989418@126.com> Co-authored-by: Automaker <automaker@localhost> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
…wenLM#3407) Fixes QwenLM#500. Number keys in AskUserQuestionDialog previously only moved the highlight cursor without submitting, inconsistent with RadioButtonSelect and the standard tool approval dialog. Users pressed a number, saw the option highlight, and assumed it was selected, but the dialog was still waiting for Enter. - For single-select predefined options, pressing a number key now auto-submits immediately. - Multi-select, "Other" custom input, and the Submit tab remain highlight-only (unchanged). - Extracted a shared selectAndAdvance helper to deduplicate the select-and-submit/advance logic across 4 code paths (number key, Enter, multi-select submit, custom input submit). - Removed redundant isFocused guard inside the useKeypress callback; it is already handled via the isActive parameter. Tests cover all four behavioral branches: single-select auto-submits, multi-select does not, "Other" custom input does not, and the Submit tab does not.
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
Fixes #500
AskUserQuestionDialogonly moved the highlight cursor without submitting, while the standard tool approval dialog (useSelectionList) auto-submits. Users pressed a number, saw the option highlight, and assumed it was selected — but the system was still waiting for Enter.RadioButtonSelect. Multi-select and "Other" custom input remain highlight-only.selectAndAdvancehelper to deduplicate the select-and-submit/advance logic across 4 code paths (number key, Enter, multi-select submit, custom input submit).if (!isFocused) returnguard (already handled byuseKeypress'sisActiveparameter).Test plan
##人工验证
本地编译:
运行:
输入问题:
当选项弹出后:
详情参考录屏:
DingTalk.Recording.Screen_2026-04-18.094545.mp4
🤖 Generated with Claude Code
Co-authored-by: Qwen-Coder qwen-coder@alibabacloud.com