Skip to content

perf(ui): defer composer suggestions and person cards - #182363

Merged
steipete merged 10 commits into
mainfrom
solid2/w-perf-chat-boot-3
Oct 24, 2026
Merged

steipete merged 10 commits into
mainfrom
solid2/w-perf-chat-boot-3

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Related: #181868

What Problem This Solves

Chat loads suggestion-row rendering and full person-card behavior before either is visible.

User Impact

Suggestion state, keyboard selection and the menu shells remain synchronous. Rich option rows load on invocation; pending rows use the same option renderer, accessible names, descriptions, selection and activation handlers with same-size skeleton content. Person-card directory/activity reads and rendering load on open, and retired imports cannot reopen a dismissed card.

Why This Change Was Made

Separate four composer state owners from their option views. Keep portal/focus lifetime at the person trigger. Share the platform-label helper so opening a card does not import New Session. The intermediate re-export facade was removed because it pulled New Session into Chat. Boot grouping and its generated manifest preserve the lazy boundaries.

Evidence

Reviewed merged head: 7ab4bef6e3c3fd7e797b7e21f10df04f26092d4c. Same-machine production builds against merge base abda524dfc56aabb79265eabb82da1e0a0124e93, pinned dependencies, Node 26.12.1:

Surface Base gzip JS Head gzip JS JS requests CSS requests
Startup 281,407 B 281,523 B 7 → 7 1 → 1
Chat 1,278,548 B 1,275,713 B 20 → 19 3 → 3
New Session 766,897 B 765,740 B 16 → 16 3 → 3

Chat CSS: 137,071 → 137,015 B. New Session CSS: 100,577 → 93,419 B. Startup CSS stays 40,132 B. Strict base/head performance check passes; Chat cap equals the measured 1,275,713 B.

This saves 2,835 B on Chat, leaving about 57 KB of the 60 KB goal. Startup grows 116 B (0.04%) while preserving the same core-module set and 7 JS / 1 CSS requests. This is the accepted export/compression cost of the lazy boundaries: no library enters startup, the build remains 286 B below its enforced startup limit, and Chat saves bytes and one request. The sidebar audit found its large remaining owners serve restored navigation, ordering, selection, unread state and live roster reconciliation; many secondary flows are already lazy. The attributed group sizes are diagnostic, not additive removable wire bytes.

The retained timing runs compare ea95e20354d against 12914443747, before the final conflict-only integration. The composer/person renderers and their state-owner cutover are unchanged. Main now supplies canonical thread CPU metrics, so this PR removes its duplicate instrumentation. Matching builds above and fresh full CI cover the integrated source.

Twenty serial alternating cold-cache base/head pairs per profile used the committed cold-load harness, a fixed 240-message synthetic session, real isolated Gateway HTTP serving with synthetic WebSocket replies, Node 26.12.1, and thread CPU metrics. The 100 ms profile applies latency to both browser HTTP and synthetic Gateway replies. A second 10-pair base/base control also records thread CPU. All 80 comparative loads and 20 CPU-control loads have identical transcript results, zero pending/queued work, and threadTicks CPU accounting.

Profile Readiness (ms) Base median / p95 Head median / p95
localhost Transcript 654.9 / 787.0 734.8 / 794.0
localhost Composer 343.8 / 397.1 342.7 / 392.2
100 ms Transcript 1274.2 / 1392.8 1233.4 / 1397.6
100 ms Composer 922.5 / 1046.9 882.0 / 1062.0
Profile Thread CPU (ms) Base median / p95 Head median / p95 Paired median change
localhost Script 587.8 / 834.0 585.6 / 637.4 -1.4%
localhost Task 1194.2 / 1567.3 1189.3 / 1269.5 -0.5%
100 ms Script 634.6 / 658.1 650.2 / 683.5 +2.8%
100 ms Task 1357.4 / 1402.7 1377.5 / 1442.8 +1.1%
Sample spread and control
Profile Metric Base min–max (ms) Head min–max (ms)
localhost Transcript 604.8–843.0 667.7–878.7
localhost Composer 321.9–531.3 321.3–498.7
localhost Script CPU 554.6–852.0 529.1–795.8
localhost Task CPU 1114.5–1576.3 1094.3–1525.0
100 ms Transcript 1217.2–1399.2 1202.8–1642.8
100 ms Composer 888.4–1051.3 860.5–1306.3
100 ms Script CPU 591.6–665.1 579.7–689.2
100 ms Task CPU 1295.9–1407.3 1268.0–1463.7

The earlier 10-pair wall-time A/A control on this host had transcript p95 1,356.1 → 1,058.4 ms and composer p95 896.2 → 598.3 ms; load was 36–58. Comparative load ranges were localhost 20.9–36.0, 100 ms 31.8–63.9.

