fix(cli): fix Space key not working in Arena model selection dialog#4701
Conversation
The ArenaStartDialog's MultiSelect component was missing the selectedKeys and onSelectedKeysChange props, causing Space key toggles to have no effect when selecting models for an Arena session. Fixes QwenLM#4692
📋 Review SummaryThis PR fixes a bug where the Space key didn't toggle model checkboxes in the Arena model selection dialog. The fix is minimal and targeted - adding controlled component state management to 🔍 General Feedback
🎯 Specific FeedbackNo specific issues identified in this review. ✅ Highlights
|
There was a problem hiding this comment.
Pull request overview
Fixes the /arena start model selection dialog so that pressing Space correctly toggles model checkboxes by wiring ArenaStartDialog up to MultiSelect’s controlled selection state.
Changes:
- Add local
selectedKeysstate inArenaStartDialog. - Pass
selectedKeysandonSelectedKeysChangetoMultiSelectso Space toggles persist and re-render.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2026-06-03.10.28.43.mp42026-06-03.10.31.10.mp4 |
yiliang114
left a comment
There was a problem hiding this comment.
Root cause is clear — MultiSelect is a controlled component and ArenaStartDialog wasn't providing selectedKeys/onSelectedKeysChange, so toggles silently no-oped. The fix matches the existing pattern in StatusLineDialog. LGTM.
|
@ZijianZhang989 Welcome to the project and thanks for your first contribution! 🎉 Great job on the clean fix and the detailed PR description. Looking forward to seeing more from you! |
tanzhenxin
left a comment
There was a problem hiding this comment.
Review
This fixes the Space key not toggling model checkboxes in the /arena start model selection dialog. The underlying multi-select component was refactored a while back from managing its own selection internally to being fully controlled by its parent — selection now lives entirely in props the parent must supply. The arena start dialog was never updated for that change, so it rendered the list without wiring up the selection state, leaving every checkbox permanently empty and the Space toggle a silent no-op. The fix adds the missing local selection state and passes it through, matching the same pattern the status-line dialog already uses.
I verified the root cause against git history and traced the selection end-to-end: toggled models now persist in the dialog's state and flow through to /arena start on Enter. The empty-selection start, the "select at least 2 models" guard, and the skip-disabled-models behavior are all preserved, so there's no regression. The only gap is the absence of a regression test for this dialog — not a blocker for a three-line fix, but worth noting since this exact class of bug (a consumer left un-wired after the component became controlled) has now shipped once.
Verdict
APPROVE — Correct, minimal fix that matches the component's controlled-selection contract; selected models provably reach arena start and no edge case or regression is introduced.
What this PR does
Fix Space key not toggling model checkboxes in the
/arena startmodel selection dialog. Added controlled state (selectedKeys+onSelectedKeysChange) to theMultiSelectcomponent inArenaStartDialog, so Space key toggles now correctly persist and update the UI.Why it's needed
When a user runs
/arena startwithout--models, a model selection dialog appears. The prompt says "Space to toggle, Enter to confirm", but pressing Space does nothing — checkboxes never toggle. This is becauseMultiSelectis a controlled component that requires external state management viaselectedKeysandonSelectedKeysChangeprops, butArenaStartDialogwas not providing them. Without these props,onSelectedKeysChangeisundefined, so the toggle call silently fails and the UI never updates.Reviewer Test Plan
How to verify
qwenin any git repository/arena start(without--modelsflag)[ ]and[✓]Evidence (Before & After)
Before: Pressing Space in the model selection dialog does nothing. Checkboxes remain unchecked regardless of key presses.
After: Pressing Space correctly toggles the checkbox for the highlighted model. Multiple models can be selected and confirmed with Enter.
Tested on
Environment (optional)
Local runtime:
npm run bundle→node dist/cli.jsRisk & Scope
Linked Issues
Fixes #4692
中文说明
这个 PR 做了什么
修复了
/arena start模型选择对话框中 Space 键无法切换复选框的问题。为ArenaStartDialog中的MultiSelect组件添加了受控状态(selectedKeys+onSelectedKeysChange),使 Space 键切换能正确持久化并更新 UI。为什么需要这个修复
当用户运行
/arena start(不带--models参数)时,会弹出模型选择对话框。提示文字写着"Space to toggle, Enter to confirm",但按下 Space 键什么都不会发生——复选框永远不会切换。这是因为MultiSelect是一个受控组件,需要通过selectedKeys和onSelectedKeysChangeprops 进行外部状态管理,但ArenaStartDialog没有提供这些 props。缺少这些 props 时,onSelectedKeysChange为undefined,切换调用静默失败,UI 永远不会更新。审阅者测试计划
如何验证
qwen/arena start(不带--models参数)[ ]和[✓]之间切换测试环境
本地运行:
npm run bundle→node dist/cli.js风险和范围
关联 Issue
修复 #4692