Skip to content

perf(ui): defer New Session picker bodies and obsolete preload code - #180852

Merged
steipete merged 28 commits into
mainfrom
solid2/w-perf-chat-boot-2
Oct 22, 2026
Merged

steipete merged 28 commits into
mainfrom
solid2/w-perf-chat-boot-2

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

New Session loaded the closed Where, Project, and Checkout menu bodies before its composer was usable. The generated boot capture also promoted an idle pet decoration into the New Session preload. Startup additionally included Vite's modulepreload compatibility probe despite every documented supported browser implementing native modulepreload.

User Impact

New Session transfers less code before its composer is usable. Picker labels, search, focus, and retained content remain unchanged; the detailed picker content loads on first open.

Why This Change Was Made

Keep the existing state owners, tags, classes, visible triggers, and routes. Load each New Session picker body on first open and retain it across closes. Preserve Where search autofocus after its first import; Project and Checkout preserve their existing trigger focus. Keep the pet's existing idle loader. Share the picker error boundary; its Reload action uses the existing guarded recovery owner for stale chunks, checks that the picker remains open, and retains ordinary retry for other errors. Disable only the modulepreload polyfill; retain native preload links, dependency hints, and Vite's CSS waits. Safari 26.2+, Chrome 147+, and Firefox 150+ are the documented browser floor.

Conflict integration (66ac6866a2d): main now owns bundle identity switching in the existing comparison helper; this PR retains that implementation and adds only cold-load comparison, readiness sampling, host-load recording, and compact timed-run output. The benchmark scripts typecheck after the merge.

The performance checker now reports emitted, source-mapped module gzip attribution. The existing reload benchmark alternates production bundles using their actual embedded build identities and records visible transcript/composer readiness. Full diagnostic records are written after the timed run, rather than serialized twice by the preview-server process. Its pinned-session setup now uses the existing pinned sidebar section rather than an obsolete rail selector.

Evidence

The final integration merges da8b252a70aca34d141bf26ae7c550095a143b72 without replaying main. A stale side-effect import in chat-pasted-text.ts pulled its optional renderer into boot; the renderer has no registration side effect, and its actual consumers already import it. Removing that import keeps the picker savings without adding Chat bytes. All six pasted-text component tests and the UI typecheck pass; the final P0–P2 independent review is clean.

Both builds use the same Node 26.12.1/Vite 8.3.4/Pako 3.0.2 toolchain, fixed embedded build identity, and all 29 byte-identical consumed packaged-plugin artifacts across seven plugins. An unmatched initial base omitted extra packaged plugins and was rejected as comparison evidence.

Surface Matched base gzip / requests Integrated candidate gzip / requests Change
Startup 316,202 B / 7 316,040 B / 7 −162 B
Chat boot 1,416,831 B / 24 1,414,864 B / 24 −1,967 B
New Session boot 953,052 B / 18 915,265 B / 18 −37,787 B

The strict matched-base performance check has no violations or warnings. Chat's cap ratchets to 1,469,628 B with the same relative headroom; New Session retains its already-stricter 929,032 B cap. The existing stricter startup baseline remains unchanged. The approved timing below remains the checkpoint's ten-pair evidence; this integration adds no renderer behavior change. Fresh full CI is required on the integrated head.

Production Knip was run on the final head and pinned base. Both report the identical unused exports MAX_PLUGIN_COMMAND_SCHEDULE_BYTES, createGatewayCronAgentJobRunner, and the four approval-presentation functions, plus types XRefreshClaim, SessionCleanupSummary, and ScheduledOccurrenceRun; the base has additional unused dependencies and PluginHookReplyDispatchResult. This PR introduces no new Knip finding. No ignores were added.

Current complete-file LOC versus the pinned base: production UI 1,625 → 1,768; tests/support 3,038 → 3,288; measurement/tooling/docs 4,263 → 4,493; generated config 1,966 → 1,941. The small production increase is the shared retry/loading boundary and retained focus handoff around moved picker bodies. Refactor checklist: effect, untrack, direct listener, query, owner APIs and component cleanup remain zero; onSettled 2 → 4 and lazy 0 → 3.

Exact-head full CI run 39869745484 is complete. All jobs pass except the inherited Native plugin UI ownership > loads without asset grants for auth:none and preserves canonical chat admission and view recovery footer expectations and the downstream gate. Its 72 normalized assertion log lines match the latest completed scheduled-main run 39865398397, with no additional failure signature. The entire styles tree and test/support files are unchanged between the CI baseline and tested merge. This uses the native inherited-failure route; failed CI is not relabeled green.

Earlier checkpoint evidence

