Repository navigation
refactor(ui): use owned refs and listener cleanup across pages - #174166
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 manual DOM lookups and listener teardown with owned refs and shared cleanup, simplifies asynchronous callbacks, and supports native class values. Example: Press Shift+F10 on session agent:main:dashboard:1.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is maintainer-authored, follows the established Solid ownership direction, and introduces no concrete defect found in this review. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI page components consume Gateway projections and browser events, render controls, and delegate requests to existing synchronous owners. flowchart LR
A[Browser events] --> B[Solid page components]
B --> C[Owned DOM refs]
B --> D[Shared listener cleanup]
B --> E[Synchronous page owners]
E --> F[Gateway client]
Technical reviewBest possible solution: Retain the focused refactor while preserving existing interaction, request-identity, polling, and cleanup contracts. Do we have a high-confidence way to reproduce the issue? No product bug is claimed; source inspection confirms a behavior-preserving refactor, and no target code was executed. Is this the best way to solve the issue? The patch uses existing owners and helpers, removes redundant lookups and wrappers, and keeps the drag callback's captured identity protection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc8b7ddb1b14. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -8. Total -8 across 19 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, 7:42 AM ET / 11:42 UTC. |
|
Merged via squash.
|
What Problem This Solves
Several Solid page renderers still manage event listeners and query their own rendered controls manually.
User Impact
No intended visible behavior change. Session menu shortcuts, Usage range dragging, Logs auto-follow, and Logbook loading keep their existing contracts.
Why This Change Was Made
Use the shared listener cleanup helper and owned refs for the Logs stream, session menu trigger, and Usage SVG. Let the synchronous Logbook owner decide whether its connected source needs an initial load. Remove redundant tracking wrappers around ordinary Promise/microtask callbacks, and pass native class values through the existing component interfaces.
Domain state, request identity checks, polling timing, host tags, classes, and lazy page boundaries stay intact. The shared component changes are type-only; no startup imports or dependencies change. The separate plugin icon owner migration is outside this PR.
Evidence
Touched production files: 19. Production LOC: 6,606 → 6,598 (−8).
createEffectcreateRenderEffectuntrackaddEventListenerquerySelectorcalls, including generic callsThe retained raw registrations/queries belong to existing drag, overlay, or lifecycle boundaries. The unchanged class-regex match is inside the shared Menu implementation; this PR changes only its class prop type.
The CloudWorkers native microtask intentionally samples settled state once to decide explicit polling; it must not subscribe. The Solid lint rule reports that callback as a reactivity advisory after removing
untrack; the code documents the intended snapshot and adds no suppression. The Sessions helper invokes its event callback synchronously, so its new reactivity advisory is also a heuristic false positive. Existing Menu and Meetings callback advisories are unchanged contracts.After persistent GitHub mergeability recalculation failures, merged
origin/mainonce without conflicts. Final heada7b4aa5b2375fc82b1c176ca754822c4db0d184ais compared with exact main parente2b2ea44a4e687d21a480841ecbb573c8477ab90. The 19-file authored patch is unchanged (stable patch ID3d08419a20b9b8aa89f0459c22cdf75f2c02c26b), and the exact-parent metrics remain 6,606 → 6,598 LOC. The 91 focused passing tests and clean isolated review are reused; final-head types and production Knip were refreshed.The refreshed startup comparison used identical build metadata: 339,434 → 339,426 B gzip JS, with unchanged raw JS at 1,033,934 B, 7 JS requests, 1 CSS request, and 38,786 B gzip CSS. Both strict checks reported zero violations against the 374,285 B JS / 1 CSS request budget. The −8 B compressed difference is hashed-reference variation; no startup imports or dependencies were added.
Historical original-base proof is retained separately:
11bbb8291b929db893cef5fdf91e9bb6fb9d6813→6dbd785bb987dcfe9ac93a14cda2130ce2ccd35cmeasured 339,508 → 339,530 B gzip JS (+22 B), with raw JS unchanged at 1,034,463 B. Final-head proof above supersedes these startup measurements.Final CI and landing
The replacement-head
ci:fullrun 38901947973 passed: 38 jobs succeeded, 26 were skipped, and no jobs failed. Native landing merged the exact reviewed head asd2b07e89a09c7204508331175e748be705063859; no inherited-failure exception was used for this head. Merge ancestry was verified against freshly fetchedorigin/main.Historical CI attribution (original head)
The following evidence applies to original head
6dbd785bb987dcfe9ac93a14cda2130ce2ccd35c; it is not final-head CI authority.ci:fullrun 38893742066 found two source-attributed base regressions. These are not claimed as matching failures of the latest completed scheduled main run: that run 38887900861 predates both causal changes.The five
model-providers-layout.e2e.test.tsfailures all hit the unchanged six-role expectation at line 114 after #173906 added the seventh “Utility Fallback Model” row. The feature is already present in this PR’s merge base and CI base; neither the default-model renderer nor this E2E expectation changes here. Exact failed cases:ui/src/e2e/model-providers-layout.e2e.test.ts > Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 1100pxui/src/e2e/model-providers-layout.e2e.test.ts > Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 1440pxui/src/e2e/model-providers-layout.e2e.test.ts > Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 390pxui/src/e2e/model-providers-layout.e2e.test.ts > Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 640pxui/src/e2e/model-providers-layout.e2e.test.ts > Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 768pxThe assertion-safety ratchet fails with
src/media/media-facts.ts: 14 < 16. Commit9b9933e2903f21722c38d3d105543569168f8576removed two assertions while leaving the baseline at 16. The production parser reports 16/16 before that change and 14/16 on CI baseb4ce369de7e8d0047365e7410145321d654eaf51; the media source and ratchet inputs are outside this UI patch.The inspected CI checkout is merge
db15d2dee0da5cf2210a4fe10958efc6e0921ea2, with ordered parentsb4ce369de7e8d0047365e7410145321d654eaf51and6dbd785bb987dcfe9ac93a14cda2130ce2ccd35c. Native inherited-failure admission retains the failed results and exact evidence; no CI result is relabeled green.