100 ms CPU A/A control First median / p95 Second median / p95 Paired median change
Script 628.6 / 668.9 646.0 / 663.9 +1.6%
Task 1343.8 / 1408.6 1368.8 / 1414.5 +1.4%

CPU-control load: 35.2–62.1.

Acceptance is the declared noisy-host rule: judge thread CPU over 20 paired comparative loads and structural counters when the A/A control is noisy. Localhost transcript median is 12.2% slower. Wall-latency conclusions remain limited by host noise. The 100 ms readiness medians improve and comparative CPU median movements stay below 5%. Identical-code CPU A/A has paired median changes of +1.6% script / +1.4% task, versus +2.8% / +1.1% for base/head. The small comparative increases are comparable to control drift; the completed CPU/structural proof does not establish an attributable regression. This meets the supplied noisy-host acceptance rule, with the wall-time limitation above retained.

UI typecheck and targeted lint pass. The five unit test files containing the introduced CI failures plus the new pending-option regression pass all six selected cases. The unchanged narrow-screen emoji E2E case passes. Original focused suites passed 35 cases. Final-head production Knip reports the sole existing unused src/gateway/assistant-human-mentions.ts; the original base reproduces it. Targeted lint of the earlier full scope likewise reproduced the existing 702/700-line command-palette-state.ts error on base; no ignores or allowances were added.

CI run 40074489797 identified six failures caused by pending rows lacking option semantics or pointer handlers. The repair preserves those semantics during loading and leaves the original immediate accessibility, pointer, scroll and emoji assertions unchanged. Fresh independent reviews of the implementation and cap are scoped-clean through P2. Full ci:full CI passed on the pre-integration head in run 40076972719, including all UI unit, Control UI E2E, browser-extension and real-Gateway shards. Final exact-head CI and its one diagnosed-flake rerun are detailed below. The final main integration uses its benchmark unchanged; fresh independent review and the integrated UI typecheck passed.

Production UI LOC in touched files: 6,494 → 6,810 (+316). Test/support LOC: 1,280 → 1,420 (+140). The growth implements explicit lazy boundaries and accessible loading rows. Solid refactor census: createEffect 1 → 1, onSettled 6 → 6, lazy 1 → 6; direct listeners, DOM queries, createRoot, createComponent, onCleanup, untrack and owner capture remain zero.

Visual Proof

Inspected synthetic-only Chat, slash menu and person-card captures. Pending and ready menus both measure 766 × 326. The held-import accessibility tree exposes named options and the selected item. No browser errors; deferred modules are absent before interaction; opening the person card does not fetch New Session. Escape restores trigger focus.

State Before After
Initial Chat Before initial Chat After initial Chat
Slash suggestions Before slash suggestions After slash suggestions
Person card Before person card After person card

Pending options retain their accessible names, selection and activation while showing equal-sized skeleton content:

Pending options

Final CI attribution

Exact-head run 40080035160, attempt 2, retains seven failed cases across five mocked-Gateway E2E jobs. Every failing name also fails in the latest completed scheduled main run 40078639310 at ee855ce57341eb3259741087681be0b0e1ec837c. The native inherited-failure evidence binds the actual tested merge 6a03a12e219797f22db5909464b505f0d2934c53, its ordered base/head parents, unchanged test/runtime inputs, complete job accounting, and log hashes. Failed CI is not reported as green.

Exact failing test Scheduled main job
ui-e2e-bundled ui/src/e2e/chat-active-turn-recovery.e2e.test.ts > active turn recovery > restores the active assistant and tool after navigation 120827460133
ui-e2e-bundled ui/src/e2e/home-attention.e2e.test.ts > Control UI chat shell regressions > does not republish run activity for successive text deltas 120827460148
ui-e2e-bundled ui/src/e2e/session-management.archive-undo.e2e.test.ts > Control UI session management mocked Gateway E2E > offers Undo when an individual archive completes after navigate on the Sessions page 120827460243
ui-e2e-bundled ui/src/e2e/model-providers-studio-shape.e2e.test.ts > Control UI Model providers studio-shaped data mocked Gateway E2E > shows plan headroom per provider and leaves local usage to the Usage page 120827460243
ui-e2e-bundled ui/src/e2e/settings-exit-layout-shift.e2e.test.ts > Settings exit layout shift > keeps the shell still from Models to /usage at 400px 120827460205
ui-e2e-bundled ui/src/e2e/settings-exit-layout-shift.e2e.test.ts > Settings exit layout shift > keeps the shell still from Models to /usage at 820px 120827460205
ui-e2e-bundled ui/src/e2e/sidebar-customization.e2e.test.ts > Control UI sidebar customization mocked Gateway E2E > pins and unpins routes and persists navigation state across reloads 120827460208