Same machine, identical packaged-plugin inputs. Baseline c4fd27d76ca; candidate runtime sources 82135bc170d (all 3,056 consumed local input files match byte-for-byte; embedded build commit c4fd27d76ca plus the candidate source overlay).

Surface Base gzip / requests Candidate gzip / requests Change
Startup 315,930 B / 7 315,775 B / 7 −155 B
Chat boot 1,417,315 B / 24 1,417,243 B / 24 −72 B
New Session boot 953,843 B / 19 915,613 B / 18 −38,230 B; −1 request

Strict performance checks pass without violations or warnings. Chat/New Session caps become 1,471,597 B / 928,864 B, preserving each surface's relative headroom over the measured base. The already-stricter startup baseline is retained. All ten packaged-plugin input files match; unrelated extra plugin artifacts in the primary checkout are excluded by using the matched proof checkout.

Local timing remains unqualified. The last ten alternating pairs on updated main measured transcript median 864.1 → 527.5 ms, p95 3,128.4 → 5,532.1 ms; one-minute host load reached 27.4. The pre-integration candidate 82135bc170d was measured once on Blacksmith Testbox, allocated in 4.0 s without queueing: 4 available CPUs, 16 GB RAM, initial load 0.73. Across ten alternating cold-cache pairs, transcript median 572.65 → 593.40 ms (+3.62%), p95 899.90 → 729.20 ms (−18.97%); composer median 571.50 → 592.10 ms, p95 898.20 → 727.50 ms. The coordinator explicitly accepted this result: No measured rerun was performed. Setup-only attempts corrected the native sync identity check and fetched the missing exact base; all 26 changed source files were verified by hash before building.

“I accept the timing result as coordinator. A +3.62% transcript median over ten cold-cache pairs, with p95 −18.97%, is within noise for n=10 and inside the performance skill's 20% rule. My order's ‘no regression’ meant no real regression, not zero movement at n=10.”

Acceptance: no startup growth beyond the 64 B build-variance allowance, seven startup requests, reduced New Session transfer, no Chat growth, and no real readiness regression in ten alternating cold-HTTP-cache Chat pairs. The coordinator accepted this checkpoint and set the future rule to median regression ≤5% with p95 no worse, or ten additional pairs bringing the result within that band. The committed 240-message workload uses persisted state per build, no profiler, and records host load. Readiness means visible-DOM animation-frame observation, not a compositor paint timestamp.

Earlier candidates that also deferred optional Chat/Claw content did not satisfy the timing rule. Their measurements are retained as failed experiment evidence; those production and test changes are fully removed. This checkpoint makes no claim to meet the campaign's 15% Chat target. The original top-30 attribution below identifies the remaining required Markdown/runtime/composer costs and the New Session imports removed by separate focused wins.

Commands: pnpm ui:boot-manifest:gen; pnpm ui:build; pnpm ui:check-performance --module-attribution --base-dist <base> --json; node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts --bundle-dir <base> --compare-bundle-dir <head> --runs 20 --face chat --untraced --cold-http-cache --output <evidence>.

Local proof: shared picker recovery plus Where 20/20; Project/Checkout picker files 30 tests with two focused fixture-wait repairs; performance checker 36/36 and attribution fixture 1/1; production Vite build tests 13/13; UI typecheck, targeted formatting/lint, and production pnpm deadcode:knip pass. Exact-head broad UI unit/E2E/real-Gateway proof runs with ci:full.

The stale-chunk review finding is fixed for all three pickers through the shared boundary and existing manual reload owner. The original CI repair opens the picker before inspecting its lazy content, gives the stylesheet fixture explicit membership, and retains a spy rather than an unbound method. The earlier catalog failure was fixed on main by #180742 and is incorporated. No inherited-failure exception is claimed without matching test-name evidence.

Scoped complete-file LOC: production UI 1,604 → 1,748 (+144); tests/support 2,772 → 3,012 (+240); measurement tooling/config/docs 4,231 → 4,474 (+243); generated manifest 1,972 → 1,951 (−21). Renderer changes mostly move existing bodies. The remaining growth supplies lazy loading/error boundaries, the delayed Where focus handoff, emitted-module attribution, and actual-bundle benchmark identity.

Refactor checklist across touched production UI: effects, untrack, direct listeners, DOM queries, owner APIs, and component cleanup remain 0 → 0; onSettled 2 → 4, lazy 0 → 3. Domain owners remain plain TypeScript; the final integration only removes the stale Chat pasted-text renderer side-effect import.

