Skip to content

perf(control-ui): remove extra cold-load placeholder stages - #170358

Merged
steipete merged 2 commits into
mainfrom
steipete/coldload-visual-load-steps
Oct 12, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/coldload-visual-load-steps

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A signed-in dashboard deep-link reload can have cached sidebar data ready while its roster renderer is still loading. Inline widgets also add a late shimmer after their space has already been reserved. Both add avoidable presentation stages. Earlier campaign evidence recorded 14 states over about 15 seconds for a signed-in reload of a dashboard deep link.

User Impact

Reloads paint the cached grouped sidebar with the shell, and inline widgets fill their reserved space directly. Slow or failed document loads retain their existing notices.

Why This Change Was Made

The roster renderer now loads with its sidebar owner. Its nullable renderer, deferred import controller, restore-time load, empty-render guards and follow-up repaint are deleted. Inline widgets keep their reserved empty space and accessible loading status until their document arrives; delayed connection and error notices remain. The boot manifest is regenerated.

The first CI run exposed a focus ordering issue after eager roster paint: the filter popover's late initial-focus callback could close an already-open Sort submenu. The popover now preserves focus already inside its panel. Its focused regression fails against the old handler and passes after the fix.

Production delta, including the generated manifest and excluding tests/docs: +19 / −26 = −7 lines. No config option, server schema, or browser storage shape changes.

Evidence

Final comparison rebased onto main 0d1e09b79132; candidate 640e401ece0f3da51dd903b665485b24324ac0d7. The refreshed comparison includes the overlay work merged during this lane.

Synthetic Team-scale fixture: 300 sessions, 30 off-page pins, 120 people, six agents/plugins, 240 messages, 12 inline widgets; 35 ms RPC latency, 4 ms frame spacing, 1719×1179 viewport. Production UI builds ran sequentially.

Metric Before After
Visual groups, three runs 5 / 5 / 4 4 / 3 / 3
Median visual groups 5 3
CLS, all three runs 0.001314981 0.001314981
Static JavaScript requests, each run 47 45
Summed gzip sizes of requested JS 1,707,137 bytes 1,705,505 bytes

The analyzer is unchanged: ≥32 RGB change on ≥0.4% of 344×236 sampled pixels, with a new group after a 100 ms gap. Counts include clearing the old document. Host contention makes timings and grouping noisy; no wall-clock speedup or CLS reduction is claimed. The earlier pre-rebase comparison was 4→3 median groups with the same median CLS.

Representative visual groups and attribution
Before Region Cause / classification
269 ms Entire page Old document clears; necessary transition.
1,064 ms Header, transcript, composer, board panel Cached shell and transcript paint; necessary. Sidebar still waits on the avoidable renderer import.
1,170 ms Transcript; header/composer metadata Lazy widget upgrade adds shimmer to already-reserved space; cosmetic and removed. Live metadata also settles.
1,303 ms Sidebar/rail Deferred roster renderer paints cached data; avoidable and removed.
1,517 ms Inline widget and board panel Authenticated document content begins painting; necessary new content.

After: document clear at 299 ms; cached shell, sidebar and metadata at 1,131–1,215 ms; real inline content at 1,515 ms. Small avatar/facepile changes and the later board frame can remain below the aggregate threshold. The group count does not claim that every first-paint pixel is settled.

Validation

Focused tests and affected e2e files run individually with --maxWorkers=1. The sidebar regression fails on the original renderer code. The popover regression fails on the original focus handler.

  • Sidebar row rendering: 9 passed, warm wrapper wall 6.93 s, cold 32.51 s. Final-head CI: 0.657 s test execution, 1.215 s module elapsed.
  • Inline widget view: 33 passed, 11.09 s wrapper wall; first CI run 2.730 s test execution.
  • Popover focus: 2 passed; warm wrapper wall 6.10 s; final-rebase run 29.33 s including cold preparation. Final-head CI: 0.143 s test execution, 0.254 s module elapsed.
  • Full sidebar roster: 148 passed, 49.49 s wrapper wall on the final rebase.
  • Real-browser filter controls: 14 passed, 19.03 s wrapper time on the rebased head.
  • Final-head e2e, one file at a time: sidebar cold load 2 passed / 59.85 s wall; dashboard cold load 2 passed / 52.16 s; Team-scale cold load 1 passed / 33.42 s; boot module boundaries 15 passed / 198.82 s (185.52 s Vitest duration). The boundary file builds and exercises real lazy-module entry points; the other files cover the visible reload flow.
  • Production builds, generated boot manifest, formatting and diff checks pass. Three isolated Codex autoreviews are scoped-clean at P0–P2.
  • Exact-head CI: completed on 640e401ece0f3da51dd903b665485b24324ac0d7. All selected checks pass except checks-ui-e2e (2/9) and its aggregate gate. The initial PR-context template issue was corrected.
Inherited e2e failure: independently reproduced on main UI

Failing job: three cases in new-session-page.cloud-startup-failure.e2e.test.ts. Two disconnected-startup cases expect the unresolved-message notice but see the ordinary outbox count. The cold-scope case expects a recovery notice but receives null. The shard otherwise passes 88 files / 384 tests.