The initial real-Gateway catalog failure was investigated separately because it passed on scheduled main. Its CLI write succeeded but the Gateway logged a plugin-lifecycle lease wait until 09:07:59Z, beyond the 09:03:27Z publication assertion failure. The exact-head focused case passed locally once (default pinned runtime, isolated real Gateway); a single diagnosed-flake rerun of only the failed real-Gateway job was requested. No source, assertion, timeout, or retry count changed. The full real-Gateway shard passed in rerun job 120836754773. Both real-Gateway shards are green in completed attempt 2.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 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 24, 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-24T09:00:06.468748Z 7ab4bef 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 24, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR defers composer option rendering and person-card code until interaction while preserving synchronous editing state.

Example: Open Chat, type /sta, then open Alex Rivera’s person card.

  • Before: Suggestion rendering and person-card code load before either surface is opened.
  • After: Option rendering loads on invocation, accessible loading options remain selectable, and person-card code loads when the card opens.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, coherent performance change with inspected visual proof and resolved prior findings; timing conclusions remain limited by the disclosed host noise.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser captures show initial Chat, ready slash suggestions, pending skeleton options, and retained person-card presentation; production-build and cold-load results exercise the served UI with synthetic Gateway replies, while focused tests support delayed-import retirement and accessibility.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Chat downloads optional suggestion rendering and person-card behavior before users need them.
Reason: The maintainer-authored direction has a verified structural gain, preserves existing interaction contracts, and explicitly accepts the small startup compression tradeoff.

Merge readiness

✅ Ready for maintainer review

This PR provides a measured reduction in optional boot work, and both prior findings are addressed. No actionable introduced defect remains in the reviewed diff; exact-head CI is still running.

Priority: P2
Reviewed head: 7ab4bef6e3c3fd7e797b7e21f10df04f26092d4c

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI consumes composer drafts and Gateway-backed identity data, then presents suggestions and person cards through existing editing, directory, navigation, and portal owners.

flowchart TD
  A[Chat and New Session] --> B[Synchronous suggestion state]
  B --> C[Menu shell and accessible loading rows]
  C --> D[Lazy option views]
  E[Person reference trigger] --> F[Retained portal owner]
  F --> G[Lazy person card runtime]
  G --> H[Existing Gateway data owners]
Loading

Technical review

Best possible solution:

Retain the existing state and portal owners with the reviewed lazy rendering boundaries and normal exact-head CI gates.

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

Current-main imports show the eager rendering boundary, and the supplied matched production builds establish its transfer cost; no reproduction was run during this read-only review.

Is this the best way to solve the issue?

Separating existing state owners from interaction-only views is a focused solution; the added loading presentation protects immediate accessibility and activation without introducing competing domain state.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Composer suggestion state and synchronous selection keeps the original intent (3ca8c08: The prior Solid migration retained same-turn selection, query caching, cancellation, and existing draft ownership.)
  • Slash commands and skill references keeps the original intent (refactor(ui): own composer command menus in Solid stores #174321: Menu presentation moved into Solid stores while preserving synchronous keyboard transitions and stale-result retirement.)
  • Person-card readiness and portal lifetime keeps the original intent (4807f81: The directory owner admits reads while async presentation preserves the retained card, focus, links, and obsolete-result suppression.)
  • Boot partitioning and performance budget keeps the original intent (f31da84: Optional copy stays outside boot closures, with measured transfer budgets protecting startup and route loading.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +329, Tests +140, Other -1. Total +468 across 36 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 30 2318 1989 +329
Tests 5 148 8 +140
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 3 -1
Total 36 2468 2000 +468

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded Control UI performance improvement with measured transfer savings and preserved editing behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • 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-24T07:48:07.725Z sha 5144185 :: needs changes before merge. :: [P2] Preserve accessible active options while row code loads | [P2] Await interactive lazy rows in affected consumer tests

Reviewed October 24, 2026, 5:02 AM ET / 09:02 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

Addressed both findings in production on the current head. Pending rows retain the existing option renderer, accessible names/descriptions, active selection, click/hover handlers, focus policy and geometry. The original immediate accessibility, pointer, scrolling and emoji assertions remain unchanged and pass. Added focused pending-option coverage. Full exact-head ci:full CI is green; the body contains the final builds, timing/control results, screenshots and limitations.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete enabled auto-merge (squash) October 24, 2026 09:05
@steipete
steipete disabled auto-merge October 24, 2026 09:37
@steipete
steipete merged commit e89e5ad into main Oct 24, 2026
179 of 194 checks passed
@steipete
steipete deleted the solid2/w-perf-chat-boot-3 branch October 24, 2026 09:59
@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 25, 2026
* perf(ui): load composer suggestions and person cards on demand

* perf(ui): ratchet chat boot to the formatted bundle

* perf(ui): ratchet the merged chat boot measurement

* fix(ui): keep deferred suggestion options accessible

* perf(ui): set the final accessible chat boot cap

* perf(ui): ratchet the reconciled chat boot cap

* perf(ui): set the current-base chat boot cap
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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