Repository navigation
perf(control-ui): reduce dashboard loading flashes on warm reload - #190925
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 prepares dashboard renderers without blocking route admission and delays cached-panel loading decorations by 200 ms. Example: Reload a dashboard with a cached session while its board renderer is still loading.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-directed experiment open and respect its do-not-merge status; the introduced baseline expansion is a concrete blocker. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI dashboard route loads presentation modules, consumes existing scoped session snapshots, and renders the board and transcript through independent lazy boundaries. flowchart LR
A[Dashboard route] --> B[Route entry]
A --> C[Lazy renderer preparation]
B --> D[Cached session pane]
C --> E[Board and sidebar boundaries]
D --> E
E --> F[Shared loading placeholder]
E --> G[Board and transcript]
Technical reviewBest possible solution: Keep preparation in the existing lazy owners and loading grace in the shared placeholder, while preserving the shrink-only guard and qualifying the experiment before advancing it. Do we have a high-confidence way to reproduce the issue? Current source contains successive lazy placeholders and broad page-mode selectors that reach placeholder grids; the earlier experiment supplies matching observations, but this read-only review ran no target code. Is this the best way to solve the issue? The change reuses the existing cache, lazy boundaries, and shared placeholder rather than adding a competing owner; its smallest complete form must also avoid expanding the untrack baseline. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6deb24aa4654. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +42, Tests +65, Docs 0, Other +207. Total +314 across 15 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 November 2, 2026, 2:09 AM ET / 07:09 UTC. |
fbe3ef3 to
f804377
Compare
f804377 to
da220d5
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. |
da220d5 to
35138da
Compare
…enclaw#190925) Warm reloads of a dashboard deep link no longer flash three successive panel shimmers. The dashboard route now returns its entry immediately and starts the sidebar-region and board lazy wrappers without awaiting them, so only the rendered boundary waits. The shared panel placeholder uses the existing cached-session fact (captured once at pane mount) to keep the settled background for a 200 ms grace before normal loading feedback; cold admission stays immediate. Page-board grid/tab selectors now target the real board's direct children, so the placeholder's 56 px rows no longer collapse and shift (the source of the warm-dashboard CLS). The route-level preload block is removed. No persisted field, store, config, protocol or untrack allowance. Native 11-pair proof (AWS c7a.4xlarge, Team-scale synthetic fixture, 80 ms RTT): panel-shimmer exposure 13,290 -> 0 node*ms (11/11), cached widget layout -282 ms (11/11), all widgets visible -193 ms (11/11), widget content -160 ms (10/11), side-pane first rows / visible transcript -32/-30 ms (7/11), warm CLS occurrences 2/11 -> 0/11, snapshot growth 0 B; chat route unchanged. Lead exception: dashboard hello-handled +26 ms paired median (non-overlapping IQRs, 8/11 later; A/A +11 ms overlapping), accepted as the cost of compiling the board work before the handshake; no visible content is delayed. Supersedes openclaw#190820.
On a warm reload of an active chat, automatic end-follow aimed at estimated heights for the newly appended rows. Once the real measurements replaced those estimates, the transcript scrolled backward. A later tool completion repeated the correction. On Peter's real page this showed up as repeated corrections over roughly 500 ms and a CLS of 0.11 to 0.12. Automatic end-follow now picks its destination from the existing native measurement batch. It waits until the mounted destination rows and their virtual sizes agree, and the competing synchronous warm measurement pass is gone. The measured window covers the full destination viewport, including several appended turns. Warm reader restoration joins that same batch. Real older-history prepends keep the synchronous anchor they need before paint, because deferring that boundary broke continuous native reading. Arrival retires the scroll command through its existing owner. Retargeting keeps an already-issued smooth destination while its measured replacement is prepared, so native motion that is still running is not mistaken for reader input. No store, config, protocol field or cache shape is added. Proof: 11 interleaved pairs plus A/A on a quiet AWS c7a.4xlarge (132 pair deltas in total), Team-scale fixture. - Active-chat backtracking goes from 76 to 0 px in 11/11 pairs. A planned second block confirms it. - History replacement followed by tool completion goes from 144 to 0 px in 11/11. - Both reader variants keep 0 px movement with no missing anchor frames. - RPC counts and payloads are unchanged in every pair. - The native regression e2e fails on the pre-fix code and passes on this head. The lead accepted a recorded cost exception: +34 ms total blocking, +21 ms forced style/layout in the 700-1300 ms replacement window, and +7 ms final rows. That cost delays no visible content (same precedent as #190925). Exact-head CI is green. Chat boot JS is +661 B against its base and stays inside the unchanged 1,289,030 B cap. No cap or baseline changed. The full UI suite's three reds reproduce identically on main. The test-lines checker now lets an exact allocation reconcile the base's existing overage without creating slack. The bound is own growth plus inherited debt, floored at zero, with real-Git regression cases. This PR's allocation is 278 lines: 273 regression-test lines plus 5 lines of lead-approved inherited debt.
On a warm reload of an active chat, automatic end-follow aimed at estimated heights for the newly appended rows. Once the real measurements replaced those estimates, the transcript scrolled backward. A later tool completion repeated the correction. On Peter's real page this showed up as repeated corrections over roughly 500 ms and a CLS of 0.11 to 0.12. Automatic end-follow now picks its destination from the existing native measurement batch. It waits until the mounted destination rows and their virtual sizes agree, and the competing synchronous warm measurement pass is gone. The measured window covers the full destination viewport, including several appended turns. Warm reader restoration joins that same batch. Real older-history prepends keep the synchronous anchor they need before paint, because deferring that boundary broke continuous native reading. Arrival retires the scroll command through its existing owner. Retargeting keeps an already-issued smooth destination while its measured replacement is prepared, so native motion that is still running is not mistaken for reader input. No store, config, protocol field or cache shape is added. Proof: 11 interleaved pairs plus A/A on a quiet AWS c7a.4xlarge (132 pair deltas in total), Team-scale fixture. - Active-chat backtracking goes from 76 to 0 px in 11/11 pairs. A planned second block confirms it. - History replacement followed by tool completion goes from 144 to 0 px in 11/11. - Both reader variants keep 0 px movement with no missing anchor frames. - RPC counts and payloads are unchanged in every pair. - The native regression e2e fails on the pre-fix code and passes on this head. The lead accepted a recorded cost exception: +34 ms total blocking, +21 ms forced style/layout in the 700-1300 ms replacement window, and +7 ms final rows. That cost delays no visible content (same precedent as openclaw#190925). Exact-head CI is green. Chat boot JS is +661 B against its base and stays inside the unchanged 1,289,030 B cap. No cap or baseline changed. The full UI suite's three reds reproduce identically on main. The test-lines checker now lets an exact allocation reconcile the base's existing overage without creating slack. The bound is own growth plus inherited debt, floored at zero, with real-Git regression cases. This PR's allocation is 278 lines: 273 regression-test lines plus 5 lines of lead-approved inherited debt.
What Problem This Solves
Final head:
35138da3cf7cf532f96c146fcd15885b7b5aebd0. Supersedes #190820. Reopened under explicit lead acceptance of the measured runtime atf8043775d6ffd41a1219a8f4937f9dea879bdf81. Measurement baseline:b0fdadd6b3448af5e23c45794465d48d97944fbe; landing rebase:2777468d26e5f21455b67591a045a40c770aee13. Runtime files are byte-identical after the conflict-free rebase.The campaign evidence recorded 14 visual states on a signed-in dashboard deep-link reload. This lane attributed 60 shimmer nodes to three successive 20-node panel placeholders. The previous experiment held route admission while preparing optional wrappers and delayed the side-pane transcript.
Why This Change Was Made
The route now returns its entry immediately while starting both existing lazy wrappers without awaiting them. Only the rendered boundary waits. The shared panel placeholder uses the existing scoped cached-session fact to keep its background for a 200 ms grace, then shows normal loading feedback if still pending. This bounds a brief wait without an immediate shimmer flash; cold admission stays immediate. One stylesheet implementation reaches native component roots, including widget-frame overlays, and a nested cold pane resets the inherited delay. No persisted field, store, config option, protocol, ticket, or sandbox change.
The page-board selectors now target the real board's direct children, excluding the placeholder's identically named grid and tabs. The superseded direct implementation preload block and route-level Promise.all barrier are removed. No new untrack allowance remains.
User Impact
The visible gain is substantial: median viewport panel-shimmer exposure falls from 13,290 to 0 node·ms, with improvement in 11/11 pairs; 7/11 candidate reloads have zero panel-shimmer exposure. Cached widget layout and widget readiness improve in every pair, and side-pane paint is earlier by paired median.
The standing hello-handled secondary gate fails. Dashboard hello-handled moves from 679.34 [654.31, 695.49] to 723.14 [698.48, 743.08] ms: non-overlapping IQRs, paired median +26.28 ms, 8/11 later. The paired-sign limb alone does not trigger (8, not 9); the separate non-overlapping-IQR limb does. Matched A/A is 673.89 [656.79, 698.11] → 671.75 [656.31, 692.90] ms, paired median +11.07 ms, 6/11 later with overlapping IQRs. It does not reproduce the shifted distribution.
The original transcript regression is gone: first painted rows have paired median −31.88 ms, visible transcript −30.47 ms, both 7/11 earlier. Chat secondaries satisfy the no-regression rule. Explicit lead exception; this is not a claim that the gate passed. The lead accepts dashboard hello-handled paired median +26.28 ms (IQRs separated by about 3 ms, 8/11 later; matched A/A +11.07 ms with overlapping IQRs) as the cost of compiling/mounting the board work the user is waiting for before the handshake. Every listed dashboard content milestone moves earlier: panel shimmer 13,290 → 0 node·ms (11/11 better), cached layout −281.56 ms (11/11), all widgets visible −193.32 ms (11/11), widget content −160.42 ms (10/11), side-pane first painted rows / visible transcript −31.88/−30.47 ms (7/11), LoAF blocking −26.10 ms, warm CLS occurrences 2/11 → 0/11; chat has no measured regression. The hello gate guards against trading away visible transcript time; visible transcript instead improves here, and no measured visible content is delayed. The decision to deviate from the standing hello secondary belongs explicitly to the lead.
Evidence
AWS Crabbox
cbx_6387e254d075, runrun_d7e29e0bb21ead47b244528fd241b987; one fixedc7a.4xlarge, 16 CPUs, about 31 GiB RAM, Chromium 156.0.8078.4. Unprofiled native real-Gateway Team-scale workload: 3,000 synthetic sessions, bundled Workboard plus synthetic plugin modules, archived routes, operator-like involving-me/category/created sidebar settings, 97 synthetic groups, 102 section-order entries, five collapsed sections, always-visible empty groups, previews disabled, and pins. Eleven interleaved AB/BA pairs per route, then eleven matched A/A pairs per route. A/A uses a separate byte-identical baseline directory so root swapping matches A/B. Both arms use the same built Gateway and durable synthetic state.Native CDP shaping: 80 ms latency, 10 MiB/s each direction; it is not calibrated per-RPC wire RTT. Initial fixture-inclusive CPU idle was 74.7% (A/B) and 75.9% (A/A); live synthetic peers remain active. A/B end load was 0.90/1.04/1.27 on 16 CPUs. No unrelated workload was run on the lease. No local timings are performance results.
Command for each comparison (A/A substitutes the byte-identical directory):
Every warm capture has one document load and zero browser errors. Snapshot bytes are unchanged: chat 62,970 → 62,970; dashboard 64,783 → 64,783. Growth: 0 bytes.
cachedBoardLayoutMsis the first rAF observing the real cached widget layout;allBoardWidgetsVisibleMsobserves the existing non-inert readiness contract. First rows use the browser's element-timing paint observation. DOM readiness marks are not display-vsync proof. The contact strips below are Chromium compositor captures, aligned at common timestamps with the last delivered representative held between frames.CLS attribution
Baseline dashboard pair 3 records CLS 0.0071706087 at 834.53 ms. Both sources are
div.widgetinsideopenclaw-panel-loading-skeleton > .board-grid, not the transcript or header:The page-mode descendant
.board-gridselector overrides the skeleton's 56 px rows withminmax(0,1fr): the lower cards move up 104 px and shrink 78 px. Restricting the rule to> .board-view > .board-gridpreserves the placeholder geometry; the matching tab rule is scoped too. The browser regression asserts 56 px placeholder rows while HTML is held. Warm dashboard CLS occurrences: baseline 2/11, candidate 0/11. A/A retains intermittent occurrences; chat warm CLS is zero in both arms.Representative widget path
Pair 6 is selected by the median paired widget-readiness delta. One sandboxed widget is exercised; the plugin activation fixture does not establish data-heavy MCP app performance. Times are diagnostic document-relative milliseconds (rAF metrics are navigation-normalized; the other event marks use the document clock).
The rAF layout marker can follow iframe creation when the main thread is busy. Board/layout data comes from the existing snapshot in both arms. The candidate starts the iframe before hello; it does not wait for connect or a fresh board.get. Static sandbox assets retain their cache path; the existing ticket-bound HTML fetch remains fresh. Response headers do not mean the document body/iframe bootstrap has finished. Existing host-state posting and authorization are unchanged; no data RPC is added. The remaining document/iframe work is outside this change.
Diagnostic timing for the accepted secondary exception: dashboard connected-state publication medians are 639.54 → 676.64 ms; publication-to-handled interval medians are 41.6 → 44.7 ms. Most of the shift precedes publication. These unprofiled marks do not establish a specific CPU or server cause.
Inspected synthetic before/after strips
All nine strips for pair 6 were inspected locally. Only synthetic app content and public app artwork are present. No private capture is uploaded. The common bootstrap loading surface remains visible in both arms; this lane changes the subsequent panel placeholders, not the entire campaign's warm-reload experience.
Early panel interval (baseline left, candidate right):
Widget fill interval:
Validation and gaps
Measured head
f8043775d6ffd41a1219a8f4937f9dea879bdf81oncbx_6387e254d075(retained prior-head proof): build, scoped scripts/UI lint, stylesheet lint, Solid guard, exact test-line guard, and five focused suites 58/58 passed (10.63 s remote wall). Dashboard regression 2/2 passed:pnpm test ui/src/e2e/dashboard-cold-load.e2e.test.ts --maxWorkers=1, 31.98 s wall. The same changed test on measurement baselineb0fdadd6b3448af5e23c45794465d48d97944fbefails 2/2 at the intended warm-shimmer visibility assertion, 25.16 s wall. It also covers cold immediate feedback, independent transcript/layout readiness while a board chunk is held, expiry of the grace, and fixed placeholder geometry. The browser/build setup is included in that wall time; real lazy-chunk admission, iframe lifecycle, and computed CSS animation/geometry are the contract a mocked unit test cannot exercise.Initial landing CI found an owned unit-test timeout in
route-subscription-preload.test.ts: it awaited presentation imports in the data loader, although the measured fix intentionally starts them at component entry. The test now retains subscription preload/no-observer coverage; the dashboard browser regression owns the independent chunk/render behavior. The test-only fix passes locally (3.71 s wrapper) and remotely on the final head (pnpm test ui/src/pages/chat/route-subscription-preload.test.ts --maxWorkers=1, 4.44 s wall), with no runtime change. Independent local review is clean through P2 for the candidate and the test-only repair.Final-head validation used AWS
cbx_c475a08f3c1a, onec7a.4xlarge(16 CPUs, 31,378 MiB RAM). Collector runrun_81b9c8d6ab777ac9c9dd74ccfbaa5030; pinned-main control runrun_cee74ccf92b1a84d6aa67f8c1c9580d4. Both candidate and control source trees were verified clean at their pinned SHAs. All runtime files in this diff are byte-identical to the measured head after the conflict-free rebases; the conditional five-pair recheck was not triggered.The full UI e2e suite ran once on final head with no include-file filter and no real-Gateway/production-artifact opt-outs: 896 files: 894 passed, 2 inherited failures; 3,387 tests passed, 2 inherited failures, 4 intentional skips. Wall time: 4,853.39 s (80m53s). The dashboard regression passed 2/2 on this head. The full per-file native JSON and pass/fail inventory are retained with the task evidence.
The changed-file gate ran to completion in 1,015.67 s. Its other 28 phases passed; only the global export scan failed. Every failure below reproduces on pinned baseline
2777468d26e5f21455b67591a045a40c770aee13, installed from its frozen lockfile on the same lease:node scripts/check-changed.mjs --base 2777468d26e5f21455b67591a045a40c770aee13PluginHookChannelPairingContext,PluginHookChannelPairingRequestedEvent,PluginHookRunStoppedContext; full-tree: the two pairing typesnode --import tsx scripts/check-deadcode-exports.mts; exit 1, 141.88 sui/src/e2e/chat-outbox-migration.e2e.test.tsextensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.tsEach e2e control ran separately through
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts <file> --maxWorkers=1. No assertions, permissions, or timeouts were relaxed. The four default skips are mobile deferred steering, opt-in live DeepSeek, the configured desktop worker carrier, and creator-review authority. These are recorded as gaps, not passing proof.The on-lease UI base-budget comparison and packaged build passed. Exact-head CI 41420865844 completed successfully: 42 successful checks, 24 intentional skips, including the corrected unit shard and
control-ui-performance. No performance budget was raised or waived. No CI rerun/update-branch was used to chase green. Independent local autoreview is clean through P2 for the candidate and test-only repair. The accepted native A/B and A/A remain the performance evidence; the canonical live-capped script was not run at the prior stop, and no new timings are claimed for the rebase.All owned leases are released and all test Gateways have stopped; no local Gateway was started. This PR is ready for lead review and remains unmerged. The standing hello secondary still fails as documented above; its explicit lead exception is the only performance-gate deviation claimed.
Runtime delta remains +39 LOC, required for the shared warm-only grace and independent nested preparation without a route barrier. Tooling is reduced from +219 to +99 net LOC by removing 120 lines of one-off fetch/message/iframe/presentation timeline and detailed layout-shift source collection. The proof command retains the gate metrics and synthetic peer heartbeat fix; sibling metrics on main are preserved. Final prescribed production delta is +140 LOC (+39 runtime, +99 tooling, +2 exact allocation-record lines). The regression's test-line allocation is exactly +36, covering independent cached layout/transcript readiness, warm grace/no flash, cold immediate feedback, and fixed placeholder geometry, after deleting the obsolete loader-owned presentation test harness; no slack or changelog edit.
Release-note context: fewer dashboard loading flashes while cached layout and transcript remain independently available.
All table deltas are candidate minus baseline; negative is earlier/lower. Distribution cells show median [Q1, Q3]. Times are milliseconds, shimmer exposure is node·ms, and CLS is dimensionless.
All A/B metrics and per-pair deltas
chat
dashboard
Matched A/A metrics and per-pair deltas
chat
dashboard