Repository navigation
fix(browser): Space key from Control UI rejected as empty press - #150317
Conversation
Map KeyboardEvent.key " " to Space before string trim so Browser panel and batch press actions deliver spaces instead of failing with press requires key. Closes openclaw#150298
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:49 PM ET / September 17, 2026, 01:49 UTC (Revision 6). ClawSweeper reviewWhat this changesPreserves Space keystrokes from the Control UI Browser panel by normalizing them before whitespace trimming, with regression coverage for Space, Plus, and empty inputs. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main and v2026.9.4 still reject literal Space presses. The focused fix preserves Plus-key handling, has convincing before/after evidence, and has no actionable review findings. Priority: P2 Review scores
Verification
How this fits togetherThe browser action normalizer translates Control UI and direct browser requests into actions dispatched through Playwright or Chrome MCP. Its keyboard handling determines which keystrokes reach the focused page. flowchart LR
A[Browser panel keyboard input] --> C[Browser action normalizer]
B[Direct and batch requests] --> C
C --> D{Valid key?}
D -->|Yes| E[Playwright or Chrome MCP]
D -->|No| F[Request error]
E --> G[Focused page field]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +14, Tests +16. Total +30 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep keyboard normalization at the shared browser request boundary so every supported caller delivers Space while preserving existing key contracts. Do we have a high-confidence way to reproduce the issue? Yes: current-main source proves that the panel's literal Space becomes empty and is rejected; the supplied baseline recording observations and inspected screenshots corroborate the failure. This review did not execute repository code. Is this the best way to solve the issue? Yes: correcting the shared normalizer covers UI, direct, and nested requests without duplicating frontend policy or changing existing Plus-key semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1fbb41545ec5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Playwright real-behavior proof added for literal Space through production
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Only the exact KeyboardEvent.key " " bypasses trim; chord inputs still trim first so " + " and "+ " normalize to "+" again. Prefer Ctrl+Space for Space chords.
|
Addressed reviewer request-changes:
HEAD @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged HEAD @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Fixed: Space key presses from the Browser panel now reach the page instead of being rejected as empty input. With thanks to @DonnieFi. |
…claw#150317) Preserve literal Space keyboard input from the Control UI Browser panel through the shared browser action normalizer. Refs openclaw#150298. Reviewed-by: @shakkernerd
Closes #150298
What Problem This Solves
Typing into a page through the Control UI Browser panel drops spaces. The panel forwards
KeyboardEvent.key, whose Space value is the literal" ". The shared browser action normalizer trims that value to an empty string and rejects the press withpress requires key, so text such asa b cbecomesabcin the page.User Impact
Space presses from the Browser panel now reach the focused page field. The same normalization applies to direct browser action requests and supported nested batches. Named
Spaceand case-insensitivespaceinputs are accepted, including named chords such asCtrl+Space.Existing letter case, keyboard aliases, literal Plus and
Control++handling remain intact. Whitespace-padded Plus inputs retain their trim-first meaning, and other empty or blank keys remain invalid. This change does not add rawCtrl+chord support.Why This Change Was Made
The existing press normalizer is the shared boundary before Playwright and Chrome MCP dispatch. Mapping the exact whole Space character to its canonical key name before generic trimming preserves the intended input without changing normalization of other route fields. Keeping the correction here also covers callers that do not originate in the Browser panel.
Evidence
Current-head CI is green. The affected job includes all 41 normalization cases and 3 batch-contract cases, covering Space aliases and existing key/Plus/empty-input controls. CI run, affected test job.
The full Control UI was exercised on Linux with Node 24.19.0 and Playwright 1.63.0. Its existing E2E harness supplies the mocked Gateway transport; real Browser panel keyboard events pass through the production browser route dispatcher and Playwright to a real Chromium input. The panel uses its supported screenshot transport. One identical production UI build serves the actual baseline and fixed backend source checkouts.
Both runs clicked and focused the remote field, then pressed
a, Space,b, Space,c. The baseline producedabcand rejected both Space requests with status 400. The fixed head produceda b c, accepted all five requests with status 200, and delivered both Space keydown events. Both runs had zero page errors and identical UI and remote-field geometry. The screenshots and focused recording below are from this current-head interaction; the earlier route-only capture is superseded.Visual evidence
Exact-head Browser panel keyboard interaction
openclaw-150317-after.webm
Visual verification
29454443f55e5f816d7a8981658fa45669cce456