Repository navigation
perf(ui): load sidebar Pages and Roster on demand - #181497
Conversation
Load optional plugin icon ownership and fetching on first tool-icon request while preserving synchronous fallback and binding cleanup.
Keep the flow projection, route retirement, and draft error/reopen controls eager. Load the complete native modal and its dialog-only styles only for an accepted review, preserving owner-side review and publication behavior.
Load the Roster and Pages renderers on selection while retaining the sidebar shell, state owners, and focused controls across updates. Keep visible loading and retry feedback local to the optional region. Source checkpoint; transfer and timing measurements remain pending.
Keep the sole page-entry renderer with its Pages caller and remove the eager export. Rendering behavior is unchanged; transfer and timing measurements remain pending.
Keep Details, Diff, Files, Side chat, Terminal, and Config rendering copy with existing lazy consumers. Retain shared labels eagerly and preserve canonical English ordering and namespace identity.
Load quota rows and cost details only when the context popover opens. Keep its trigger, visibility, native overlay, and refresh identity in the existing eager owner.
|
🦞👀 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2f944ee0d
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs changes before merge. What this changesThis PR defers optional sidebar views, chat popup content, image helpers, and panel English until their consumers need them. Example: Open the Sample project chat, then open its context-usage popup.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 4 items remain Keep this useful, maintainer-directed performance PR open; sidebar recovery and incomplete test migration need repair before approval. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI consumes Gateway snapshots and user interactions, retains existing domain owners, and loads optional renderers and English catalogs before presenting their content. flowchart LR
A[Gateway snapshots] --> B[Existing UI owners]
B --> C[Retained sidebar and chat shell]
D[User selection or interaction] --> E[Lazy feature import]
E --> F[Feature renderer and English catalog]
B --> F
F --> C
Technical reviewBest possible solution: Keep the existing owners and retained UI, reuse guarded stale-chunk recovery, and complete the affected test cutover. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the eager imports and stale-retry path, while exact-head CI records the affected test failures; no target code was executed. Is this the best way to solve the issue? Deferring leaf renderers and registering unchanged English through the existing catalog owner fits the measured problem without introducing another domain-state owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ceb574b14893. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. 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 23, 2026, 4:49 AM ET / 08:49 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1a883d9e8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0ab6e7f90
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Retire pending stale-chunk reloads with their sidebar error surface and keep the roster metadata fallback available before and after lazy catalog registration. Add focused boundary regressions and refresh the matched boot caps.
|
Merged via squash.
|
* perf(ui): defer chat plugin icon loaders Load optional plugin icon ownership and fetching on first tool-icon request while preserving synchronous fallback and binding cleanup. * perf(ui): defer annotation previews and transcript pins * perf(ui): defer optional English page copy * perf(ui): defer Claw review dialog until ready Keep the flow projection, route retirement, and draft error/reopen controls eager. Load the complete native modal and its dialog-only styles only for an accepted review, preserving owner-side review and publication behavior. * perf(ui): separate image helpers from media loaders * perf(ui): defer optional sidebar views Load the Roster and Pages renderers on selection while retaining the sidebar shell, state owners, and focused controls across updates. Keep visible loading and retry feedback local to the optional region. Source checkpoint; transfer and timing measurements remain pending. * perf(ui): move sidebar page entries into lazy chunk Keep the sole page-entry renderer with its Pages caller and remove the eager export. Rendering behavior is unchanged; transfer and timing measurements remain pending. * perf(ui): defer optional panel English copy Keep Details, Diff, Files, Side chat, Terminal, and Config rendering copy with existing lazy consumers. Retain shared labels eagerly and preserve canonical English ordering and namespace identity. * perf(ui): isolate board grid column constant * perf(ui): defer context usage popover content Load quota rows and cost details only when the context popover opens. Keep its trigger, visibility, native overlay, and refresh identity in the existing eager owner. * build(ui): refresh optional view boot graph * perf(ui): preserve grouped styles and ratchet optional boot budgets * fix(ui): align optional-view tests with lazy readiness * test(ui): await lazy Pages view in navigation rail * fix(ui): recover stale optional sidebar chunks Route the sidebar error action through the shared document recovery owner for stale imports, and preserve in-place retries for ordinary render failures. Cover both visible actions at the sidebar boundary. * perf(ui): narrow optional boot cuts to sidebar views * perf(ui): ratchet deferred sidebar boot budgets * perf(ui): ratchet sidebar boot budgets on current main * fix(ui): retain agent menu focus during lazy catalog loads * perf(ui): refresh sidebar boot proof on current main * perf(ui): refresh sidebar boot proof after main integration * fix(ui): preserve lazy sidebar recovery ownership Retire pending stale-chunk reloads with their sidebar error surface and keep the roster metadata fallback available before and after lazy catalog registration. Add focused boundary regressions and refresh the matched boot caps.
Merged as
e66ae849c4ef7bd19e23e94b98a1ea03c7cde224. Exact-head full CI and paired cold-load timing passed.What Problem This Solves
The default Sessions sidebar imports the Pages catalog and agent Roster renderer even when neither view is selected. Load each renderer at its existing visibility boundary. Keep the fixed rail, shell, authoritative session state, shared styles, and fallback pinned row eager. A local loading/error boundary preserves the shell and uses the existing guarded reload for stale chunks.
Lazy Roster catalog registration exposed a focus regression: reading the Show all translation while computing the agent-menu entries rebuilt that list and replaced a focused settings button. Read that label through a getter in its rendering consumer. The existing browser case proves retained button identity and focus, then exercises the original keyboard and Roster flow.
This refresh retains the merged main graph and its libdeflate11 compressor. It also repairs both public review findings: the Sidebar error component now retires pending document recovery through the existing
canReloadcallback, and the plain roster owner can readagentsHome.loadFailedbefore the lazy renderer loads. That exact fallback remains eager; the lazy registrar merges the remaining labels into the existing namespace so it cannot discard the fallback. Main commits are merged, not replayed.Evidence
Exact comparison base:
df3c47e1931227124fac95b75f69113ffa5e69cb. Final publication head:e57558f98cc663d86bd999a814e7f56475cd476e.pnpm deadcode:knippassed, exit0, 34.4 s3268c6bd43a, including UI E2E and real-Gateway. Prior-head evidence onlye57558f9: completed successfully; 59 successful and 24 conditionally skipped jobs, zero failuresBoth matched builds use Node 24.22.1 and each root's Vite config with main's
libdeflate0.1.0 at level 11. They use identical fixed metadata and 29 pinned plugin artifacts (payload SHA-256868a02463bbca5b0a2b162b1c33a8b7c1f96ead17a843c0a497b5c22ca8a4054). Emitted build-proof files match exactly, SHA-256251177383f50c4780616b7d8cafd63c765f9f842ed646f64b019d61bf62f190f. These totals isolate the Sidebar change on current main; the compressor improvement already belongs to main.Startup CSS stays at 40,195 B / one request. Chat CSS falls by 20 B and New Session CSS by 321 B. The Chat/New caps decrease from 1,369,914 / 819,711 B to 1,366,403 / 807,612 B, using
ceil(main cap × candidate / matched base)to preserve relative headroom. The startup baseline stays unchanged. Strict checking reports zero violations; largest CSS has 3,593 B of hard-ceiling headroom. This is a focused improvement, not a claim that this PR alone reaches the overall 15%/10% campaign target.Exact-head timing uses an isolated real Gateway, 240 synthetic messages, a fresh browser and cold HTTP cache per sample, actual gzip/hash verification, and no trace. Ten interleaved df3c/e575 pairs (20 cold samples) pass the acceptance rule: transcript-visible and enabled-composer median regression each ≤5%, with neither p95 worse. These are the current-head measurements; prior-head timing is not credited.
The cold browser loads 54 → 53 application JavaScript requests and 1,366,715 → 1,363,401 compressed JavaScript bytes. Runtime request totals include everything actually fetched in this synthetic flow; the static boot-graph table above uses the canonical surface manifest. The candidate source, independent-repository package, original harness, and 29 plugin artifacts were verified before accepting the run. The independent verifier checked 1,070 served-asset receipts with zero warnings. The native artifact collector timed out after all 20 samples; recovery downloaded the existing small archive from the same job ID without rebuilding or rerunning a sample. Archive SHA-256:
4675a8879ef0862ce1e7fd77c88a5ee6e18fac7936eee11a0e9a90c9e506c0ce. Source identity and 4,255 raw/gzip asset pairs remained unchanged through recovery.The transcript range was 1,642.00–3,777.30 ms on base and 1,550.10–3,695.80 ms on candidate; the composer range was 756.30–1,863.50 ms and 794.00–1,542.20 ms, respectively.
Production LOC across all changed production files: 4,837 → 4,938 (+101); tests: 2,281 → 2,489 (+208); tooling/config: 922 → 924; generated manifest: 1,878 → 1,874. The review repair itself adds 11 production lines and 62 test lines over the previous head. The production increase provides the local loading/error boundary and explicit lazy exports; the old eager Pages renderer and pinned-row helper are removed. Effects remain 1 → 1, lazy declarations 1 → 4, with no new untrack, manual listener, DOM-query, flush, owner-API or direct
onCleanupcalls. The repair adds one component-ownedonSettledteardown for the error surface.Inspected Synthetic Screenshots
Retained proof from the prior matched 538ef/3268 production builds: all six PNGs were inspected and byte-identical within each before/after pair and to the existing uploaded captures. The repair preserves the same rendered markup, classes, labels and styles; these URLs remain as prior visual evidence without a duplicate upload. This is visual evidence for the Sidebar change, not a fresh df3c/current-head capture. Exact-head full CI passed for the merged graph.
Top-30 Module Attribution
Source:
sidebar-repair-performance.json; SHA-256575faa08a83182af7bcb623c9b88affa91c7bd4621dfb90aa3967a1179a70658. The existing attribution tool gzips each emitted source-map range separately with its canonical Pako settings. These non-additive sizes identify large modules; the boot totals above are actual shipped libdeflate11 sidecars, not a sum of these rows.Chat
ui/src/i18n/locales/en.tsnode_modules/markdown-it/dist/markdown-it.mjsnode_modules/entities/dist/generated/decode-data-html.jsnode_modules/dompurify/dist/purify.es.mjsui/src/i18n/locales/en-chat-session.tsnode_modules/@solidjs/web/dist/web.jsnode_modules/@tanstack/virtual-core/dist/esm/index.jsui/src/i18n/locales/en-chat-composer.tsnode_modules/@solidjs/signals/dist/prod/store/store.jsui/src/lib/chat/composer-draft-store.runtime.tsnode_modules/remend/dist/index.jsui/src/pages/chat/chat-pane-render.tsui/src/i18n/locales/en-session-organization.tsui/src/pages/chat/components/chat-composer-view.tsxui/src/app/app-root.tsxui/src/app/app-shell-view.tsxui/src/pages/chat/chat-pane-sidebar-view.tsxui/src/components/icon-data.tsnode_modules/@openclaw/uirouter/dist/index.jsui/src/components/select-picker-view.tsxui/src/pages/chat/chat-pane-header.tsui/src/components/icon-data-tools.tsui/src/pages/chat/components/chat-composer-controls.tsxui/src/pages/chat/chat-view.tsxui/src/pages/chat/components/chat-transcript-projection.tsui/src/pages/chat/chat-pane-lifecycle.tsui/src/pages/chat/chat-pane-layout-render.tssrc/logging/redact-patterns.tsui/src/pages/chat/chat-state-page.tsui/src/components/app-sidebar-render.tsxNew Session
ui/src/i18n/locales/en.tsnode_modules/@solidjs/web/dist/web.jsui/src/i18n/locales/en-chat-composer.tsnode_modules/@solidjs/signals/dist/prod/store/store.jsui/src/lib/chat/composer-draft-store.runtime.tsui/src/app/app-root.tsxui/src/app/app-shell-view.tsxui/src/components/icon-data.tsnode_modules/@openclaw/uirouter/dist/index.jsui/src/components/select-picker-view.tsxui/src/components/icon-data-tools.tsui/src/pages/chat/components/chat-composer-controls.tsxui/src/pages/new-session/composer.tsxui/src/i18n/locales/en-new-session-setup.tssrc/logging/redact-patterns.tsui/src/pages/new-session/new-session-page.tsxui/src/components/app-sidebar-render.tsxui/src/components/app-sidebar-session-row-render.tsxui/src/api/gateway.tspackages/gateway-protocol/src/session-agent-status.tsui/src/components/solid/session-presentation.tsxui/src/components/app-sidebar-owner.tsxui/src/lib/sessions/index.tsui/src/pages/new-session/draft-submission-flow.tsui/src/app/bootstrap.tsui/src/app/gateway-store.tsui/src/app/app-shell-chrome.tsui/src/components/app-sidebar-session-navigation.tsui/src/components/solid/shadow-styles.tsui/src/components/sidebar-attention-store.tsEarlier Candidate and CI History
The earlier broader optional-UI candidate
b0841b56was rejected after 20 interleaved pairs because both p95 gates regressed. Its timing is not credited here. A later Sidebar-only headb1a883d9had a collaborator-scroll CI failure (accepted send, no provider request before deadline); the exact-file local replay passed but did not establish a fix or waiver. After main's scheduler integration, full CI39962774086passed on3268c6bd43a. This exact merged graph passed paired timing and full CI; no failed check was waived.Whole Observed Runtime Attribution
Matched candidate
e57558f98cc663d86bd999a814e7f56475cd476e(tree979e2bb9b419fc88a411617a551f83d6a244da27) against basedf3c47e1931227124fac95b75f69113ffa5e69cb(tree3fd5e845251fb6c2786242d38704824cbe7938ff). All rows derive from the exact retained builds and the original 20 samples. No rebuild or new timing batch.Actual gzip is the verified shipped libdeflate11 sidecar total. Group/module gzip is the existing helper's standalone Pako diagnostic and is non-additive; it cannot be subtracted from transferred bytes. CSS and the seven synthetic plugin scripts (1,953 uncompressed bytes) are outside this application-JavaScript ledger.
The original 98-group taxonomy is preserved for all 1,657 static modules. Each of the 64 newly observed modules has an explicit owner mapping in the JSON. Five natural new leaf groups name the newly present Ed25519 and Croner packages and three lazy English namespaces: Vendor / @noble/ed25519, Vendor / croner, i18n / en-chat-details, i18n / en-github, i18n / en-processes. There is no catch-all group for these modules.
Unmapped bytes include expected generated
index-*.jsandrolldown-runtime-*.js, which have no source map, plus generated ranges in mapped chunks. Their byte buckets and missing-map lists are preserved in every graph. Mapped plus unmapped raw bytes cover the entire observed application graph.Source:
runtime-module-ledger.json, SHA-256cfa00815161f3465c897369977cd56388a8b564667a4b3fe7864dbfc1e41d8b6. The complete ledger retains each module owner, source-map hash, raw-byte bucket, and exact served asset identity; all 1,721 modules occur once in the candidate owner groups below. The A2UI/Canvas group is 17,812 standalone gzip bytes for content widgets and integration; the heavy A2UI renderer is absent.All 100 candidate owner groups, largest standalone gzip first
Content- and connection-driven additions
The extra graph is content/state dependent: this desktop fixture loads the details surface, carries 12 inline widgets, and activates seven plugin descriptors. Its device identity and preference imports also run during connection/reconciliation. A fetched detail group can contain hidden actions; the graph does not prove every control blocks first paint. Highlighters, math engines, and diagram renderers are not present among these 64 additional modules.