Inspected synthetic captures preserve Where search autofocus and all six Project/Checkout focus checkpoints. Project is pixel-identical; Checkout differs only in glyph rasterization within the same text bounds. These captures use the same New Session renderer source as the final candidate; the later polyfill and Chat rollback do not change their rendering inputs. The original module tables and Chat/Where captures remain below.

Complete Chat graph: all 1,750 modules by feature, first-paint necessity

Every mapped module appears once in these 93 groups. This uses the same measured 82135bc170d runtime-source build as the table above. Standalone gzip is non-additive: group sums are diagnostics, not transfer savings. Source inspection includes the subsequently merged main changes.

Coverage reconciles exactly: 4,336,425 mapped + 78,277 unmapped = 4,414,702 raw JS bytes (98.23% mapped). Independent mapped-module gzip sums to 1,747,025 B, plus 27,569 B for unmapped fragments; chunk dictionaries produce the authoritative 1,417,243 B shipped JS. The small entry and bundler runtime lack source maps. CSS is separate: 146,932 B gzip / 8 requests.

Owning feature Modules Standalone gzip B Needed for first visible transcript/composer?
Shared UI / Sidebar and session navigation 104 141,197 Visible rail, session rows, unread/selection state are first-paint UI. Catalog menus, hovercards and organizer actions are interaction-only.
Vendor / Markdown parsing and repair 74 91,236 Required when first visible messages need Markdown; full emoji catalog and editing autocomplete are not universally needed. This group combines markdown-it, micromark, entities, emoji definitions, remend and related packages.
Chat / Session and route coordination 76 77,979 State, route selection, active run continuity and rendering orchestration are needed before painting the selected session; some notices and secondary controls are conditional.
Chat / Pane composition and lifecycle 42 72,109 Selected pane layout, readiness and disposal are first-paint requirements. The class composition also imports optional pane features.
Shared domain / Sessions 69 68,587 Selected session identity, boot roster and reconciliation are needed immediately; mutations and secondary catalogs are not all required before visible transcript.
Chat / Composer 44 63,078 Textarea, draft, submission affordance and basic keyboard behavior are first-paint. MCP catalogs, emoji/mention menus and capability views depend on content or interaction.
Chat / Message rendering 55 59,018 The visible message bubble/group and sanitization are first-paint for the selected transcript. Tool/plugin/permission branches are content-dependent.
App / Shell, routing and bootstrap 63 58,289 The shell, router and application context own the first usable UI and are also shared with non-Chat routes.
Chat / Transcript and scrolling 50 54,224 Message projection, visible range, virtualizer, anchors and scroll restoration determine which transcript is visible and where.
Shared domain / Core contracts and helpers 115 52,388 This explicitly broad residual group contains command parsing, redaction, retry, URL/network policy, status and shared contracts; modules are listed individually in the ledger.
Vendor / Solid runtime 38 48,819 Reactive graph, DOM rendering and owner disposal are needed by the first shell and Chat render.
Vendor / Zag menus and positioning 68 45,188 State-machine and placement implementation serves shared menus/popovers. Their closed triggers can often paint without full entry/placement work, but several current controls share it.
Media and attachments 57 42,801 Existing visible attachments require their basic preview. Camera capture, file acquisition, lightbox and downloads are interaction-only; media parsers may also serve message normalization.
Shared UI / Overlays and pickers 31 42,032 Trigger labels/tooltips may appear initially; option lists and modal bodies are interaction-only. The existing primitives own focus, dismissal and native occlusion.
Chat / History and loading 29 36,643 Route loader, snapshot and history settlement determine the first transcript, including restored sessions.
Gateway / Protocol and validation 45 33,072 Gateway connection, typed frame parsing, request validation and authority feed the initial session snapshot. Some secondary-method validators are feature-specific.
Chat / Detail panels and workspace 24 31,567 Closed inspector/file/PR/subagent panels are not required for plain transcript paint. A restored visible panel or desktop auto-dock can require its initial view.
Shared domain / Utilities 64 31,145 Formatting, DOM reconciliation, connection helpers and identity utility code support first render; toast, downloads and speech have later effects. This is a named residual utility group with full per-module disclosure.
Chat / Send and outbox 25 30,238 Draft submission and queued/restored pending messages must be usable immediately. Recovery dialogs and explicit retry/discard action views need only load when present.
i18n / en 1 28,448 Common labels and untranslated fallback are first-paint; this base catalog still includes full update, device, debug, settings and other secondary namespaces.
Plugin presentation / MCP apps 33 28,211 A published plugin surface can be visible in initial shell/message/composer. Catalog discovery, resource browse and launch operations are optional for a plain session.
Chat / Header and menus 15 27,150 Session title/status/primary navigation are first-paint; session menu builders, versions and secondary action panels are interaction-only.
Shared UI / Markdown rendering 24 24,922 Required for visible rich transcript content; table/JSON/code copy/details affordances depend on encountered syntax or interaction.
Shared domain / Chat durable state 17 22,722 Restored draft/outbox metadata must survive reload and be available before editing. Export/discard/recovery operations do not all execute at first paint.
Shared domain / Tool presentation 18 22,413 Exec titles, tool-call repairs and argument formatting are needed only for tool-bearing visible messages, though message normalization may invoke shared parts.
Shared UI / Primitives and controls 42 22,272 Icons, loading/error states, shadow styling and basic controls serve first paint; other controls can be consumer-specific.
Shared domain / Chat normalization and commands 28 21,512 Imported transcript normalization and sender/content interpretation are first-paint. Slash command lookup and some editing helpers are interaction-dependent.
Chat / Sharing and annotations 17 20,946 Persisted annotations/reactions may appear initially; export/share dialogs, new comments and selection popups are interaction-only.
Shared domain / Text and session normalization 38 20,940 Visible-text filtering, reasoning/tool-markup stripping and canonical session references define the transcript shown on reload.
Chat / Model and permission controls 13 19,814 Current model/effort/permission label is first-paint. Option rows, searching and provider review are interaction-only or appear on a specific rejection.
App / Platform, updates and background integrations 28 18,253 Native links/auth bootstrap can be required for connection. Push subscription, update detail presentation and some optional platform flows need not block first transcript.
Claw and Workboard 21 18,210 A normal conversation does not need board widget/render actions. Persisted board face or a selected board route can need them immediately.
Chat / Tool cards and streaming 12 17,639 Collapsed tool cards and streaming activity are necessary when visible messages contain tools, but not for text-only transcripts.
Shared domain / Config 15 17,154 The runtime config capability is created at bootstrap and supplies accepted values/reload protection. Editor drafts, schema operations and write coordination are not ordinary text transcript rendering.
Gateway / Client transport 20 16,637 WebSocket connection, pending request correlation, retries and session projection are required for first transcript and ongoing streaming.
Chat / Voice and realtime 13 16,504 Voice sessions, dictation and device selection are inactive for a normal text session. Restored active voice state is a separate first-use condition.
Other routes / Lazy route entry stubs and shared helpers 41 16,142 Route descriptors and matching must know all destinations. Their emitted presence does not imply page bodies are loaded.
App / Gateway connection and authority 17 15,076 Connection snapshots, auth scope, selected gateway and live authority are required for correct initial rendering and actions.
App / Settings and preferences 14 14,886 Restored layout, theme, locale and per-session choices determine the first render. Mutation/reconciliation is also used outside settings pages.
Icons / SVG data and presentation 9 14,804 Icons on visible controls are required, but a combined name-indexed registry includes tool/provider/brand paths unrelated to a plain transcript.
Shared domain / Agent and capability catalogs 16 13,993 Current agent identity and advertised capabilities may be first-paint. Full channel/configuration catalogs need not be presented immediately.
Shared domain / Session presentation 15 13,788 Progress cards, pull requests, presence and display summaries can be visible in sidebar or transcript, depending on session data.
App / Theme and environment presentation 15 13,079 Theme, typography and shell branding must be ready before first paint; delaying them creates visual and geometry changes.
Chat / Sidebar and split layout 9 12,861 Restored split placement and mobile shell affect transcript geometry immediately. Closed side-panel bodies are conditional.
App / Overlay and action owners 10 12,648 Pending approvals or questions can be present on reload; update and confirmation bodies are conditional. Current owners hold live authority.
Boot / Entrypoints and generated glue 11 12,288 Main entry, route paths, navigation and build identity are needed to locate and mount the selected UI.
Vendor / DOM sanitization 1 11,522 Sanitization is required before inserting generated Markdown/HTML from the transcript.
Chat / Questions and goals 9 10,859 A pending interactive question or restored goal can appear with the first visible messages; inactive editing UI is optional.
Diff and terminal presentation 16 8,848 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-chat-session 1 8,807 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared domain / Markdown normalization 10 7,948 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / Transcript virtualization 3 7,517 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared UI / Browser and link preview 7 6,861 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared UI / Mascot 4 6,834 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared UI / Assistant dock 6 6,547 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared domain / Model and account catalogs 8 6,511 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared domain / Reactive projections 24 6,507 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Chat / Browser and source previews 9 6,388 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / @noble/hashes 4 5,943 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / jsonc-parser 6 5,083 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-chat-composer 1 4,909 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-session-organization 1 4,902 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / @openclaw/uirouter 1 4,614 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Shared UI / Identity and activity 7 4,371 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / ipaddr.js 1 3,782 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / typebox 6 2,905 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
A2UI and Canvas surface integration 5 2,790 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-model-controls 1 2,283 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
New Session / Shared entry and launch support 3 2,225 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / runtime 4 2,199 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Vendor / get-east-asian-width 4 2,016 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-command-palette 1 2,009 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-file-preview 1 1,567 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-labs 1 1,518 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-session-placement 1 1,449 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-browser 1 1,411 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-model-accounts 1 1,337 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-sidebar-attention 1 1,247 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-chat-message-metadata 1 1,195 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-mcp 1 1,175 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-mcp-app 1 964 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-board 1 891 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-chat-goals 1 850 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-agents-home 1 846 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-chat-provider-review 1 720 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-new-session-runtime 1 649 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-chat-camera 1 636 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
Highlighting / Lightweight command spans 2 614 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-session-machine 1 551 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-session-skill-library 1 524 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-agents 1 354 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-code-blocks 1 268 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.
i18n / en-session-people 1 157 Below 10,000 B standalone; consult the full module ledger and owning caller before changing it.

