Repository navigation
fix: preserve typing when Side chat finishes loading - #150217
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 10:21 AM ET / 14:21 UTC (Revision 15). ClawSweeper reviewWhat this changesThe PR centralizes Side chat focus handling to preserve newer typing during loading, adds browser regression coverage and documentation, and instruments an existing board test. Merge readiness✅ Ready for maintainer review This repair remains necessary on fetched main. The reviewed patch and inspected before/after evidence support the fix, with no blocking introduced defects found. Priority: P2 Review scores
Verification
How this fits togetherSide chat is a secondary question panel within the Control UI chat pane. Opening commands and panel visibility produce a deferred focus request, which the lazily loaded panel consumes before directing keyboard input. flowchart TD
A[Open Side chat] --> B[Pane captures focus intent]
B --> C[Panel loads asynchronously]
D[Newer typing or focus] --> E[Invalidate old intent]
C --> F{Intent still current?}
E --> F
F -->|Yes| G[Focus Side chat]
F -->|No| H[Keep current input]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +26, Tests +303, Docs +2. Total +331 across 11 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep focus intent in the pane and let the lazy Side chat panel consume only a still-current opening request. Do we have a high-confidence way to reproduce the issue? Yes: delay the Side chat module, open the panel, continue typing in another composer or queued editor, then release loading. Current-main source explains the focus steal; this review inspected supplied browser proof without independently executing the scenario. Is this the best way to solve the issue? Yes: extending the existing pane-owned focus request covers manual openings and continued typing while removing the competing component fallback, without adding settings or changing stored data. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 13a743befb7b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (14 earlier review cycles; latest 8 shown)
|
|
Merged via squash.
|
Wait for the source-matched widget bridge handshake before starting the existing size-report assertion. Keep all geometry assertions and timeout values unchanged; this is test readiness only. Related: #150217 and main run 35394611976 (checks-ui 3/3). The original file passed 21 pressure executions; a controlled pre-bridge parser stall reproduced the zero-report assertion and passed with the fix.
* fix: preserve typing when Side chat finishes loading * test(ui): capture board iframe readiness failures
…152198) Wait for the source-matched widget bridge handshake before starting the existing size-report assertion. Keep all geometry assertions and timeout values unchanged; this is test readiness only. Related: openclaw#150217 and main run 35394611976 (checks-ui 3/3). The original file passed 21 pressure executions; a controlled pre-bridge parser stall reproduced the zero-report assertion and passed with the fix.
What Problem This Solves
Opening Side chat can load its panel after the user resumes typing elsewhere. The late panel previously stole focus and redirected the rest of the draft into Side chat, including from a queued-message editor that had never lost focus.
User Impact
Continued typing stays in the input the user is editing. Normal Side chat autofocus, explicit commands, reopening, and retained tabs still work. No configuration or migration is required.
Why This Change Was Made
The pane now captures focus intent when Side chat becomes visible and the lazy panel consumes that request. Newer focus or input invalidates the existing intent; another active pane, hidden presentation, or external focus also prevents an older opening from reclaiming focus. The old unconditional autofocus fallback is removed.
The existing side-panel operations move together into a focused class in the pane’s existing inheritance chain. This keeps presentation, lifecycle, and command focus decisions with the same owner.
Evidence
The regression reproduces through real menus, the keyboard shortcut, and composers with synthetic Gateway data and a delayed panel module. Original code redirected main-composer and split-pane continuations into Side chat. A queued-editor case additionally exposed continued typing without a focus change; input invalidation closes that path. The six scenarios cover normal autofocus, newer main input, another pane, command palette, and both newly focused and continuously focused queued editors.
The branch integrates main
1f807cb9130a8ea782ea0958d3d2a9711fed9034, including the shared catalog benchmark correction. All eleven PR files, including feature source, tests, documentation, and passive diagnostics, are byte-identical to reviewed heada730aa4593d400823ea0060429aaa60c448527b8. Earlier passing evidence remains applicable: 29 companion/focus browser scenarios, 123 owner tests, three UI type graphs, scoped type-aware lint, formatting, and relevant guards. Fresh proof on integrated head111abca57c26c2c68464bf91257e621e2cf2852epasses all six unchanged manual-opening browser cases in 16.89 seconds after the supported harness rebuilt the matching UI. Fresh independent P0–P2 review of the complete candidate found no actionable issues. Exact-head CI completed successfully, including all 13 bundled browser shards and the real-Gateway browser job. The native maintainer workflow merged this PR asdef6260389e4cf50ca5239a21b8649c5e5a3aef4.Previous CI exposed shared upstream tooling and browser failures; their failed runs are preserved. The last run on the prior head passed every executed job except a rail-layout case where an offline queue transition moved a tick by 43 pixels. Current main includes the independent rail repair #151626. A fresh local replay on that exact main passes all 11 original browser cases, deliberately using the original layout fixture without the new readiness barrier, plus all 14 existing rail owner cases covering keyboard focus, pointer focus, compensation, and reader takeover. This establishes the exercised flow on current main; it does not reconstruct the exact historical hosted timing. No supplemental experimental rail change is included in this PR.
The first CI run after this integration passed all 13 bundled browser E2E shards, including the earlier rail failure, but UI unit shard 3 failed the board tab-retention test before any tab switch: its initial synthetic iframe readiness array was empty. The exact CI merge passes all 26 unchanged board cases locally. An observation-only replay of the three concurrently loaded browser files passes all 62 cases after a separately retained cold Vite optimizer reload; it does not explain the hosted timeout. This update adds only bounded, failure-only iframe lifecycle/message diagnostics to that existing test, including synthetic emission and parent-delivery timestamps. The original actions, assertion, deadline, and thrown error are unchanged. Diagnostic head
a730aa4593d400823ea0060429aaa60c448527b8passes the original 26 board browser cases, the affected UI test type graph, scoped type-aware lint, formatting, and size/assertion guards. A labeled wrong-ready-payload negative control still fails the original assertion after its existing one-second wait and prints the bounded trace; the exact candidate bytes were then restored. Fresh independent P0–P2 review found no actionable issue. This is evidence collection for the next hosted run, not a claim that the CI failure is repaired.The completed diagnostic-head run passes all three UI unit shards and all 13 bundled browser E2E shards. The iframe timeout did not recur; its cause remains unproven. The only executed failure is
compact-large-19: the existing composed catalog benchmark expects 20 SQLite reads per list and observes 18, with all three binding-authority reads and zero worker operations intact. Source and SQL/caller traces now identify two optional background transcript reads contaminating the former count. The separately reviewed correction #151832 landed with fully green exact-head CI. It uses the existing foreground-work owner and preserves exact 18-read / three-authority checks. This PR now incorporates that main commit and changes no Gateway or catalog source of its own; the refreshed exact-head CI is now fully green.These are synthetic browser/owner proofs, not live-provider claims. The four unchanged-feature captures below were inspected in full, visibly delivered in the originating chat, and verified rendering in the authenticated GitHub PR. The screenshot delivery gate remains satisfied.
Main composer before and after
Before: the continuation lands in Side chat.
After: the entire draft stays in the main composer.
Queued editor before and after
Before the input-invalidation refinement, the initial candidate still redirected the continuation into Side chat when the queued editor had kept focus throughout keyboard opening.
After: the queued edit retains the entire continuation and the separate main draft remains intact.