Repository navigation
perf(control-ui): reveal themed dashboard frames during load - #178740
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 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. |
|
|
Codex review: needs maintainer review before merge. What this changesThis PR lets themed dashboard frames paint during loading while keeping them inert until ready. Example: Reload the synthetic dashboard in dark mode.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR delivers a measured dashboard loading improvement and resolves the earlier fullscreen finding; the red CI gate and recorded merge pause remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI frame owner embeds the isolated sandbox shell, supplies widget documents and theme updates, and enables interaction after the current document reports readiness. flowchart TD
A[Dashboard view] --> B[Board frame owner]
B --> C[Themed sandbox shell]
C --> D[Isolated widget document]
E[Theme publisher] --> B
E --> C
D --> F[Current render receipt]
F --> B
Technical reviewBest possible solution: Retain the synchronous theme seed and separate painting from interaction readiness through the existing frame and sandbox owners. Do we have a high-confidence way to reproduce the issue? Current main hides frames until host readiness and delayed reveal; supplied browser comparisons demonstrate the resulting visible wait, without a new execution during this read-only review. Is this the best way to solve the issue? The patch addresses the wait at its existing presentation owner, initializes the shell before painting, preserves interaction readiness, and removes the superseded reveal callbacks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f70a4ba83c2b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +11, Tests +145. Total +156 across 10 files. Added test files: 1. View PR surface stats
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 October 20, 2026, 8:47 PM ET / October 21, 2026, 00:47 UTC (Revision 2). |
ad649d6 to
675e0c8
Compare
|
The fullscreen finding is fixed in The body now includes the final proof and the remaining CI failures. The two menu failures did not reproduce in either the original CI merge/shard replay or current main; they are not claimed repaired, and the original GitHub run remains red. No merge has been requested. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…openclaw#178740) The dashboard's MCP app stayed hidden until the host page processed the app's ready message and revealed the sandbox iframe after two animation frames; on a reload that message waits behind the host's boot work (~1.05 s), although the cross-origin frame paints in its own process. Show the frame transparently over its placeholder from insertion, and give the sandbox shell the host theme in its URL fragment so its inline head script sets color-scheme before first paint; the embedding iframe's color-scheme follows the theme too, so the browser never paints an opaque canvas (the cause of white flashes). Evidence (AWS c7a.4xlarge, 11 pairs per theme, filmstrip-measured first visible chart pixels): light 1,194.8 -> 964.6 ms (-233.0 paired, 11/11), dark 1,269.0 -> 949.5 ms (-278.6 paired, 11/11); 0/11 white or opaque flashes in each theme; secondary metrics within the no-regression rule; error/stale/needs-approval presentation unchanged. Runtime +11 LOC. Full UI 838 files / 3,617 tests. Exact-head reds are unrelated: checks-fast-baseline-ratchets (mock-exports flags src/commands/doctor-database-network-storage.test.ts from the merge base), and checks-ui shards failing chat-composer-plus-menu-loading and menu-surface submenu-highlight tests that pass on replay of the original source, shard and main.
…ticket (#179058) A warm-restored dashboard attaches its sandbox iframe before hello (#178658) and shows the frame as soon as the app paints (#178740), but the board widget's sandbox host stayed inactive until the gateway was available, so the app HTML fetch and document delivery waited for hello. A restored, unexpired view ticket already authorizes that HTTP read: while the first connection is still connecting (no hello yet), activate document loading when the restored ticket has TTL remaining. Bridge actions stay gated on the connected socket; after hello, gateway availability governs as before; the server still validates the ticket on every request. Evidence (AWS c7a.4xlarge, 11 pairs per theme, filmstrip-measured first visible chart pixels): light 1,000.6 -> 917.4 ms (-94.8 paired, 9/11), dark 1,014.1 -> 909.2 ms (-95.0 paired, 10/11); 0 flashes; hello, FCP, LoAF, chat catch-up and chat route within the no-regression rule. Runtime +13 LOC. Focused/native tests, HTTP/account-scope checks, full UI 846 files (inherited failures repaired on main by #179052); exact-head CI green.
…ticket (openclaw#179058) A warm-restored dashboard attaches its sandbox iframe before hello (openclaw#178658) and shows the frame as soon as the app paints (openclaw#178740), but the board widget's sandbox host stayed inactive until the gateway was available, so the app HTML fetch and document delivery waited for hello. A restored, unexpired view ticket already authorizes that HTTP read: while the first connection is still connecting (no hello yet), activate document loading when the restored ticket has TTL remaining. Bridge actions stay gated on the connected socket; after hello, gateway availability governs as before; the server still validates the ticket on every request. Evidence (AWS c7a.4xlarge, 11 pairs per theme, filmstrip-measured first visible chart pixels): light 1,000.6 -> 917.4 ms (-94.8 paired, 9/11), dark 1,014.1 -> 909.2 ms (-95.0 paired, 10/11); 0 flashes; hello, FCP, LoAF, chat catch-up and chat route within the no-regression rule. Runtime +13 LOC. Focused/native tests, HTTP/account-scope checks, full UI 846 files (inherited failures repaired on main by openclaw#179052); exact-head CI green.
What Problem This Solves
A dashboard app can already have drawable pixels in its isolated iframe while the host thread is busy with reload work. Keeping the frame hidden until the host handles the ready message delays the visible dashboard. Simply exposing the frame also caused a browser canvas flash when its initial color scheme differed from the embedding iframe.
Seed the sandbox shell's theme from a stable URL fragment and apply it synchronously before body parsing. Set the embedding iframe to that same scheme, synchronize later theme updates, and refresh the seed only for a real sandbox navigation. The transparent initial frame can composite over the existing skeleton while staying inert until ready. Error, stale, approval, timeout, and retry presentation keep their existing owners. Delete the obsolete double-animation-frame reveal path.
Evidence
11 interleaved baseline/candidate pairs per theme on one quiet AWS Crabbox
c7a.4xlarge, leasecbx_7b6bbd7871e3, run. Repository Playwright Chromium, synthetic Team-scale dashboard, rotating tickets, separate sandbox origin and its own font. Connect floor 350 ms, connect latency 240 ms, board.get 160 ms, other RPCs 35 ms. Measurement commit8da6fc0d5f050fc619861564a106c4a06829706a; all four reveal runtime files are byte-identical in this independent split and its test-only repair. Both sides use the same candidate sandbox server; isolated bundles compare hidden/revealed presentation under that shell, not old/new server deployments. No private captures or real account data are included.Pixels are detected in compositor screenshots of the synthetic chart, not host message or DOM observer timestamps. All runs insert one iframe, and first chart pixels follow insertion. Candidate pixels precede the host’s synthetic app-ready receipt in 11/11 runs per theme: paired median lead 110.2 ms light and 107.8 ms dark. Receipt timestamps describe host dispatch, not network arrival; visible pixels no longer depend on that dispatch. Authored app JavaScript and font startup remain outside this change. The campaign's original signed-in deep-link evidence recorded 14 visual states and dashboard paint at 11.75 seconds; later attribution isolated this host-side reveal wait.
Predeclared primary: at least 9/11 better with negative paired median. Secondary regression: worse non-overlapping IQRs, or at least 9/11 worse pairs with median paired rise above max(10 ms, 3%). Hello, FCP, LoAF blocking, chat catch-up, and chat-route controls pass. No pair was dropped. Combining this with the independent restore fix also passes (light −220.1 ms, dark −205.9 ms paired, 11/11 each), with 0/11 iframe flashes per theme.
Screenshot review screened 5,318 post-navigation frames across reveal-only and combined runs, checked per-run pre-content/first-chart/settled states and full representative timelines. The initial whole-document blank precedes the iframe and is distinguished from an iframe canvas flash. Both themes retain their expected dashboard background through paint and settlement.
Benchmark command
Use the baseline/candidate bundle construction described above, one fixed build ID, the campaign probes, and one
FIXTURE_NOW_MScaptured at the start of the comparison. The benchmark alternates baseline/candidate for 22 runs (11 pairs).Repeat the same 11 pairs with
--color-scheme dark. The chat control uses--face chat --untraced, retaining the 1 ms validator delay and omitting--chat-dashboard-route,--dashboard-paint-marker,--filmstrip-only, and--color-scheme.Validation
Final head:
675e0c8ad638a22569c5eb02f7d64b805c3eaafc, rebased onto05ade6d2df13f660e9df17cbedaeba5eb9f93dfc. Independent split and test-repair reviews are clean through P2. Fullscreen and A2UI coverage now distinguish visible painting from interaction readiness by waiting forinertremoval; the held-document fullscreen state remains visible, inert, and covered by its loading status. The repair changes tests only; all four runtime files are byte-identical to the measured version. Final-head proof ran on AWSc7a.4xlarge, leasecbx_e5f9f79bb739, run: full UI e2e: 838 files / 3,617 tests passed; 4 files / 4 tests skipped, command wall 6,425 s (Vitest 6,303.95 s). All changed and sibling browser scenarios are included. Focused owner tests: 5 files / 37 tests passed (38 s); UI types passed (15 s); fullscreen 9 tests passed (66 s including build), A2UI 6 tests passed (61 s including build). The four opt-in skipped files aredesktop-resize,peer-followup-restart,chat-steer-deferred-custody, anddeepseek-searchreal-Gateway e2e. The working tree stayed unchanged. The lease is released. Stop before merge.Exact-head CI completed with three underlying failures: a test-mock export ratchet and two UI shards. The mock ratchet is an unchanged upstream doctor test, repaired on main in
2466488c29e2. The UI failures are the menu-highlight assertion inmenu-surface.browser.test.tsxand lazy-content assertions inchat-composer-plus-menu-loading.test.tsx; their owners/tests are unchanged and do not execute the modified board-frame paths. The exact-head menu-surface pinned-Bun replay passes (22 tests, 13 s). The original failing CI merge87c1ef107751ea8ce543d879304c65a91760c02e(PR head675e0c8aplus CI base92477a7) also passes both original shard inventories with three workers restricted to two CPUs: shard 1/3 266 s, shard 3/3 253 s, including all seven composer-loading cases. This bounded replay used AWS leasecbx_bf62248fe437, run. The relevant test/owner blobs are identical to the PR head.Main snapshot
f5f3ed438533af1a97af9734d2b3518902f6d3b0passes the same saved shard inventories (129 s / 126 s) and the mock ratchet (14 s), on leasecbx_6410a35ff63d, run. The failure assertions were verified in the passing logs. Main has dependency updates; its newer retained-focus menu branch is not used by these tests. The AWS host has more memory than the original CI runners, and cache-dependent dispatch ordering can differ. These passing replays do not establish a repair or reproduce the same failures on main. The two menu failures remain intermittent/unreproduced; the GitHub run remains red. No GitHub jobs were rerun or branches updated to chase unrelated reds. This is an explicit remaining CI gate for the lead.Prior exact-runtime proof: frame owner and resilience, theme owner, sandbox/gateway owners, native first-theme regression, and eight sibling browser files pass. The new browser regression fails on the old shell at initial
color-scheme: normalbefore any theme delivery, then passes both themes and later updates with the fix. The error/stale/needs-approval and timeout/retry owners remain covered by their existing tests.pnpm test <file> --maxWorkers=1walls: frame resilience 4.88 s; frame owner 4.31 s; widget theme 3.76 s; native sandbox theme 57.92 s including production build/setup. The browser composition is needed to establish synchronous shell initialization before first iframe canvas paint. The earlier combined-head full UI attempt was superseded during the split and is not claimed as a full-suite pass.Scope and Release Note
Runtime and requested production exclusion filter: +48/−37, net +11 LOC. Growth preserves the initial-theme/navigation contract; the double-animation-frame state and callbacks are removed. No new configuration option, durable Gateway shape, CSP permission, or approval model change. The fragment does not change the sandbox HTTP request/cache key; ready-message matching retains the complete iframe URL.
Release-note context: dashboard frames show app pixels while the host is busy finishing reload work, without a mismatched-theme browser canvas flash. The independent restore correction is #178658.
Synthetic Screenshots
These panels show the same synthetic dashboard near 1.05 seconds, with actual capture timestamps labeled.
All reveal/composition medians, IQRs, and per-pair deltas
combined-chat
11 interleaved pairs; milliseconds; brackets are IQR. Delta = candidate − baseline.
combined-dark
11 interleaved pairs; milliseconds; brackets are IQR. Delta = candidate − baseline.
combined-light
11 interleaved pairs; milliseconds; brackets are IQR. Delta = candidate − baseline.
reveal-chat
11 interleaved pairs; milliseconds; brackets are IQR. Delta = candidate − baseline.
reveal-dark
11 interleaved pairs; milliseconds; brackets are IQR. Delta = candidate − baseline.
reveal-light
11 interleaved pairs; milliseconds; brackets are IQR. Delta = candidate − baseline.