All groups above 10 KB were inspected at their owners. The next candidates are optional MCP surfaces, camera capture, workspace actions, closed menus, and unused English namespaces. Xterm, syntax highlighters and language grammars, math/diagram renderers, expanded tool output, detailed diff viewers, and A2UI renderer bodies are already outside this graph; their weight cannot be claimed as a new saving.

Module attribution: top 30 per boot graph, with first-paint necessity

Standalone module gzip is non-additive: each module’s emitted ranges are compressed alone, while actual transfer uses a chunk-wide dictionary. Shipped sidecar totals above are authoritative. Source-map coverage is explicit; missing maps and unmapped bytes remain in the report.

Chat — initial baseline top 30 (082e55e28d3)

Module Standalone gzip B Needed for first transcript/composer?
ui/src/i18n/locales/en.ts 28,531 Visible copy yes; namespace retains some optional copy.
node_modules/markdown-it/dist/markdown-it.mjs 15,910 Yes — safe transcript Markdown rendering.
node_modules/markdown-it-emoji/lib/data/full.mjs 15,197 No — composer/reaction emoji catalog; a follow-up must preserve input behavior.
node_modules/entities/dist/generated/decode-data-html.js 13,139 Yes — safe transcript Markdown rendering.
node_modules/dompurify/dist/purify.es.mjs 11,516 Yes — safe transcript Markdown rendering.
ui/src/i18n/locales/en-chat-session.ts 8,823 Visible copy yes; namespace retains some optional copy.
node_modules/@solidjs/web/dist/web.js 7,368 Yes — visible shell/composer and their state.
ui/src/lib/chat/composer-draft-store.runtime.ts 7,116 Yes — restore composer drafts.
node_modules/@tanstack/virtual-core/dist/esm/index.js 6,877 Yes — visible transcript window.
node_modules/@solidjs/signals/dist/prod/store/store.js 6,570 Yes — visible shell/composer and their state.
node_modules/remend/dist/index.js 5,592 Yes — safe transcript Markdown rendering.
ui/src/pages/chat/chat-pane-render.ts 5,120 Yes — visible shell/composer and their state.
ui/src/pages/chat/components/chat-composer-view.tsx 5,082 Yes — visible shell/composer and their state.
node_modules/@zag-js/vanilla/dist/machine.mjs 5,057 Menu controls share this runtime; body is interaction-only.
ui/src/i18n/locales/en-chat-composer.ts 4,924 Visible copy yes; namespace retains some optional copy.
ui/src/i18n/locales/en-session-organization.ts 4,870 Visible copy yes; namespace retains some optional copy.
ui/src/components/icon-data.ts 4,740 Visible icons yes; full catalog is shared.
ui/src/pages/chat/chat-pane-sidebar-view.tsx 4,721 Layout shell yes; optional panels retain their loaders.
node_modules/@openclaw/uirouter/dist/index.js 4,614 Yes — visible shell/composer and their state.
ui/src/components/select-picker-view.tsx 4,600 Menu controls share this runtime; body is interaction-only.
ui/src/app/app-shell-view.tsx 4,529 Yes — visible shell/composer and their state.
ui/src/components/icon-data-tools.ts 4,512 Visible icons yes; full catalog is shared.
ui/src/app/app-root.tsx 4,505 Yes — visible shell/composer and their state.
ui/src/i18n/locales/en-new-session-setup.ts 4,457 Visible copy yes; namespace retains some optional copy.
node_modules/@zag-js/menu/dist/menu.machine.mjs 4,440 Menu controls share this runtime; body is interaction-only.
ui/src/pages/chat/chat-view.tsx 4,433 Yes — visible shell/composer and their state.
ui/src/pages/chat/components/chat-composer-controls.tsx 4,401 Yes — visible shell/composer and their state.
ui/src/components/app-sidebar-render.tsx 4,372 Yes — visible shell/composer and their state.
ui/src/pages/chat/chat-pane-lifecycle.ts 4,299 Yes — visible shell/composer and their state.
ui/src/pages/chat/components/chat-transcript-projection.ts 4,236 Yes — visible transcript window.

