Repository navigation
perf(control-ui): remove chat reload padding jump and cut overlay style work - #173333
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 changes before merge. What this changesThis PR selects chat and dashboard workbench geometry before page mount and rewrites equivalent overlay descendant selectors. Example: Reload a signed-in dashboard at a 1719 px viewport width.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open as the explicitly held experiment; the ownership change is useful, with one small layout regression identified. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI shell consumes router state, selects content layout classes, and hosts retained chat pages; shared overlay CSS supplies control resets. flowchart TD
A[Router matches] --> B[Shell route state]
B --> C[Shell view]
C --> D[Content layout classes]
D --> E[Retained chat page]
F[Overlay stylesheet] --> E
Technical reviewBest possible solution: Keep geometry owned by the shell while preserving normal padding for non-session route results. Do we have a high-confidence way to reproduce the issue? Current-main source shows padding removed by the pane's settled reporter, corroborated by the earlier experiment's shift trace; no target code was executed during this review. Is this the best way to solve the issue? Selecting geometry before pane mount addresses the demonstrated owner handoff, but the condition must distinguish successful session content from ordinary loader results that render errors or session choices. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 868ceb342f70. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource 0, Tests -24. Total -24 across 8 files. Added test files: 0. View PR surface stats
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 Reviewed October 15, 2026, 1:47 PM ET / 17:47 UTC. |
6a5145c to
710a706
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 710a706f31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| custodianPanelAvailable, | ||
| activeRoute, | ||
| sessionRoute, | ||
| workbenchRoute: !host.routeState.routeFailed && isSessionRouteId(host.routeState.routeId), |
There was a problem hiding this comment.
Restrict workbench geometry to rendered sessions
When a chat/dashboard loader successfully returns ambiguous, missing-session, or route-error, routeFailed remains false, so this marks the ordinary card/error view as content--workbench even though no workbench pane mounted. On viewports at least 1121 px wide, startup-layout.css then removes the normal 20 px horizontal padding from these resolution outcomes; the previous pane-owned reporter only applied the class for an actual chat pane or pending creation. Preserve the early class while loading, but clear it when the rendered route data is not a session.
AGENTS.md reference: ui/AGENTS.md:L15-L18
Useful? React with 👍 / 👎.
710a706 to
394fc00
Compare
394fc00 to
441a431
Compare
…it overlay reset selectors (openclaw#173333) Chat routes now get the workbench layout from the shell's route state, so the content area renders at its final geometry from the first frame. Previously the shell painted with .content's 20 px inline padding until the chat pane settled and published { workbench: true }, shifting openclaw-router-outlet by 20 px on each side (bimodal CLS ~0.011). Failed routes and session-route notices keep the padded layout. The overlay reset selectors :is(.oc-overlay, .oc-modal-dialog) * and their ::-webkit-scrollbar variants are split into explicit-ancestor selectors with identical matching and specificity, letting the style engine reject non-overlay ancestor chains early (they were ~18% of selector matching with zero matches). Seven interleaved AWS blocks: CLS 0.01128 -> 0.00175 with zero padding jumps; style recalculation 677.8 -> 429.0 ms; FCP 440 -> 424 ms; LoAF blocking 616 -> 526 ms. Runtime +11 LOC. Full UI e2e 3,499 passed (one baseline-confirmed QA failure). Exact-head CI green.
What Problem This Solves
Removes a 20 px padding jump during a signed-in reload of a dashboard deep link, then reduces overlay-selector matching across the page. The campaign's original reload showed 14 visual states over roughly 15 seconds; its later layout investigation isolated a roughly 0.0095 CLS jump from this padding transition.
User Impact
Chat and dashboard routes reserve their final workbench geometry before the pane mounts. New Session, Systems, pending creation, failed/unknown routes, and successful missing/ambiguous/error notices retain their existing layouts. Settled appearance is unchanged. No configuration, Gateway protocol, or stored-data changes.
Why This Change Was Made
The pane's settled callback reported workbench layout too late. The shell now derives it from the rendered route state. The existing route-state owner distinguishes resolved notices from session content, including those returned successfully by the loader. This removes the pane/pending-create reporting path, the workbench reporter trait, and its obsolete pane test.
Equivalent explicit overlay ancestors replace grouped universal-descendant selectors, preserving matching sets and specificity while allowing cheap ancestor rejection. Earlier diagnostic traces of this same selector patch reduced matching time for the two expensive groups from 154.025 to 7.193 ms. No other grouped-ancestor/universal-descendant pattern appeared in the selector statistics.
Evidence
Quiet AWS
c7a.4xlarge, leasecbx_790066b1635d, 16 CPUs / 30.6 GiB RAM, Node 24.19.0, repository Playwright Chromium 156. Base3150853d9dee; candidate394fc006d502. Seven interleaved blocks alternate baseline → geometry → combined and the reverse. All 21 captures are included. Each capture warms the maintained Team-scale fixture, retains cached transcript/sidebar state, and reloads in a fresh browser context at 1719 × 1179, with 35 ms simulated RPC latency / 4 ms event spacing.The experiment uses
scripts/bench-control-ui-cold-load.tsfixture, server, and readiness assertions, with untraced native Performance counters and the campaign LoAF/mutation and WebSocket census probes over a fixed 15-second window. All performance timings below come from AWS.Median (IQR), milliseconds except CLS and counts:
CLS is the probe's sum of layout-shift values without recent input. Row attachment and visibility checks are DOM markers, not paint timestamps; FCP is measured separately. IQR uses linear interpolation.
The geometry fix eliminates the outlet padding jump in all seven runs. The selector step reduces median style time another 19.1% relative to geometry-only. Combined style time falls 36.7%, LoAF blocking 14.6%, and LoAF duration 6.0% against baseline. LoAF count increases by one; aggregate blocking falls. The first-row attachment change is small. Baseline and geometry style timings vary substantially, so the IQRs are included. An earlier independent seven-block comparison also found a selector-step style reduction of 21.4% (measurement/selector trace run, lease
cbx_96f5f2a50697).All CLS samples, in block order:
Shift-source records show the outlet moving x=330 → 310 in 6/7 baseline runs and 0/7 runs of either candidate. Both candidate distributions stay in the low mode.
Measurement run: https://crabbox.openclaw.ai/portal/runs/run_9428f58d3cb5bd3f0d81b3d5ce152df5. All capture JSON/PNG files were recovered. A telemetry-upload warning did not affect the captures; the lease was stopped after measurements to replace it for a test-only head correction.
Validation
Final head
441a4319fe92contains the same measured production change, the independently reviewed router test-type correction, and the required main rebase. Main's pending-session title handling is preserved. The pre-pane shell regression fails on the old runtime; the real-router notice regression fails before its correction and passes afterward. Independent review is clean through P2.On AWS lease
cbx_555303bdab78:pnpm test ui/src/app/app-shell-view.test.ts --maxWorkers=1: 4 passed, 9.28 s wall.pnpm test ui/src/pages/chat/chat-pane-bridge.test.tsx --maxWorkers=1: 2 passed, 9.42 s wall.--maxWorkers=4(serial projects retain their single-worker scheduling): 800 passed / 3 failed / 1 skipped files; 3495 passed / 1 failed / 5 skipped tests, 4355.56 s. Two files failed setup because WebKit was absent. After installing the repository-pinned browser, only those two files were rerun: 2 files / 4 tests pass in 33.02 s, including Chromium and WebKit tooltip activation and Workboard overlay parity. Combined coverage is 802 passed / 1 failed / 1 skipped files, 3499 passed / 1 failed / 1 skipped tests. Raw first-run results and the supplement remain separate in the evidence.The remaining failure,
extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts, fails during provider-readiness artifact setup withPrivate mutation boundary is writable by another POSIX principal.It reproduces on the separate pinned-main checkoutb479a7591eb2(1 passed / 1 failed), before its ownership UI flow. The existing desktop-resize test is skipped becauseOPENCLAW_DESKTOP_REAL_FIXTUREwas not supplied.check-changedexits 1 for two guards that also fail on that pinned main baseline: the environment-variable count is 452 against a budget of 453, and the dead-export scan reports exactly the same seven untouched exports. The exported names areclassifyAttachedCiRun,normalizePersistedBinding,PackageInstallerDeps,openUrl,expireDueOperatorApprovals,expectInvalidSlug, andmountLoginGate. No guard or baseline exception was added. The QA readiness/permission fixture and these inventory failures remain owner follow-ups.Validation run: https://crabbox.openclaw.ai/portal/runs/run_64138b9a50628ac00fa62cb28902cb73. The lane retains raw logs and a complete file-by-file pass/fail list. This PR is ready for lead review; this lane does not merge it.
Runtime production LOC delta: +11 (28 added / 17 removed, excluding
.test.tsand.test.tsx). Selector expansion and deleted late layout reporting offset each other. The extra route-state projection and equality comparison preserve the contract that successful missing/ambiguous/error loader results retain padded notices. The requested stat filter excludes.test.tsbut includes the deleted.test.tsxreporter test: 28 added / 60 removed. No changelog edit; this body supplies release-note context.Synthetic visual proof
Inspected all three before/after pairs. Chat captures below come from the repeated AWS comparison. New Session and Systems use the earlier AWS-built bundles in local headless Chromium after content-readiness checks; their shell bounds and 20 px padding agree. Local capture timings are not performance results. All content is synthetic; no private campaign media or real account content is included.