Repository navigation
perf(ui): defer composer suggestions and person cards - #182363
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR defers composer option rendering and person-card code until interaction while preserving synchronous editing state. Example: Open Chat, type
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +329, Tests +140, Other -1. Total +468 across 36 files. Added test files: 0. View PR surface stats
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 HistoryReview history (1 earlier review cycle)
Reviewed October 24, 2026, 5:02 AM ET / 09:02 UTC (Revision 2). |
|
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 @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* 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
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 baseabda524dfc56aabb79265eabb82da1e0a0124e93, pinned dependencies, Node 26.12.1: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
ea95e20354dagainst12914443747, 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
threadTicksCPU accounting.Sample spread and control
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.
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-linecommand-palette-state.tserror 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:fullCI 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.
Pending options retain their accessible names, selection and activation while showing equal-sized skeleton content:
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 merge6a03a12e219797f22db5909464b505f0d2934c53, its ordered base/head parents, unchanged test/runtime inputs, complete job accounting, and log hashes. Failed CI is not reported as green.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.