A local replay with all four lane production changes removed reproduces exactly those same three failures, with the other five cases passing: 78.59 s wrapper wall, 72.19 s Vitest duration. The tested UI source matches current main 6315f8adc18ab275a4c933c497113a65bc3f783b; no UI files changed between the PR base and that main revision. The lane source was restored afterward. No CI rerun was requested. These recovery failures are outside the visual-load change.

Commands use node scripts/run-vitest.mjs <file> --maxWorkers=1, equivalent to the focused pnpm test <file> --maxWorkers=1 invocation; e2e uses test/vitest/vitest.ui-e2e.config.ts.

No Testbox lease/ID: remote capacity is blocked. The full UI suite is waived by campaign policy; selected CI shards and focused local files provide the landing proof. No Gateway or real account was used. Captures below are inspected synthetic fixtures only.

Remaining work for the lead: combine with L20 and measure smaller metadata/avatar and embedded-document stages separately.

rebased-before-filmstrip

rebased-after-filmstrip

@clawsweeper

clawsweeper Bot commented Oct 12, 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR renders the cached grouped sidebar eagerly, removes an intermediate inline-widget shimmer, and preserves focus already chosen inside the filter panel.

Example: Reload a dashboard with a cached grouped sidebar and 12 inline widgets.

  • Before: The sidebar waits for a renderer import, and reserved widget space briefly shows a shimmer.
  • After: The cached sidebar appears with the shell, and widget content fills the reserved empty space.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused simplification with directly inspected browser proof, meaningful regression coverage, and no identified defect; pending CI remains a landing gate.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected refreshed before/after browser filmstrips exercise production Control UI builds with a synthetic Team-scale Gateway fixture and show the cached sidebar painting with the shell and inline content replacing empty reserved space without the intermediate shimmer.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Dashboard reloads pass through avoidable empty-sidebar and widget-shimmer stages.
Reason: The established area owner proposes a small simplification supported by inspected visual evidence and focused regressions.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR makes a focused, visually demonstrated improvement that current main lacks, with no actionable correctness or security findings; CI remains in progress.

Priority: P3
Reviewed head: 640e401ece0f3da51dd903b665485b24324ac0d7

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI combines cached sidebar projections and asynchronous Gateway document responses into navigation rows and sandboxed inline widgets.

flowchart TD
  A[Dashboard reload] --> B[Sidebar snapshot owner]
  B --> C[Sidebar and roster renderer]
  A --> D[Reserved widget space]
  E[Gateway document response] --> F[Canvas widget view]
  D --> F
  F --> G[Sandboxed widget content]
Loading

Technical review

Best possible solution:

Land the focused presentation simplification after the normal repository gates pass.

Do we have a high-confidence way to reproduce the issue?

Current-main source exposes both intermediate stages, and the inspected baseline filmstrip illustrates them; no target code was executed during this review.

Is this the best way to solve the issue?

Removing the deferred renderer at its existing owner and preserving widget geometry directly addresses the extra stages with less production code and no parallel implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6315f8adc18a.

Provenance checked

  • Deferred roster rendering changes intended behavior with a stated reason (8c2996e: Keep optional grouped rendering out of startup to protect the JavaScript budget.)
  • Cached sidebar settlement keeps the original intent (561d92d: Paint a settled cached projection and hand off to admitted live state.)
  • Widget loading presentation changes intended behavior with a stated reason (91fd61d: Preserve existing widget behavior during the Solid migration.)
  • Reserved widget geometry keeps the original intent (5a5a608: Retain measured widget space across lazy registration and document loading.)
  • Filter-panel initial focus keeps the original intent (5bc7904: Place initial focus in the filter panel after its controls render.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source -7, Tests +73. Total +66 across 6 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 4 19 26 -7
Tests 2 73 0 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 92 26 +66

Review metrics

Metric Value Why it matters
Production versus test LOC Production +19/−26; tests +73 The production change removes deferred-loading machinery; added tests protect first-update cached rendering and focus placement without introducing production test seams.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This removes brief presentation flicker while preserving functionality, stored settings, geometry, and access.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-12T22:55:38.463Z sha 576c8f4ca48e9a82885f708ca7e3719db68de5a6 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 7:23 PM ET / 23:23 UTC (Revision 2).

Paint cached agent rosters with the sidebar module and keep reserved inline widget space unchanged until its document arrives. Remove the deferred roster loader and transient widget shimmer.
@steipete
steipete force-pushed the steipete/coldload-visual-load-steps branch from 576c8f4 to 640e401 Compare October 12, 2026 23:12
@steipete
steipete merged commit 96db2f6 into main Oct 12, 2026
116 of 120 checks passed
@steipete
steipete deleted the steipete/coldload-visual-load-steps branch October 12, 2026 23:32
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…#170358)

Team-scale fixture: median visual change groups 5->3, CLS unchanged, boot JS requests 47->45, production -7 LOC.
The agent roster renderer ships with the sidebar instead of an idle import (no empty-sidebar stage), canvas widget placeholders keep their reserved box without the shimmer skeleton, and the session filter popover no longer steals focus on late repositioning.

Admin-merged over an inherited UI e2e failure: new-session-page.cloud-startup-failure.e2e.test.ts reproduces on main's UI source (evidence in the PR body). Full UI suite waived while remote capacity is blocked; 20 affected e2e tests pass locally.
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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