New Session — initial baseline top 30 (082e55e28d3)

Module Standalone gzip B Needed for first transcript/composer?
ui/src/i18n/locales/en.ts 28,531 Visible copy yes; namespace retains some optional copy.
node_modules/markdown-it/dist/markdown-it.mjs 15,910 No for first paint — emoji completion and pending-message normalization; preserve native beforeinput.
node_modules/markdown-it-emoji/lib/data/full.mjs 15,197 No — emoji completion; a later split must preserve native beforeinput.
node_modules/entities/dist/generated/decode-data-html.js 13,139 No for first paint — Markdown dependencies for emoji and pending-message normalization.
ui/src/i18n/locales/en-chat-session.ts 8,823 Visible copy yes; namespace retains some optional copy.
node_modules/@solidjs/web/dist/web.js 7,368 Yes — visible shell/composer and their state.
ui/src/lib/chat/composer-draft-store.runtime.ts 7,116 Yes — restore composer drafts.
node_modules/@solidjs/signals/dist/prod/store/store.js 6,570 Yes — visible shell/composer and their state.
node_modules/@zag-js/vanilla/dist/machine.mjs 5,057 Menu controls share this runtime; body is interaction-only.
ui/src/i18n/locales/en-chat-composer.ts 4,924 Visible copy yes; namespace retains some optional copy.
ui/src/components/icon-data.ts 4,740 Visible icons yes; full catalog is shared.
ui/src/pages/new-session/composer.tsx 4,627 Yes — visible shell/composer and their state.
node_modules/@openclaw/uirouter/dist/index.js 4,614 Yes — visible shell/composer and their state.
ui/src/components/select-picker-view.tsx 4,600 Menu controls share this runtime; body is interaction-only.
ui/src/app/app-shell-view.tsx 4,529 Yes — visible shell/composer and their state.
ui/src/pages/new-session/where-chip.tsx 4,521 Trigger yes; menu body no (deferred here).
ui/src/components/icon-data-tools.ts 4,512 Visible icons yes; full catalog is shared.
ui/src/app/app-root.tsx 4,505 Yes — visible shell/composer and their state.
ui/src/i18n/locales/en-new-session-setup.ts 4,457 Visible copy yes; namespace retains some optional copy.
node_modules/@zag-js/menu/dist/menu.machine.mjs 4,440 Menu controls share this runtime; body is interaction-only.
ui/src/pages/chat/components/chat-composer-controls.tsx 4,401 Yes — visible shell/composer and their state.
ui/src/components/app-sidebar-render.tsx 4,372 Yes — visible shell/composer and their state.
src/logging/redact-patterns.ts 4,134 Yes — error presentation redaction.
ui/src/components/app-sidebar-rail.tsx 4,039 Yes — visible shell/composer and their state.
ui/src/components/app-sidebar-session-row-render.tsx 3,932 Yes — visible shell/composer and their state.
ui/src/api/gateway.ts 3,835 Yes — visible shell/composer and their state.
node_modules/ipaddr.js/lib/ipaddr.js 3,808 Yes — connection URL policy.
ui/src/pages/chat/components/chat-effort-picker.tsx 3,785 Yes — visible shell/composer and their state.
ui/src/app/app-host.tsx 3,730 Yes — visible shell/composer and their state.
ui/src/components/solid/session-presentation.tsx 3,701 Yes — visible shell/composer and their state.

