Skip to content

refactor(ui): centralize control lifetimes and register focus targets - #176392

Merged
steipete merged 2 commits into
mainfrom
solid2/w-zero-components
Oct 18, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-zero-components

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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 untrack wrappers.

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

Check Result
Focused unit tests 12 passed across visible polling, option selection and config array identity; 12.51 s total
UI typecheck Passed after fixing ref and narrowed-prop types
Production builds Merge base and candidate passed on the same Mac
Strict performance check Both passed; startup 336,514 → 336,513 B gzip, 7 JS requests and 1 CSS request; identical raw startup size, delta within build-stamp variance
Targeted synthetic screenshots Inspected before/after desktop-light captures below. Session menu: pixel-identical. Settings controls: differences only in the diagnostic build footer (1,117 pixels; bounds x40–265/y933–944)
Targeted lint Both the initial attempt and focused repair retry stopped before UI lint: unchanged Plugin SDK declaration preparation timed out after 300 s; current-head CI lint passed
Production Knip Same two unused reply-admission files fail on the merge base; the symlinked baseline also reports its eslint dependency
Independent review No actionable P0–P2 findings

Measured changed production scope (34 files; one additional test file):

Pattern Before After
createEffect 25 14
createRenderEffect 1 0
untrack 42 9
addEventListener 5 0
querySelector(All) including generic calls 15 4
Production LOC 8,908 8,969

The 61-line growth buys explicit menu/collection/control refs and their cleanup. The remaining untrack calls capture deliberately fixed request, renderer, or App-retirement identities. CI runs the full UI/browser/real-Gateway selection via ci:full; no local full E2E suite or remote lease was used.

Before: settings controls, synthetic data

After: settings controls, synthetic data

Before: session menu, synthetic data

After: session menu, synthetic data

CI attribution and repair

Initial ci:full run 39161722883 found two new menu-registry lint errors (no-shadow and no-array-sort). The repair renames the local catalog and uses toSorted(); sorting order and behavior are unchanged. Repair head c8dac5ac0227bbb5e532c8e826ac74d3eace251b completed 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/):

  • Intentional initial reactive identities: 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.
  • External native-control/validation synchronization: components/config-form.node.scalar.tsx:259, config-form.node.shared.tsx:281, option-card.tsx:46.
  • External connection/App identity synchronization: components/login-gate-solid.tsx:414, solid/mcp-app-panel.tsx:200, solid/person-reference.tsx:107.
  • Overlay/Zag synchronization: components/select-picker-view.tsx:300, solid/menu-machine.ts:338, solid/menu.tsx:279, solid/overlay-control.ts:50, solid/popover.tsx:62.
  • Shared polling lifetime: lib/reactive/visible-poll.ts:54.
  • Still pending shared scheduling/ref cutover: components/select-picker-view.tsx:308 (scroll), solid/menu.tsx:172 (prewarm scheduling), and embedded-control queries at solid/menu.tsx:186,196,221,296. These are outstanding wave-zero work, not claimed exceptions.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T20:10:27.992116Z 8547445 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The removal handler discovers neighboring Remove buttons through DOM queries.
  • After: Registered row controls provide gamma as the next focus destination, preserving the intended interaction.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful consolidation with no verified introduced bug; inspected visual evidence and passing UI checks support it, but direct interaction evidence is limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; inspected production-build browser screenshots cover settings and session-menu appearance, while temporal interaction coverage rests on supporting tests and CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No visible defect is claimed; duplicated component lifecycle wiring and DOM discovery make existing controls harder to maintain.
Reason: The maintainer-authored direction consolidates existing responsibilities while preserving established control contracts and explicitly explaining the registration-related growth.

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
Reviewed head: 85474452382530a6226ceeab4f009f3b8d97e911

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied screenshots establish static parity but do not demonstrate keyboard traversal, disabled dismissal, collection-removal focus, or hidden-tab timer transitions.
Agent review details

How this fits together

Solid 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
Loading

Technical review

Best 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

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b68c44c adds ui/src/components/solid/menu-machine.ts:121 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b68c44ca8f3c; files: ui/src/components/solid/menu-machine.ts)

PR surface

Source +61, Tests +37. Total +98 across 35 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 34 834 773 +61
Tests 1 38 1 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 35 872 774 +98

Review metrics

Metric Value Why it matters
Production versus test growth Production +61 lines; tests +37 lines. Production growth supplies registered focus targets and their cleanup; the test addition covers reactive polling enablement, visibility transitions, and disposal.

Labels

Label changes:

  • add P3: This is an internal UI ownership cleanup with no intended user-facing behavior change or verified urgent regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is an internal UI ownership cleanup with no intended user-facing behavior change or verified urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • A production-browser recording of nested keyboard navigation, disabled dismissal, and collection-removal focus would strengthen behavioral confidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 18, 2026, 4:28 PM ET / 20:28 UTC.

@steipete
steipete merged commit 9b9f081 into main Oct 18, 2026
115 of 122 checks passed
@steipete
steipete deleted the solid2/w-zero-components branch October 18, 2026 21:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant