Skip to content

refactor(ui): replace browser panel controller with owner factories - #174369

Merged
steipete merged 3 commits into
mainfrom
solid2/w-idiom-components-browser-owner
Oct 16, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-idiom-components-browser-owner

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The Browser panel still registered its synchronous navigation and capture owner with the old host-controller lifecycle. Operation admission and document downloads also used classes despite needing only retained synchronous state.

Replace those three classes with createBrowserPanel, createBrowserPanelOperations, and createBrowserPanelDownload. The Solid view suspends the browser owner on disposal. Navigation ordering, current-request checks, capture cancellation, and the real DOM-commit updateComplete fence remain intact. Input handlers call their existing input owner directly, retaining the native-tab guard. The native subscription/ref lifecycle already landed on main and is integrated here.

The shared SolidPanelController and Browser presentation adapter remain for their existing consumers; this change adds no revision mirror. Tags, selectors, markup, routes, and lazy imports are unchanged.

Proof Result
Mounted Browser panel 12/12 passed, including the added annotation-capture cleanup on disconnect
Navigation/capture ownership 18/18 passed, including overlapping navigation, stale replies, recovery, and disconnect
Toolbar/download state 3/3 passed through the mounted panel
UI types / assertion safety pnpm tsgo:ui and the assertion-safety ratchet passed after the CI repair
Lint / format Passed on all changed source/test files
Production Knip Candidate and exact-base scans both exit 1 with byte-identical findings: formatDiscordDeployRateLimitDetails, FILE_CONSENT_THRESHOLD_BYTES, APP_ROUTE_PATHS, and APP_ROUTE_OFFLINE_PREFIXES. All are outside this diff; no new finding or ignore.
Independent P0–P2 autoreview Passed on the final integrated source and the focused CI repair
CI / startup budget Initial assertion-safety failure repaired with an explicit state type; replacement run 38926544592 passes that check. Replacement paired performance passed: startup JS 339,561 B gzip / 7 requests; CSS 38,786 B / 1 request; chat boot +115 B, new-chat boot +120 B; startup CSS unchanged. Base startup JS total was not separately printed. All UI unit, ordinary E2E, browser-extension and real-Gateway shards passed; the completed run is red only for the two inherited guards described below and their aggregate.
Visual proof No visual or markup change; mounted behavior is covered above

Each of the three local test files ran once with --maxWorkers=1. After the initialization-type repair and equivalent Promise/branch simplifications, the affected stale-focus/capture case passed again (1/1); no full suite repeat. No local build or E2E run: boot modules are untouched. The retired Lit codemod was dry-run from the retained trusted tooling checkout before editing; no template conversion or unresolved migration marker remained.

Touched production metric Before After
LOC 4,193 4,191
Controller-pattern references 8 1
createEffect references 0 0
untrack references 7 7
Raw addEventListener references 2 2

Test/helper LOC: 6,223 → 6,217. Metrics compare against integrated main e55a4e66004a181a695afb238e1fffdeeda9ea04; 33 files. The remaining controller reference and two listeners belong to the retained presentation adapter/shared panel cut.

Replacement CI has two inherited guard failures, both reproduced with the same command on its exact base 5aec205816506ceb6983a5ab1c549c9e0b301a61: the first-party mock-export check flags src/flows/doctor-plugin-source-captures.test.ts:32, and duplicate-scan target coverage omits cli-parent-lifetime.mjs. Both local base runs exit 1 with the same signatures. The failing files, guard scripts, baseline ledger, package/lockfile, and TypeScript configuration are byte-identical between that base and tested merge 118d7add07f1aeb355edd52d29792ca405f04991. The latest scheduled-main run uses an older head and its guard jobs pass; attribution here comes from the exact-base reproductions, not a matching scheduled-main claim.

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

clawsweeper Bot commented Oct 16, 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 16, 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-16T15:49:20.738803Z af21204 New commits
ℹ️ 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.

@steipete
steipete enabled auto-merge (squash) October 16, 2026 15:39
@steipete
steipete disabled auto-merge October 16, 2026 15:43
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces three browser-panel classes with synchronous owner factories and moves panel suspension into Solid cleanup.

Example: Remove the Browser panel while pointer 7 owns an annotation stroke.

  • Before: The registered controller releases pointer capture through its disconnect hook.
  • After: Solid cleanup suspends the factory-owned panel and releases pointer capture.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source supports a coherent, behavior-preserving cutover with useful mounted coverage; supplied behavioral evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied validation exercises mounted panels and production owners with fixture I/O.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored direction follows the documented Solid migration, removes obsolete lifecycle wiring, and preserves the existing browser behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor completes a coherent lifecycle cutover, and no introduced correctness defect was found; exact-head CI still needs failure attribution.

Priority: P3
Reviewed head: af21204ac0a470f0bc701e09721a548c42c2dc26

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-browser lifecycle run is supplied; mounted coverage uses stubbed Gateway and media responses.
Agent review details

How this fits together

The Control UI Browser panel translates navigation, input, capture, and download actions into scoped Gateway requests or native Mac browser commands, then presents the resulting tabs and images.

flowchart TD
  A[Browser panel UI] --> B[Synchronous panel owner]
  B --> C[Operation admission]
  C --> D[Browser request client]
  D --> E[Gateway browser plugin]
  B --> F[Native browser bridge]
  B --> G[Rendered browser view]
Loading

Technical review

Best possible solution:

Keep one synchronous browser owner, let Solid dispose it, and retain the shared presentation adapter for its existing callers.

Do we have a high-confidence way to reproduce the issue?

This PR claims a behavior-preserving refactor rather than a reproduced product defect; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The factories preserve synchronous ownership and existing request guards while removing obsolete controller registration without adding another state mirror.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0dc31f5f6430.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -2, Tests -6. Total -8 across 33 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 13 1116 1118 -2
Tests 20 101 107 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 33 1217 1225 -8

Labels

Label changes:

  • add P3: This is a behavior-preserving lifecycle cleanup without a claimed current user-facing failure.
  • 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 a behavior-preserving lifecycle cleanup without a claimed current user-facing failure.
  • 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.

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 16, 2026, 12:03 PM ET / 16:03 UTC.

@steipete
steipete merged commit 5673afc into main Oct 16, 2026
107 of 115 checks passed
@steipete
steipete deleted the solid2/w-idiom-components-browser-owner branch October 16, 2026 20:20
@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. 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