Chat before — synthetic fixture

Chat after — synthetic fixture

Where picker before — synthetic fixture

Where picker after — synthetic fixture

Project picker before — synthetic fixture

Project picker after — synthetic fixture

Checkout picker before — synthetic fixture

Checkout picker after — synthetic fixture

CI repair

Run 39857859975 passed all nine Control UI E2E shards and both real-Gateway shards. Seven unit assertions in target-controls-view.test.tsx and placement-invalidation.test.tsx read closed or unresolved picker content. Updated those fixtures to open the real project picker and await visible content; all authorization, IME, and retained-DOM assertions remain. Both files now pass locally (11/11), UI typechecking passes, and the isolated P0–P2 repair review is clean. This test-only repair does not change the measured production inputs. The other UI unit shard ended without a failing assertion in its available log; the repair push supplies fresh full-CI evidence.

Integrated main proof (7951d38 → 9a931a0)

The merge preserves main’s visible-name-only project search in the lazy body and removes its obsolete cloud menu compact option. UI types and 19 directly affected Project/Where tests pass; final integrated P0–P2 review is scoped-clean. The earlier seven CI unit failures were reproduced and fixed in the tests by opening/waiting for the actual lazy owner before inspecting content.

Same-machine production builds and strict performance comparison:

Surface Current main Integrated head JS requests
Startup 316,392 B 316,213 B 7 → 7
Chat 1,417,983 B 1,417,826 B 24 → 24
New Session 954,162 B 916,086 B 19 → 18

