Repository navigation
refactor(ui): simplify chat rendering ownership and derivations - #177461
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 changes before merge. What this changesThis PR removes cached chat display derivations and moves pane startup into its mounted Solid component. Example: An assistant message keeps timestamp 1000 while its input-token usage changes from 100 to 200.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this PR open: the maintainer-approved simplification is useful, but two changes restore avoidable DOM writes that an earlier measured performance fix removed. Priority: P2 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherControl UI chat components consume synchronous pane and session owners through Solid projections and render the composer, transcript, menus, and Details panel. flowchart LR
A[Gateway and session owners] --> B[Pane runtime]
B --> C[Solid projections]
C --> D[Chat components]
D --> E[Native DOM bindings]
D --> F[Retained transcript islands]
Technical reviewBest possible solution: Keep the pane-lifetime and pass-through simplifications while restoring the timestamp and Details scalar equality boundaries. Do we have a high-confidence way to reproduce the issue? The timestamp regression has an existing usage-only MutationObserver scenario, and the Details change restores the exact bindings previously measured to cause redundant writes; no tests or target code were executed during this read-only review. Is this the best way to solve the issue? Most replacements follow the repository's accessor guidance, but cheap computation and equality-gated publication serve different purposes, so the measured DOM boundaries should remain. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d0e8fc8a103b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -38. Total -38 across 17 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 Reviewed October 19, 2026, 12:26 PM ET / 16:26 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…claw#177461) * refactor(ui): simplify chat rendering ownership and derivations * fix(ui): retain chat presentation equality boundaries
What Problem This Solves
Removes redundant reactive computations from chat rendering and creates pane startup projections in their owning component instead of restoring a captured owner.
User Impact
No intended visual or behavioral change. Chat retains its native input drafts, menu focus, parked panes, transcript geometry, and lazy loading boundaries.
Why This Change Was Made
Cheap display values and pass-through accessors do not need a second cached computation. This removes 47 memos while retaining the caches that own rendered content, resources, expensive/shared preparation, or equality boundaries for native drafts and disclosure state. Pane startup still waits for the existing readiness gate, then runs in
MountedPaneso its projections inherit that component's lifetime directly.The baseline contains only two Solid
flush()calls in chat: header-menu admission and virtualized position-rail keyboard focus. Both remain as named synchronous DOM integrations. Otherflushfunctions drain ordinary TypeScript queues or group messages. Five remaining Solid owner calls serve the markdown-media, Canvas range, and detached retained-transcript DOM adapters; comments document their ownership contracts.Evidence
pnpm tsgo:ui(tsrs)chat-pane-bridge.test.tsx --maxWorkers=1chat-composer-solid.test.tsx --maxWorkers=1chat-transcript-follow-continuity.test.tsx --maxWorkers=1pnpm check:control-ui-controllersgit diff --checkci:fullTouched production files: 17. LOC: 6,651 → 6,619 (−32). Memos: 109 → 62 (−47). Solid owner calls: 7 → 5 (the remaining calls are DOM-island integrations). Effects: 2 → 2;
untrack: 1 → 1; direct listeners and DOM queries: 0 → 0.No startup imports, dependencies, styles, tags, selectors, or routes change. Under the campaign's bounded-proof rule, no local build, startup-byte measurement, or screenshots were run for this behavior-preserving refactor. Local tests used the default pinned Bun runtime. Broader performance and retention evidence will come from the labeled PR run.
The initial full run 39283443243 exposed two real regressions:
preserves option content on unrelated refreshes while admitting permission changesandleaves timestamp attributes untouched when only message usage changes. The correction retains their six equality boundaries and documents why these apparent pass-through memos are necessary. Both existing tests were reproduced red and then green locally.The initial baseline-ratchet job also failed
mock-exportsatsrc/infra/openclaw-process-census.missing-command.test.ts:12. The same guard failed against a temporary index containing only main7cb1ea1f8e8352c900314079d6126b3fd2aef46e; that file is outside both chat diffs. No test assertion is being attributed to main.Replacement run 39288688032 completed: all 3 UI unit shards, all 9 browser shards, both real-Gateway shards, and the Control UI performance check passed. The only failed root was
checks-fast-baseline-ratchets, with the exact samemock-exportssource/line/specifier as completed scheduled-main run 39286736487. The failed source and guard inputs are unchanged in the actual tested merge. Landing uses the documented inherited-failure exception; the overall CI run is not green.