Repository navigation
refactor(ui): retain overlay root listener cleanup - #174178
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 retains cleanup callbacks from the shared listener helper and invokes them when an overlay root loses its last reference. Example: Two overlays share one closed shadow root, then both are disposed.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a sound, maintainer-authored lifecycle simplification with no introduced defects found; failing workflow gates still prevent landing. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI overlay registry shares document and shadow-root listeners across overlay lifecycles, translating keyboard, pointer, and focus events into dismissal decisions. flowchart TD
A[Overlay lifecycle] --> B[Overlay registry]
B --> C[Reference counted roots]
C --> D[Shared listener helper]
D --> E[Native browser events]
E --> B
C --> F[Final reference cleanup]
Technical reviewBest possible solution: Retain this focused reuse of the shared listener helper while preserving the existing registry and reference-count lifecycle. Do we have a high-confidence way to reproduce the issue? No user bug is claimed; source inspection confirms equivalent listener registration and final-reference teardown, and no target code was executed. Is this the best way to solve the issue? Using the existing synchronous listener helper removes duplicated teardown mechanics without introducing another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5442051b9f76. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -2. Total -2 across 1 file. 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, 7:55 AM ET / 11:55 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Overlay roots installed their event table and reconstructed the matching table during teardown. Retain the cleanup functions returned by the shared listener helper instead. Each root still shares one listener set, and the existing reference count still decides when that set is released. Capture/bubble ordering, focus and pointer dismissal semantics are unchanged.
Evidence
ci:fullNo visual, markup, route, selector, or lazy-boundary change. No screenshots are required for this listener-lifetime refactor. The existing native overlay registry remains the synchronous owner of root membership and dismissal ordering.
Refactor metrics
Exact checklist patterns for the one touched production file:
addEventListenercreateEffect/createRenderEffectuntrack/ queries / class strings /flush/ owner captureThe before build used the exact merge-base version of the changed file with all other files unchanged, then the candidate was restored for the after build, on the same machine and checkout.
CI attribution
Full run 38895527118 passed every selected product and security check except the inherited assertion-safety ratchet (
src/media/media-facts.ts: 14 < 16). The exact tested mergeb90cd3605bcfe4ecd7e63554d2012a8d58c0dff1has baseline7bb0840c04cbe62fa703c6e26cacaab0a82467d7and this PR head as ordered parents; its real delta is onlyoverlay-registry.ts. The media source and assertion checker dependencies are byte-identical. Scheduled main run 38894297213 has the same failure. Native admin admission retains this failure; it is not a green-CI claim.