Caps retain main’s relative headroom: Chat 1,471,508 B and New Session 929,032 B. Main’s canonical corrected startup baseline is retained. The original ten alternating timing pairs and the coordinator’s explicit acceptance above remain the runtime timing evidence; this merge changes the existing search contract and removes an obsolete presentation option, without changing the measured lazy boundaries. Exact-head ci:full remains required.

Final formatting repair

Run 39862657859 reported the same formatting difference in target-controls-view.test.tsx through both the lint and documentation jobs. Applied the repository formatter; the resulting change is whitespace and call wrapping only. The focused format check passes, and an isolated P0–P2 review confirmed identical execution order, branches, event payloads, and assertions. Production inputs and the measured bundles are unchanged.

The same CI attempt also found the searchable-combobox ownership guard still pointing to checkout-chip.ts. Updated that single path to its new lazy owner, checkout-picker-content.ts; the approved control set is unchanged. Both focused ownership-guard tests pass.

Keep the New Session placement menu and mobile sharing options behind their first-use boundaries. Preserve idle pet loading instead of promoting it into route preloads. Add emitted-module attribution and compare production reloads using each bundle’s actual build identity. Ratchet the measured boot caps while retaining their relative headroom.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T23:11:58.001161Z a37b614 New commits
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: XL labels Oct 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a9335035e

ℹ️ 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".

Comment thread ui/src/pages/new-session/where-chip.tsx Outdated
Comment on lines +105 to +106
<Errored
fallback={(error, retry) => <LazyViewError error={error()} onRetry={retry} inline />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recover stale picker chunks with a document reload

When a New Session tab survives a Gateway update and the user first opens Where afterward, the newly deferred chunk can reference an old hashed URL and fail to import; this fallback treats that as an ordinary render error and invokes only Solid's retry, so the button retries the cached failed import instead of loading the document that references the new chunk. This is especially visible when an unsaved draft blocks automatic stale-build recovery: the placement picker remains unavailable until the user manually reloads. Detect isStaleChunkImportError here and route Retry through retryStaleChunkReloadWhenReachable, as the mobile lazy boundary does.

AGENTS.md reference: AGENTS.md:L76-L77

Useful? React with 👍 / 👎.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 18:06
@steipete
steipete disabled auto-merge October 22, 2026 18:17
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR defers New Session picker bodies, removes unnecessary preload work, and extends bundle measurement tooling.

Example: Open New Session with Where, Project, and Checkout closed.

  • Before: The reported integrated baseline loads 954,162 gzip bytes across 19 JavaScript requests.
  • After: The candidate loads 916,086 gzip bytes across 18 requests, loading picker bodies when opened.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Measured savings and preserved presentation support the change, but the confirmed ownership-guard failure blocks merge.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied evidence includes production-bundle browser comparisons and inspected picker captures, with stale recovery additionally covered by focused owner-mocked tests.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: New Session downloads closed placement menus before they are needed.
Reason: The maintainer-authored direction removes measured boot transfer while retaining existing state, controls, and recovery owners.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR provides a useful, maintainer-approved loading improvement and fixes the prior stale-chunk finding, but an unmigrated ownership assertion now fails exact-head CI.

Priority: P2
Reviewed head: 9a931a057079a9399f36dfcfa35291b2ecbc1d1e

Before merge

  • Update the combobox ownership assertion for the moved renderer (P2) - Moving WorktreeFields into checkout-picker-content.tsx changes the file discovered by this ownership guard, but its expected list still names checkout-chip.ts. Exact-head checks-ui (2/3) fails with precisely that expected/received difference. Replace this entry with pages/new-session/checkout-picker-content.ts, preserving the guard and its .tsx normalization.

Findings

  • [P2] Update the combobox ownership assertion for the moved renderer — ui/src/components/web-awesome-migration.node.test.ts:64
Agent review details

How this fits together

The Control UI renders placement triggers from existing draft owners, loads menu renderers on interaction, and uses generated boot manifests and build tooling to control initial asset delivery.

flowchart LR
  A[New Session page] --> B[Placement triggers]
  B --> C[Retained lazy popovers]
  C --> D[Picker renderers]
  D --> E[Existing draft owners]
  C --> F[Shared loading and recovery]
  G[Boot manifest and Vite] --> A
Loading

Technical review

Best possible solution:

Retain the lazy boundaries and shared recovery, and migrate the combobox ownership assertion to the moved checkout renderer.

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

Source inspection and the exact-head CI annotation establish the ownership assertion failure; no target code was executed during this review.

Is this the best way to solve the issue?

The existing Popover retention and draft owners provide the smallest coherent implementation, with only the consumer ownership assertion left unmigrated.

Full review comments:

  • [P2] Update the combobox ownership assertion for the moved renderer — ui/src/components/web-awesome-migration.node.test.ts:64
    Moving WorktreeFields into checkout-picker-content.tsx changes the file discovered by this ownership guard, but its expected list still names checkout-chip.ts. Exact-head checks-ui (2/3) fails with precisely that expected/received difference. Replace this entry with pages/new-session/checkout-picker-content.ts, preserving the guard and its .tsx normalization.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/web-awesome-migration.node.test.ts
  • pnpm --dir ui test src/pages/new-session/checkout-chip.test.ts
  • Verify exact-head CI passes the shared control ownership assertion and classify any remaining failures from their actual diagnostics.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit d52b6a7 adds ui/src/pages/new-session/picker.tsx:24 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d52b6a796eaf; files: ui/src/pages/new-session/picker.tsx)

