Repository navigation
refactor(ui): centralize control lifetimes and register focus targets - #176392
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 centralizes shared Control UI lifetimes and replaces DOM discovery with registered control elements. Example: Keyboard removal of beta from a settings map containing alpha, beta, and gamma.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed refactor has no verified introduced defect, and the failing CI signatures also occur on main or another PR. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSolid Control UI components consume existing configuration and overlay owners, translate user input into their operations, and manage browser focus, presentation, timers, and cleanup. flowchart LR
A[User input] --> B[Solid controls]
B --> C[Registered elements]
B --> D[Overlay lifecycle owner]
B --> E[Configuration owner]
D --> F[Browser presentation and focus]
C --> F
G[Visible polling owner] --> B
Technical reviewBest possible solution: Keep lifecycle decisions in the existing shared owners and use component-owned element registrations to preserve current interactions. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor rather than a reported bug; source inspection establishes the replaced lifecycle and DOM-query paths. Is this the best way to solve the issue? The change generally uses the existing overlay, navigation, polling, and configuration owners without introducing a competing domain owner; no concrete smaller-fix defect was established. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd7ebe9be15f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +61, Tests +37. Total +98 across 35 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 18, 2026, 4:28 PM ET / 20:28 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…openclaw#176392) * refactor(ui): centralize control lifetimes and register focus targets * fix(ui): satisfy menu registry lint
What Problem This Solves
Shared controls still carry component effects, DOM discovery, and untracked callbacks left over from the renderer migration.
User Impact
No visual or interaction change is intended. This keeps menu keyboard navigation, disabled dismissal, config draft preservation, and visible-only elapsed timers under their existing owners.
Why This Change Was Made
Menu rows and settings controls register their actual elements instead of rediscovering them. The shared overlay owner retires disabled surfaces, the existing polling helper owns reactive enablement, and one-time loader setup uses its visible component lifetime. Callback reads no longer add redundant
untrackwrappers.This is the first components cleanup checkpoint. Remaining menu queries cover arbitrary embedded controls and need a complete caller cutover; remaining effects include native draft synchronization, admitted App work, overlay placement and focus. The lane will continue toward the wave-zero targets. The capture used the production builds and shared fixture/screenshot recipe through standalone Playwright after Vitest setup stalled; the two scenes had no page errors.
Evidence
Measured changed production scope (34 files; one additional test file):
createEffectcreateRenderEffectuntrackaddEventListenerquerySelector(All)including generic callsThe 61-line growth buys explicit menu/collection/control refs and their cleanup. The remaining
untrackcalls capture deliberately fixed request, renderer, or App-retirement identities. CI runs the full UI/browser/real-Gateway selection viaci:full; no local full E2E suite or remote lease was used.CI attribution and repair
Initial
ci:fullrun 39161722883 found two new menu-registry lint errors (no-shadowandno-array-sort). The repair renames the local catalog and usestoSorted(); sorting order and behavior are unchanged. Repair headc8dac5ac0227bbb5e532c8e826ac74d3eace251bcompleted 39163830846: lint, all UI unit shards, Control UI E2E, browser-extension and security checks passed. Only the two real-Gateway shards and their aggregate gate failed. The repair build and strict performance check passed; independent review found no actionable P0–P2 defects.All three remaining failures on the repaired head exactly match failing test names in the latest completed scheduled main run 39163574553, at
3020cb46d4737c0a1b1085e9d5eb6985bf33821b:Managed image ordering through real chat.send and history > keeps headings, managed images and trailing prose ordered live and after reload without duplicates.Speech supplements through real chat.send and cursor history > attaches delayed speech to each original answer live and after reload.Control UI media transcript replay with a real Gateway > delivers PowerPoint and keeps persisted attachment failures replay-safe.These were compared by test name in the job logs, not merely by shard name.
Remaining categories in this checkpoint (paths under
ui/src/):components/confirm-dialog-view.tsx:10,input-dialog-view.tsx:12,select-picker-view.tsx:126,363,solid/mcp-app-panel.tsx:256,257,solid/menu.tsx:156,398,solid/popover.tsx:45.components/config-form.node.scalar.tsx:259,config-form.node.shared.tsx:281,option-card.tsx:46.components/login-gate-solid.tsx:414,solid/mcp-app-panel.tsx:200,solid/person-reference.tsx:107.components/select-picker-view.tsx:300,solid/menu-machine.ts:338,solid/menu.tsx:279,solid/overlay-control.ts:50,solid/popover.tsx:62.lib/reactive/visible-poll.ts:54.components/select-picker-view.tsx:308(scroll),solid/menu.tsx:172(prewarm scheduling), and embedded-control queries atsolid/menu.tsx:186,196,221,296. These are outstanding wave-zero work, not claimed exceptions.