Repository navigation
refactor(ui): simplify shared Solid listener lifetimes - #173689
Conversation
Document the controller-to-Solid recipe and extend the existing migration ratchet with syntax-aware controller patterns. Keep growth advisory until the production baseline is empty, then reject reintroductions. Share imperative event teardown, let avatar JSX own image events, and remove redundant effect untracking. No user-visible behavior change.
|
🦞👀 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 documents controller replacement, extends the migration guard, and simplifies shared Solid event bindings. Example: An agent avatar changes from a failed image to data:image/png;base64,cmVwbGFjZW1lbnQ=, then the retired image emits an error.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: the refactor has clear maintenance value, but removing avatar listener cleanup introduces a regression confirmed by exact-head CI. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherControl UI components consume avatar-loader and overlay state, bind browser events, and release those bindings when their Solid owners retire. flowchart TD
A[Avatar loader] --> B[Solid avatar component]
B --> C[Browser image events]
C --> D[Avatar error callback]
E[Overlay lifecycle] --> F[Listener teardown helper]
F --> G[Solid lifetime cleanup]
Technical reviewBest possible solution: Preserve owner-scoped avatar event retirement while retaining the other focused lifecycle simplifications. Do we have a high-confidence way to reproduce the issue? Exact-head CI fails the existing avatar replacement test, and source inspection explains why the retired error handler reaches the replacement callback; no target code was run during this review. Is this the best way to solve the issue? The shared teardown helper and untracking removal preserve their contracts, but JSX event binding must retain the avatar owner's explicit retirement behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7577373270bf. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -4, Tests +46, Docs +53, Other +35. Total +130 across 11 files. Added test files: 1. 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 15, 2026, 11:26 PM ET / October 16, 2026, 03:26 UTC. |
|
Merged via squash.
|
* refactor(ui): simplify shared Solid listener lifetimes Document the controller-to-Solid recipe and extend the existing migration ratchet with syntax-aware controller patterns. Keep growth advisory until the production baseline is empty, then reject reintroductions. Share imperative event teardown, let avatar JSX own image events, and remove redundant effect untracking. No user-visible behavior change. * fix(ui): retire avatar listeners with their Solid owner
What Problem This Solves
The Solid migration needs one documented controller replacement recipe and a guard against bringing the old lifecycle back after retirement. Shared event bindings also repeat native listener teardown.
User Impact
No user-visible change. Avatar loading/error behavior, native overlay events, routes, tags, selectors, and lazy loading remain unchanged.
Why This Change Was Made
Add a worked controller-to-Solid example to the existing playbook, expose the small
lib/reactive/listener.tsteardown helper for explicit effect/settle lifetimes, and use it for overlay event forwarding. Avatar load/error listeners use the same explicit teardown, including retained detached images; the Gateway page effect no longer wraps its already-untracked apply phase inuntrack.The existing syntax-aware Lit inventory now counts lifecycle identifiers and controller classes. Growth remains advisory while production callers exist; once the production baseline has no controller patterns, the same guard rejects reintroductions. Comments, strings, and test fixtures do not hold enforcement open.
Remaining shared controller adapters still have production callers in the assistant panel, command palette, session widgets, and custodian setup. Their removal belongs with those callers' cutovers; this PR does not introduce another implementation or change domain ownership.
Evidence
pnpm tsgo:uici:full)2ccb519de145776465f97be31759287837812a4cpnpm ui:build, merge base and head on the same MacTouched production files: 372 → 371 LOC; controller-pattern references 0 → 0;
createEffectcalls 4 → 4;untrackcalls 11 → 10; nativeaddEventListenerregistrations 5 → 1. Counts include the new helper. Documentation/tooling/test additions are separate from production LOC.The first CI run passed all nine UI E2E shards and both real-Gateway shards, but caught a detached-image event regression in
keeps a failed avatar on its fallback until the image changes. The repaired head removes those listeners on owner disposal, and the existing regression passes locally. Full CI passed on the repaired head in run 38846274132.This is lifecycle-only refactoring with unchanged rendered markup and styling, so no visual captures are needed. Full UI CI is selected because these shared primitives affect overlays and avatar consumers.