Repository navigation
refactor(ui): own mascot canvas and listener lifecycle - #174595
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 replaces mascot canvas queries with a JSX ref and pairs external listener registration with teardown through the existing helper. Example: A 48-pixel mascot switches from claw branding to neutral branding and back.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this PR open: it is a focused, maintainer-approved lifecycle refactor, and source review found no actionable introduced defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared Control UI mascot consumes theme branding, mood, size, motion preferences, and visibility events, then drives the existing TypeScript animator and canvas renderer. flowchart TD
A[Theme branding and mascot props] --> B[Solid mascot component]
C[Motion and visibility events] --> B
B --> D[Mascot animator]
D --> E[Canvas renderer]
B --> F[Owned canvas ref and cleanup]
F --> E
Technical reviewBest possible solution: Retain the single animator owner and complete this focused refactor through the normal exact-head CI gates. Do we have a high-confidence way to reproduce the issue? No user-visible defect is claimed; source inspection confirms the repeated query and manual listener registrations that the refactor removes. Is this the best way to solve the issue? The change uses the existing ref and listener contracts, preserves the animator owner, and avoids additional state or abstraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 23173ed1f61b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -1, Tests +37. Total +36 across 2 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 16, 2026, 3:55 PM ET / 19:55 UTC. |
|
Merged via squash.
|
What Problem This Solves
The shared mascot still finds its own canvas through repeated DOM queries and manages two external listeners separately.
User Impact
No user-visible change: animation timing, mood and size updates, theme branding, reduced motion, visibility pauses, and removal cleanup stay the same.
Why This Change Was Made
Keep the canvas in its JSX ref and use the existing listener helper with paired owner cleanup. The connected-node check keeps a canvas retired by a branding switch inert until its replacement mounts. The plain TypeScript animator remains the owner of animation behavior; the one retained effect synchronizes that external animator and the host DOM.
Evidence
pnpm tsgo:uipassedTouched production file metrics: LOC 165 → 164, controller references 0 → 0, effects 1 → 1,
untrack0 → 0, raw listeners 2 → 0, DOM queries 1 → 0. Render effects, manual class strings,flush, and owner escape calls remain zero. Test LOC 42 → 79.The lifecycle tests cover branding replacement, reduced motion, hidden-document pause/resume, and removal cleanup. The strict-read warnings arise in unchanged effect reads and are retained as a known follow-up; this change adds no suppression or synchronized state. No visual/style change, local E2E/parity run, cloud lease, dependency change, or lazy-boundary change. PR CI supplies broad proof with
ci:full; CI test timing is pending.