PR surface

Source +127, Tests +247, Docs +15, Other +211. Total +600 across 27 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 11 1490 1363 +127
Tests 12 310 63 +247
Docs 1 15 0 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 3 234 23 +211
Total 27 2049 1449 +600

Review metrics

Metric Value Why it matters
Diagnostic option 1 new flag: --module-attribution Adds optional emitted-module diagnostics without changing normal performance-check output.

Labels

Label changes:

  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is not_applicable.

Label justifications:

  • P2: A bounded Control UI loading improvement with a focused, confirmed CI repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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-22T18:36:25.309Z sha b9a75ba :: needs changes before merge. :: [P2] Use guarded reload recovery for stale Where-picker chunks

Reviewed October 22, 2026, 6:21 PM ET / 22:21 UTC (Revision 2).

@steipete steipete changed the title perf: defer optional chat and New Session boot content perf(ui): defer New Session picker bodies and obsolete preload code Oct 22, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The stale Where-picker recovery finding is fixed on the current head through the shared SessionPicker boundary. It distinguishes stale imports, uses the existing guarded reload owner with a current-open-picker check, and preserves ordinary retry for render errors. The PR body now includes the coordinator's timing acceptance, the complete grouped boot attribution, and the integrated proof and CI repairs.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Oct 22, 2026
@steipete
steipete merged commit 87a94c4 into main Oct 22, 2026
131 of 137 checks passed
@steipete
steipete deleted the solid2/w-perf-chat-boot-2 branch October 22, 2026 23:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…penclaw#180852)

* perf(ui): defer optional chat and placement boot content

Keep the New Session placement menu and mobile sharing options behind their first-use boundaries. Preserve idle pet loading instead of promoting it into route preloads. Add emitted-module attribution and compare production reloads using each bundle’s actual build identity. Ratchet the measured boot caps while retaining their relative headroom.

* test(ui): exercise deferred picker and stable chunk fixtures

* perf(ui): refresh boot budgets against current main

* perf(ui): defer retained file draft review renderer

* perf(ui): defer Claw review dialog body

* perf(ui): keep panel renderers behind the sidebar boundary

* perf(ui): refresh deferred chat boot modules

* perf(ui): reuse the existing panel header action module

* perf(ui): ratchet deferred session boot budgets

* fix(perf): wait for pinned sessions in their current sidebar section

* perf(ui): retain the original panel dependency order

* perf(ui): defer project and checkout picker bodies

* perf(ui): rely on native module preloading in supported browsers

* perf(ui): keep this checkpoint focused on New Session loading

* perf(bench): serialize full reload reports after measurement

* fix(ui): recover stale New Session picker imports

* test(ui): await opened lazy New Session pickers

* style(ui): format lazy picker regression coverage

* test(ui): follow lazy checkout combobox owner

* perf(ui): ratchet chat boot cap against matched plugin inputs
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant