Skip to content

perf(control-ui): remove chat reload padding jump and cut overlay style work - #173333

Merged
steipete merged 4 commits into
mainfrom
steipete/coldload-workbench-geometry-selectors
Oct 15, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/coldload-workbench-geometry-selectors

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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, lease cbx_790066b1635d, 16 CPUs / 30.6 GiB RAM, Node 24.19.0, repository Playwright Chromium 156. Base 3150853d9dee; candidate 394fc006d502. 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.ts fixture, 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:

Metric Baseline Geometry only Geometry + selectors
CLS 0.01127918 (0.00000452) 0.00175172 (0.00000904) 0.00175172 (0)
Style recalculation 677.8 (182.5) 530.4 (183.7) 429.0 (39.4)
Layout 48.6 (9.6) 41.9 (12.8) 41.4 (2.7)
First transcript row attached 322.4 (10.0) 321.8 (6.5) 317.6 (5.0)
Row passes visibility check 389.6 (12.6) 384.5 (6.3) 377.7 (7.8)
FCP 440 (8) 440 (8) 424 (0)
LoAF duration 1796 (151) 1775 (140.5) 1688 (130)
LoAF blocking 616 (86) 566 (102) 526 (56)
LoAF count 15 (1.5) 15 (1.5) 16 (1.5)
Renderer task time 2752.2 (102.2) 2757.8 (305.3) 2644.3 (187.5)
RPC count 87 (0) 87 (0) 87 (0)

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:

  • Baseline: 0.01127918, 0.01128823, 0.01127918, 0.01127918, 0.00142510, 0.01128823, 0.01127918.
  • Geometry: 0.00175172, 0.00175172, 0.00175172, 0.00175172, 0.00174268, 0.00174268, 0.00174268.
  • Combined: 0.00175172, 0.00175172, 0.00175172, 0.00174268, 0.00175172, 0.00175172, 0.00175172.

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 441a4319fe92 contains 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.
  • The affected UI-app typegraph, all ten broader core test graphs, UI production types, format, lint (0 warnings/errors), styles, and i18n pass.
  • Exact-head PR CI is green.
  • The full native UI E2E suite ran once on this head with --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 with Private mutation boundary is writable by another POSIX principal. It reproduces on the separate pinned-main checkout b479a7591eb2 (1 passed / 1 failed), before its ownership UI flow. The existing desktop-resize test is skipped because OPENCLAW_DESKTOP_REAL_FIXTURE was not supplied.

check-changed exits 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 are classifyAttachedCiRun, normalizePersistedBinding, PackageInstallerDeps, openUrl, expireDueOperatorApprovals, expectInvalidSlug, and mountLoginGate. 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.ts and .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.ts but includes the deleted .test.tsx reporter 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.

Chat before

Chat after

New Session before

New Session after

Systems before

Systems after

@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

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

  • Before: The shell initially reserves 20 px on each side, then removes it when the chat pane mounts.
  • After: The shell selects the final workbench inset before the pane mounts.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) A focused, well-motivated experiment with one small spacing defect; the changed browser behavior remains unproven for promotion.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: A dashboard reload can visibly shift horizontally when the mounted chat pane removes the shell's initial inset.
Reason: The measured handoff gives this small ownership simplification concrete value, and the feature owner explicitly authorized investigating it while withholding promotion.

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
Reviewed head: 6a5145c4ccd66d13613057a23bfa96d212d82641

Before merge

  • Preserve padding for non-session chat route results (P3) - At desktop widths above 1120 px, cold-opening a missing or ambiguous session, or an unavailable catalog share, now adds content--workbench and removes both 20 px shell insets. These loaders return missing-session, ambiguous, or route-error as ordinary data, so selectShellRouteState leaves routeFailed false; ChatRouteView renders recovery or selection content without mounting a pane. Previously that flow never published the workbench trait. Carry the rendered outcome into the shell's geometry decision so these pages retain their existing inset.

Findings

  • [P3] Preserve padding for non-session chat route results — ui/src/app/app-shell-view-state.ts:369

Tests

  • Missing end-to-end proof: The candidate lacks browser reload measurements and inspected before/after screenshots, including non-session route outcomes; a base-failing/head-passing regression run is also not shown.
Agent review details

How this fits together

The 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
Loading

Technical review

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

  • [P3] Preserve padding for non-session chat route results — ui/src/app/app-shell-view-state.ts:369
    At desktop widths above 1120 px, cold-opening a missing or ambiguous session, or an unavailable catalog share, now adds content--workbench and removes both 20 px shell insets. These loaders return missing-session, ambiguous, or route-error as ordinary data, so selectShellRouteState leaves routeFailed false; ChatRouteView renders recovery or selection content without mounting a pane. Previously that flow never published the workbench trait. Carry the rendered outcome into the shell's geometry decision so these pages retain their existing inset.
    Confidence: 0.97

Overall correctness: patch is correct
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 868ceb342f70.

Provenance checked

  • Shell workbench layout publication changes intended behavior with a stated reason (eca633a: The shared layout owner let both renderers publish presentation traits before descendants measured.)
  • Pane and pending-create workbench reporters changes intended behavior with a stated reason (5dd456a: The retained-pane Solid migration preserved layout classes and workbench custody; subsequent export cleanup carried the runtime reporter forward.)
  • Overlay descendant resets keeps the original intent (b68c44c: Native overlay primitives retained identical noninherited resets for shadow-hosted and document-hosted controls.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Explicit experiment hold: The complete live PR body says experiment only and do not merge, with measurements and synthetic screenshots deferred; GitHub reports the reviewed head as draft and mergeable. (6a5145c4ccd6)
  • Verified introduced change: The pinned introduction diff moves workbench selection into the shell, removes both page reporters, and preserves the overlay selectors' matching sets and specificity. (ui/src/app/app-shell-view-state.ts:369, 6a5145c4ccd6)
  • Current-main behavior: The affected production modules are unchanged between the introduction base and fetched main, so main still uses the pane-mounted workbench reporter. (ui/src/pages/chat/chat-pane-runtime-view.tsx:61, 868ceb342f70)
  • Non-session results bypass routeFailed: Shell route failure derives from router status, while missing-session and ambiguous results are returned as ordinary loader data and rendered without a chat pane. (ui/src/app/app-host-route-state.ts:36, 6a5145c4ccd6)
  • Earlier experiment establishes the handoff: The report at experiment(control-ui): style and layout containment [do not merge] #173262 records a 0.0095365 shift from the 20 px padding handoff and recommends stabilizing route-owned geometry before reconsidering selectors; its rejected selector prototype does not prove this candidate.
  • Feature ownership history: Merged history traces the layout owner, native overlays, Solid shell, and retained panes to Peter Steinberger; older-path research encountered a local missing-object limit. (ui/src/app/app-shell-view-state.ts:122, 868ceb342f70)

PR surface

Source 0, Tests -24. Total -24 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 17 17 0
Tests 2 19 43 -24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 36 60 -24

Labels

Label changes:

  • add P3: This experiment addresses reload geometry and rendering cost; the identified regression changes desktop spacing without blocking navigation or recovery.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This experiment addresses reload geometry and rendering cost; the identified regression changes desktop spacing without blocking navigation or recovery.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 15, 2026, 1:47 PM ET / 17:47 UTC.

@steipete steipete changed the title experiment(control-ui): stable workbench geometry and overlay selectors [do not merge] perf(control-ui): remove chat reload padding jump and cut overlay style work Oct 15, 2026
@steipete
steipete force-pushed the steipete/coldload-workbench-geometry-selectors branch from 6a5145c to 710a706 Compare October 15, 2026 17:59
@steipete
steipete marked this pull request as ready for review October 15, 2026 18:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T20:16:20.932850Z 441a431 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ui/src/app/app-shell-view-state.ts Outdated
custodianPanelAvailable,
activeRoute,
sessionRoute,
workbenchRoute: !host.routeState.routeFailed && isSessionRouteId(host.routeState.routeId),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete marked this pull request as draft October 15, 2026 19:45
@steipete
steipete force-pushed the steipete/coldload-workbench-geometry-selectors branch from 710a706 to 394fc00 Compare October 15, 2026 19:52
@steipete
steipete marked this pull request as ready for review October 15, 2026 19:58
@steipete
steipete force-pushed the steipete/coldload-workbench-geometry-selectors branch 2 times, most recently from 394fc00 to 441a431 Compare October 15, 2026 20:13
@steipete
steipete merged commit 38f8c42 into main Oct 15, 2026
112 checks passed
@steipete
steipete deleted the steipete/coldload-workbench-geometry-selectors branch October 15, 2026 22:12
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…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.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant