Skip to content

fix: preserve typing when Side chat finishes loading - #150217

Merged
steipete merged 8 commits into
mainfrom
codex/qa-manual-side-focus
Sep 18, 2026
Merged

steipete merged 8 commits into
mainfrom
codex/qa-manual-side-focus

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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 head a730aa4593d400823ea0060429aaa60c448527b8. 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 head 111abca57c26c2c68464bf91257e621e2cf2852e passes 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 as def6260389e4cf50ca5239a21b8649c5e5a3aef4.

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 a730aa4593d400823ea0060429aaa60c448527b8 passes 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.

Before: continued typing redirected into Side chat

After: the entire draft stays in the main composer.

After: continued typing remains 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.

Before input refinement: queued-editor continuation redirected into Side chat

After: the queued edit retains the entire continuation and the separate main draft remains intact.

After: queued editor retains focus and continued typing

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 16, 2026 18:19
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 10:21 AM ET / 14:21 UTC (Revision 15).

ClawSweeper review

What this changes

The 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
Reviewed head: 111abca57c26c2c68464bf91257e621e2cf2852e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing visible proof, meaningful browser coverage, and no actionable correctness or security findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser screenshots directly show main-composer and queued-editor continuations staying in their intended inputs after delayed Side chat mounting. The production pane and rail are exercised through menus and keyboard interactions with synthetic Gateway data; the body reports refreshed six-case proof on the unchanged integrated head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after browser screenshots directly show main-composer and queued-editor continuations staying in their intended inputs after delayed Side chat mounting. The production pane and rail are exercised through menus and keyboard interactions with synthetic Gateway data; the body reports refreshed six-case proof on the unchanged integrated head.
Evidence reviewed 8 items Current main still needs the repair: Fetched main retains the presentation-change autofocus fallback, allowing a delayed manual opening to focus Side chat without checking intervening input intent.
Focus ownership and invalidation: The pane captures opening intent before lazy mounting and checks session, agent, connection, input generation, draft revision, visibility, and active input ownership before focus. Pane input events invalidate requests even when the queued editor never loses focus. The rail no longer has an independent autofocus fallback.
Review continuity: An explicit comparison of all eleven introduced files against the previous reviewed head returned no differences. The previous completed review contained no findings; the new head incorporates main without changing these reviewed files.
Findings None None.
Security None None.

How this fits together

Side 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +26, Tests +303, Docs +2. Total +331 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 219 193 +26
Tests 3 305 2 +303
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 526 195 +331

Review metrics

Metric Value Why it matters
Production versus test growth Net production +26 lines; tests +303 lines Most production movement extracts existing operations; net growth implements focus invalidation, while browser coverage protects distinct user interactions.

Technical review

Best 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.

Labels

Label justifications:

  • P2: Delayed Side chat mounting can redirect continued typing into another input, a bounded Control UI correctness defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after browser screenshots directly show main-composer and queued-editor continuations staying in their intended inputs after delayed Side chat mounting. The production pane and rail are exercised through menus and keyboard interactions with synthetic Gateway data; the body reports refreshed six-case proof on the unchanged integrated head.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after browser screenshots directly show main-composer and queued-editor continuations staying in their intended inputs after delayed Side chat mounting. The production pane and rail are exercised through menus and keyboard interactions with synthetic Gateway data; the body reports refreshed six-case proof on the unchanged integrated head.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after browser screenshots directly show main-composer and queued-editor continuations staying in their intended inputs after delayed Side chat mounting. The production pane and rail are exercised through menus and keyboard interactions with synthetic Gateway data; the body reports refreshed six-case proof on the unchanged integrated head.

Evidence

What I checked:

  • Current main still needs the repair: Fetched main retains the presentation-change autofocus fallback, allowing a delayed manual opening to focus Side chat without checking intervening input intent. (ui/src/pages/chat/components/chat-session-rail.ts:293, 13a743befb7b)
  • Focus ownership and invalidation: The pane captures opening intent before lazy mounting and checks session, agent, connection, input generation, draft revision, visibility, and active input ownership before focus. Pane input events invalidate requests even when the queued editor never loses focus. The rail no longer has an independent autofocus fallback. (ui/src/pages/chat/chat-pane-side-panels.ts:90, 111abca57c26)
  • Review continuity: An explicit comparison of all eleven introduced files against the previous reviewed head returned no differences. The previous completed review contained no findings; the new head incorporates main without changing these reviewed files. (111abca57c26)
  • Inspected browser proof: Inspected all four prepared PNGs linked in the captured PR body: e8ef91f4-3e18-4b0d-bd00-7b4d2f5ca03e, f244021f-6385-433d-a0d9-e74cc83ae620, f4bbf019-e240-46a2-bdfa-083d6758da2b, and eb745b2e-3d3e-4b05-836f-c45f84c22a73. Before captures show continuation text in Side chat; after captures show complete main-composer and queued-editor drafts with Side chat empty. The body identifies a real browser using synthetic Gateway data and reports six passing manual-opening cases on the reviewed head. These are UI interaction proofs, not live-provider claims.
  • Regression coverage and diagnostics: Six new browser cases exercise normal autofocus, newer main input, another pane, command palette, and newly focused or continuously focused queued editors. Existing focus coverage also exercises explicit commands, reopening, retained tabs, pending answers, and history hydration. Board diagnostics preserve the original actions, assertions, timeout, and thrown failure. (ui/src/e2e/chat-session-companion-manual-open-focus.e2e.test.ts:15, 111abca57c26)
  • Feature-history routing: Main history identifies prior Side chat focus work in fix(ui): open and focus Side chat with /btw and /side #147795 and composer work in fix(ui): transcript end hides under the PR chip and Side chat questions cannot wrap #144703. GitHub REST verifies both merged commits and their authors. Historical blame encountered unavailable blobs; the relevant focus patch and its raw recorded parent's source were inspected through REST instead. (ui/src/pages/chat/components/chat-session-rail.ts:295, 0b9b835d4ec6)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-18T08:27:29.412Z sha d811f85 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-18T08:47:15.091Z sha d811f85 :: needs changes before merge. :: none
  • reviewed 2026-09-18T09:51:47.659Z sha 7a38ba6 :: blocked before merge. :: none
  • reviewed 2026-09-18T10:06:15.127Z sha 7a38ba6 :: blocked before merge. :: none
  • reviewed 2026-09-18T10:33:00.496Z sha 7a38ba6 :: blocked before merge. :: none
  • reviewed 2026-09-18T13:17:33.394Z sha 02dcfef :: needs maintainer review before merge. :: none
  • reviewed 2026-09-18T13:38:24.441Z sha a730aa4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-18T14:01:47.078Z sha a730aa4 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit def6260 into main Sep 18, 2026
158 checks passed
@steipete
steipete deleted the codex/qa-manual-side-focus branch September 18, 2026 14:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 18, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
* fix: preserve typing when Side chat finishes loading

* test(ui): capture board iframe readiness failures
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant