Repository navigation
perf(control-ui): retain loading panels and skip unchanged metadata writes - #174392
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 retains loading panels across equivalent layout snapshots and avoids rewriting unchanged presentation attributes. Example: A workspace sidebar is resized from 1400 px to 700 px while loading.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses confirmed DOM churn, and source review found no introduced defect; required CI failures still need attribution. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI chat components consume session, layout, media, and provider-auth projections and render retained browser DOM without changing the authoritative owners. flowchart LR
A[Gateway and session owners] --> B[Chat presentation projections]
B --> C[Scalar value memos]
B --> D[Sidebar panels keyed by ID]
B --> E[Retained image presentation]
C --> F[Browser DOM]
D --> F
E --> F
Technical reviewBest possible solution: Land the focused presentation optimization after the required-check failures receive evidence-backed classification. Do we have a high-confidence way to reproduce the issue? Source establishes that layout fitting clones panel identities and that the original fallback keys those objects; the body also records before/after browser mutation measurements and intended baseline regression failures. Is this the best way to solve the issue? Stable existing panel IDs and scalar equality boundaries address the unnecessary work at its presentation owner without introducing another store, cache, or lifecycle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7465273024dd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +15, Tests +79. Total +94 across 7 files. Added test files: 0. 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 Reviewed October 16, 2026, 12:37 PM ET / 16:37 UTC. |
…penclaw#174392) On a Team board-dashboard reload the chat pane rebuilt its loading-panel skeletons and rewrote unchanged values: message timestamps (datetime/aria-label), Details environment rows, model-picker auth metadata and chat image attributes. Side-panel loading panels are now keyed by panel id so their DOM is retained, derived labels are memoized so equal values don't propagate, and image attributes are written only when they change. Seven interleaved AWS pairs: LoAF blocking 633 -> 433 ms, first transcript paint 502 -> 430 ms, mutations 4,958 -> 4,353. Runtime +15 LOC. Full UI e2e passes apart from a Crabline artifact-permission failure reproduced on main. CI: dup:check (a clone in untouched e2e/qa-lab/runtime/gateway-node-pending-work.e2e.test.ts) and the test-mock-exports ratchet fail on this branch's base and pass on current main; unrelated to this diff. Admin-merged.
…art (#175212) On a cold reload the boot shell's skeleton was replaced by an empty outlet, then a second, different skeleton, then content: live 50 ms sampling on Team r149 showed skeleton at ~167 ms, a blank frame at ~274 ms, a new skeleton at ~379 ms. The router outlet delayed its loading panel by one second while a route's code chunk was still loading with no active route, rendering an empty region in between. The cold-pending delay is removed: while a route module loads on a cold start, the outlet shows its loading panel immediately, so the hand-off from the boot skeleton is continuous. In-app navigation is unchanged (the active route keeps rendering while the next one loads), and loading-panel retention from #174392 stays intact. Seven interleaved AWS c7a.4xlarge pairs: blank hand-off 31.8 -> 0 ms (all pairs); FCP 432 -> 416 ms; median CLS unchanged (0.0378). Runtime -33 LOC. 26 focused tests pass; exact-head CI green; full-UI failures reproduce on main apart from one dictation assertion that passes in isolated and neighbouring-file replays.
…art (openclaw#175212) On a cold reload the boot shell's skeleton was replaced by an empty outlet, then a second, different skeleton, then content: live 50 ms sampling on Team r149 showed skeleton at ~167 ms, a blank frame at ~274 ms, a new skeleton at ~379 ms. The router outlet delayed its loading panel by one second while a route's code chunk was still loading with no active route, rendering an empty region in between. The cold-pending delay is removed: while a route module loads on a cold start, the outlet shows its loading panel immediately, so the hand-off from the boot skeleton is continuous. In-app navigation is unchanged (the active route keeps rendering while the next one loads), and loading-panel retention from openclaw#174392 stays intact. Seven interleaved AWS c7a.4xlarge pairs: blank hand-off 31.8 -> 0 ms (all pairs); FCP 432 -> 416 ms; median CLS unchanged (0.0378). Runtime -33 LOC. 26 focused tests pass; exact-head CI green; full-UI failures reproduce on main apart from one dictation assertion that passes in isolated and neighbouring-file replays.
What Problem This Solves
A signed-in reload of a dashboard deep link still rewrites unchanged timestamp and Details attributes and rebuilds loading panels when an equivalent sidebar layout arrives. These small writes contribute to the remaining main-thread load after the campaign's original 14-state, roughly 15-second reload waterfall.
User Impact
The existing layout and controls stay in place while content loads. On the synthetic Team-scale board-dashboard benchmark, median long-animation-frame blocking falls 32%, first transcript paint improves by 72 ms, and settled appearance stays the same.
Why This Change Was Made
Layout fitting clones panel objects; the loading fallback keyed those objects by identity and therefore remounted them. Key it by the existing panel ID. Narrow timestamp and Details bindings to value-equal scalar memos. Keep provider-auth presentation stable while its values are unchanged, and initialize retained image attributes once while checking mutable values before writing.
Portal accessibility descriptions and head assets already have reuse/deduplication owners; this change leaves them intact. No configuration, server schema, stored server shape, or transport changes.
Runtime source delta: +15 lines (57 added / 42 removed across five production files). The small growth supplies equality boundaries and retains the existing image/panel lifetime contracts; there is no additional state owner. Tests: +79 net lines across two existing files.
Evidence
Seven interleaved baseline/candidate pairs on one quiet AWS c7a.4xlarge, 16 vCPU / 30.6 GiB. Headless repo Playwright Chromium, production bundles,
scripts/bench-control-ui-cold-load.ts --untraced --warm-reload, default Sessions sidebar, 35 ms RPC latency / 4 ms frame gaps, and the campaign LoAF, RPC census, and pane mutation probes. All seven pairs improve blocking.Baseline
0dc31f5f64309d199f12aea643452bfde54f4888; candidatee0483b98195afe80036c34b384d7f7854779c919. Both bundles use the same build identity for the controlled comparison.The pane attribution probe weights a child-list record as 1 + added nodes + removed nodes; it is distinct from the total mutation-record count. CLS remains roughly unchanged: 0.06687 → 0.06719. Head insertion activity remains 236 → 236. The default fixture contains no transcript images and leaves the model picker closed, so this comparison does not establish an independent performance result for image/auth bindings. An initial optional Online-sidebar run failed the benchmark's sidebar-snapshot-saved setup wait; it is excluded from all measurements.
Remote lease:
cbx_982d351de49d; Crabbox setup run. The comparison completed on the retained lease through its supported SSH connection after the excluded setup failure.Focused tests pass: timestamp/owned controls (3), sidebar view (3), image admission (29), model picker (7), Details (8). Both new regressions failed on old code for the intended DOM write/remount. Changed test files took 5.58 s and 6.25 s wall time through the repository test wrapper with
--maxWorkers=1. Independent autoreview is clean through P2.Final validation
Full native UI E2E ran on the same AWS lease at the exact candidate head:
The initial run completed 814 files / 3,534 tests in 92m55s: 810 files passed, three failed, and one skipped. Two file setup failures were caused by WebKit missing from the lease. After installing WebKit, only those files were rerun with
--maxWorkers=1:tooltip-first-activation.e2e.test.tsandworkboard-native-bundle.e2e.test.tsboth passed (four Chromium/WebKit tests, 31.53s). Combined result: 812 files passed, one failed, one skipped; 3,532 tests passed, one failed, one skipped. Touched-area metadata, model-picker, retained-panel, Details-scroll, image-remount, and dashboard cold-load coverage passed.The remaining failure is
control-ui-automation-management.real-gateway.e2e.test.ts, in the Telegram-created-job case:Private mutation boundary is writable by another POSIX principal.It occurs in Crabline artifact publication before Gateway startup/browser navigation. The same selected test fails at the same boundary on independently installed main snapshote53640f0c216461fb981fe492d975f3e1932a723; it is unrelated to this rendering change. No permissions or security checks were weakened.Remote
node scripts/check-changed.mjspassed changed-file formatting/lint, UI typecheck, and all selected typecheck graphs. Its unrelated max-lines, mock-export, duplicate-coverage, and dead-export guards failed. All four also fail on the exact baseline0dc31f5f64309d199f12aea643452bfde54f4888. The max-lines failures are inchat-message.test.tsx,config-page-state.ts, andsessions-page-state.ts; dead exports include the existing agent-bundle, GitHub-identity, and Discord preflight/process owners. The main snapshot still fails max-lines and has separate dead-export findings.Exact-head CI is complete for
e0483b98195afe80036c34b384d7f7854779c919. Selected UI tests, selected UI E2E, performance, lint, and typechecks passed. The remaining red checks are inherited and reproduced on the exact baseline:cli-parent-lifetime.mjsdoctor-plugin-source-captures.test.ts:32mock ofdarwin-bun-process-census.jsThe aggregate CI gate is red because of those checks. Their failed logs were fetched once; no CI reruns or unrelated repairs were made. The PR remains ready and unmerged for campaign-lead review.
Inspected synthetic-only before/after captures (settled layout):
Release-note context: Control UI reloads retain loading-panel DOM and avoid rewriting unchanged transcript metadata and Details values.