Skip to content

perf(control-ui): retain loading panels and skip unchanged metadata writes - #174392

Merged
steipete merged 1 commit into
mainfrom
steipete/coldload-remaining-dom-churn
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/coldload-remaining-dom-churn

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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; candidate e0483b98195afe80036c34b384d7f7854779c919. Both bundles use the same build identity for the controlled comparison.

Metric Baseline median (IQR) Candidate median (IQR)
LoAF blocking 633 ms (30.5) 433 ms (40)
Total LoAF duration 1,873 ms (49.5) 1,529 ms (57.5)
Longest frame 326 ms (6) 214 ms (6.5)
First contentful paint 600 ms (0) 484 ms (8)
First transcript paint 502.3 ms (4) 429.9 ms (16.15)
DOM mutation records 4,958 (157.5) 4,353 (163.5)
Timestamp datetime writes 400 (10) 0 (0)
Details title writes 101 (0.5) 0 (0)
Skeleton child-list activity 143 (4) 15 (0)
RPCs 82 (0) 82 (0)

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:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts

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.ts and workboard-native-bundle.e2e.test.ts both 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 snapshot e53640f0c216461fb981fe492d975f3e1932a723; it is unrelated to this rendering change. No permissions or security checks were weakened.

Remote node scripts/check-changed.mjs passed 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 baseline 0dc31f5f64309d199f12aea643452bfde54f4888. The max-lines failures are in chat-message.test.tsx, config-page-state.ts, and sessions-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:

CI check Failure Baseline / main snapshot
check-guards Duplicate-scan target coverage omits cli-parent-lifetime.mjs Baseline fails; main snapshot passes
checks-fast-baseline-ratchets doctor-plugin-source-captures.test.ts:32 mock of darwin-bun-process-census.js Baseline fails identically; main snapshot passes

The 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):

Before

After

Release-note context: Control UI reloads retain loading-panel DOM and avoid rewriting unchanged transcript metadata and Details values.

@clawsweeper

clawsweeper Bot commented Oct 16, 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@steipete steipete changed the title experiment(control-ui): retain unchanged pane DOM [do not merge] perf(control-ui): retain loading panels and skip unchanged metadata writes Oct 16, 2026
@steipete
steipete marked this pull request as ready for review October 16, 2026 16:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T16:21:49.894448Z e0483b9 Draft marked ready
ℹ️ 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

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

  • Before: Layout fitting clones the panel objects, causing the loading skeleton to remount.
  • After: The same panel and skeleton nodes survive while the sidebar width updates to 382 px.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported optimization with paired production-browser measurements and meaningful regression coverage; required CI remains unresolved without an attributable patch defect.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body records exact-head production-Chromium reload measurements through the browser UI against the synthetic Gateway fixture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Dashboard reloads spend avoidable main-thread time rebuilding loading panels and rewriting unchanged chat metadata.
Reason: The maintainer-approved direction has measured browser benefit and preserves existing output, controls, and ownership.

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
Reviewed head: e0483b98195afe80036c34b384d7f7854779c919

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported reload benchmark excludes transcript images and leaves the model picker closed, so it supplies no independent performance measurement for those bindings.
Agent review details

How this fits together

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

Technical review

Best 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

  • Loading-panel identity keeps the original intent (refactor(ui): retire chat pane Lit template interop #174068: The Solid cutover preserved lazy loading and retained pane identity while removing Lit interop.)
  • Timestamp and provider-auth presentation keeps the original intent (07384e0: The composer and transcript migrations retained existing presentation and callbacks under Solid; this PR adds equality boundaries without changing displayed values.)
  • Details workspace privacy keeps the original intent (869029b: Details deliberately shows a workspace label or final directory name while keeping the complete path behind Copy path.)
  • Retained image presentation keeps the original intent (refactor(ui): own message image presentation with Solid #173832: The existing Solid presentation owner retains decoded previews and synchronous handoff retirement; initialization and equality checks preserve that custody.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduction diff changes presentation identity and equality boundaries, with no configuration, persistence, transport, dependency, or authorization changes. (ui/src/pages/chat/chat-pane-sidebar-view.tsx:96, e0483b98195a)
  • Root cause and regression coverage: fitSidebarLayout uses structuredClone; the new component test checks retained panel, skeleton, and content identity while verifying changed geometry. The timestamp regression checks that usage updates remain visible without attribute mutations. (ui/src/pages/chat/sidebar-layout-geometry.ts:54, e0483b98195a)
  • Current main still needs the change: The five production modules are unchanged between the introduction base and fetched main, so the inspected main retains the original object-keyed fallback and repeated attribute writes. (7465273024dd)
  • Reported production-browser measurement: The body records seven interleaved production-Chromium baseline/candidate pairs: median blocking falls from 633 ms to 433 ms, timestamp datetime writes from 400 to zero, and Details title writes from 101 to zero; RPC count remains 82. (scripts/bench-control-ui-cold-load.md:7, e0483b98195a)
  • Required CI remains unresolved: The exact-head run reports check-guards failing its duplicate check, checks-fast-baseline-ratchets failing mock exports and reporting unrelated baseline paths, and the aggregate gate failing. The annotations do not establish a diff-caused defect; job-log retrieval was blocked at productionresultssa19.blob.core.windows.net by the host allowlist. (e0483b98195a)
  • Media inspection limitation: Both prepared attachment downloads failed with HTTP 404; browser fallback returned Cache miss for both URLs, so their settled-layout appearance could not be independently inspected. (e0483b98195a)

PR surface

Source +15, Tests +79. Total +94 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 57 42 +15
Tests 2 80 1 +79
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 137 43 +94

Review metrics

Metric Value Why it matters
Production versus test growth Production +15 LOC; tests +79 LOC The production growth supplies equality boundaries and one-time image initialization; the tests protect observable DOM retention and metadata updates.

Labels

Label changes:

  • add P2: Measured reload overhead improves materially, with a bounded presentation-only scope and no demonstrated broken user workflow.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Measured reload overhead improves materially, with a bounded presentation-only scope and no demonstrated broken user workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 16, 2026, 12:37 PM ET / 16:37 UTC.

@steipete
steipete merged commit cb9316d into main Oct 16, 2026
168 of 172 checks passed
@steipete
steipete deleted the steipete/coldload-remaining-dom-churn branch October 16, 2026 18:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…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.
steipete added a commit that referenced this pull request Oct 17, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…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.
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant