Repository navigation
fix(ui): keep IME composition Enter from applying the usage query - #195087
Conversation
|
🦞👀 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. |
300b11e to
a1ced5a
Compare
Pressing Enter to confirm a Japanese or Chinese candidate applied the half-composed draft as the usage filter and refreshed the overview. The query input now uses the local IME owner: active composition, the keyCode 229 shim, and the WebKit compositionend grace all leave Enter to the composer, while a deliberate Enter applies the filter as before.
a1ced5a to
6e5dc8b
Compare
|
Codex review: needs maintainer review before merge. What this changesThe Usage query input reuses the shared IME lifecycle guard so composition-confirming Enter does not explicitly apply the query. Example: Confirm the Japanese draft 日本 with Enter in the Usage query input.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current Usage input bug with no actionable findings. The earlier description finding is resolved; exact-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI Usage input sends draft edits and explicit application actions to the Usage page state owner, which requests analytics from the Gateway. flowchart LR
A[Browser IME events] --> B[Usage query input]
B --> C[Shared IME guard]
C --> D[Explicit query application]
B --> E[Draft debounce]
D --> F[Usage page state]
E --> F
F --> G[Gateway analytics]
Technical reviewBest possible solution: Retain this focused integration of the shared IME owner and complete the existing exact-head CI gates. Do we have a high-confidence way to reproduce the issue? Supplied repeated Chromium runs through a real Gateway reproduce the failure on main, and fetched-main source retains the responsible unconditional Enter handler; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete fix: leave composition Enter to the browser by consuming the existing input-local guard and its retirement lifecycle, while preserving ordinary application and automatic draft filtering. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 60b66097c5a6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +11, Tests 0. Total +11 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 8, 2026, 3:11 AM ET / 08:11 UTC (Revision 2). |
Exact-head Usage IME proofCandidate: Built both the Gateway and Control UI separately in secretless Node 24.22.1 Docker. The real Gateway served its matching built UI to real Linux Chromium. Each run used its own profile, home, configuration, and state. No mocked WebSocket, injected key handler, fake timer, or synthetic DOM composition event was used. Browser input came through CDP Main twice and candidate twice, six scenes per run. The table separates Enter's immediate effect from the unchanged automatic draft application:
The active-composition and keyCode 229 Enter cases, and Enter immediately following compositionend with cleared composition flags, were intercepted and applied analytics on main. The candidate left them to the browser and sent no immediate analytics request. Plain Enter, key-up retirement, and blur retirement still applied exactly once on both refs. After the observation window, the candidate still issued the later automatic draft request: the existing 250 ms debounce is unchanged, not paused or disabled by this fix. No cancellation-safe filtering guarantee is claimed. Real gzip sizes from the official performance report over those exact dist trees:
Combined actual served gzip delta: 1 B, within 600 B. Generated-hash-normalized limits are recorded separately in the retained official report. The 42-line allocation was removed entirely. Test delta is 0 (+42/-42), production +11/-0. Shared the existing reactive Usage fixture across query tests without removing their assertions. The retained IME regression fails on main at The attached screenshots are from this Usage proof, replacing the unrelated toolbar imagery previously referenced. Raw before: Proof limits: browser-protocol IME lifecycle, not a native OS IME certification; fresh empty analytics data from the real isolated Gateway, not a live-account data claim. No Telegram or provider behavior claims. Retained local evidence: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 517dfd4. Thanks @shuisadev. IME composition Enter no longer applies the Usage query early. |
…enclaw#195087) fix(ui): let IME composition Enter through in the Usage query field The Usage query field caught every Enter key and applied the query at once, including the Enter that confirms IME composition (isComposing, keyCode 229, and the Enter right after compositionend). CJK input therefore applied an unfinished query. Those composition Enters now go to the browser. A plain Enter, and the key-up and blur paths, still apply the query once, and the existing 250 ms draft debounce is unchanged. Evidence: built Gateway and Control UI in real Linux Chromium, with input sent through CDP Input.imeSetComposition, insertText and dispatchKeyEvent (trusted events, no synthetic DOM composition). Run twice on main and twice with this change, six scenes per run. Main sent an immediate sessions.usage request for each composition Enter; this change sends none for them. Plain Enter, key-up and blur each send exactly one request on both versions. Gzip growth: startup +0 B, chat boot +1 B. Before and after screenshots and the full table: openclaw#195087 (comment).   Thanks @shuisadev. Co-authored-by: SunnyShu <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>


What Problem This Solves
The Usage query input handled every Enter as an explicit Apply action, including the Enter used to confirm an IME composition. That prevented native confirmation and could immediately refresh analytics with the composing draft.
Preserve SunnyShu's fix by wiring the input to the existing input-local IME owner, including composition-end, key-up and blur lifecycle handling. Enter belonging to composition is left to the browser; a plain deliberate Enter still applies the query.
This changes only Enter handling. The existing
onInputdraft update and 250 ms automatic-apply debounce are unchanged. Composition or its cancellation does not promise to pause draft filtering or prevent a later debounced refresh. No API, configuration, or storage changes.Evidence
Exact-head runtime evidence: main twice and candidate twice, six scenes per run, with the built Control UI served by an isolated built Gateway and real Chromium CDP
Input.imeSetComposition,Input.insertText, and trusted key events—not synthetic DOM composition events. Composition Enter, keyCode 229, and post-composition-end Enter no longer prevent default or trigger immediate analytics. Plain Enter and key-up/blur reset controls still apply once. Later automatic draft requests remain. This is browser-protocol composition proof, not a native operating-system IME certification.Actual served gzip growth: startup 0 B, chat boot +1 B, combined +1 B; official performance report has no violations.
Before: composition Enter immediately applies the query.
After: composition Enter stays with the browser; the draft debounce is unchanged.
The 42-line test allocation is removed entirely. Existing reactive Usage fixtures are shared across three query tests while retaining their assertions and the IME regression: test delta 0, production +11/-0. The rendered-view regression fails on main (
defaultPreventedunexpectedly true; 15 pass, 1 fail) and passes on the candidate (16 pass; 4.74 s wrapper wall time). Targeted formatting and lint pass. No shared ceiling or inherited-debt grant changes.Two-way door: reverting restores the previous key handler, with no persisted-state migration. Blast radius is the Usage query input's Enter handling; the existing draft debounce and other inputs are untouched.