Repository navigation
refactor(ui): replace browser panel controller with owner factories - #174369
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 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.
Review scores
ProductKind: Refactor · Worth it: Yes 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -2, Tests -6. Total -8 across 33 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, 12:03 PM ET / 16:03 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…penclaw#174369) * refactor(ui): replace browser panel controller with factories * refactor(ui): type browser owner state without assertions
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, andcreateBrowserPanelDownload. The Solid view suspends the browser owner on disposal. Navigation ordering, current-request checks, capture cancellation, and the real DOM-commitupdateCompletefence 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
SolidPanelControllerand Browser presentation adapter remain for their existing consumers; this change adds no revision mirror. Tags, selectors, markup, routes, and lazy imports are unchanged.pnpm tsgo:uiand the assertion-safety ratchet passed after the CI repairformatDiscordDeployRateLimitDetails,FILE_CONSENT_THRESHOLD_BYTES,APP_ROUTE_PATHS, andAPP_ROUTE_OFFLINE_PREFIXES. All are outside this diff; no new finding or ignore.38926544592passes 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.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.createEffectreferencesuntrackreferencesaddEventListenerreferencesTest/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 flagssrc/flows/doctor-plugin-source-captures.test.ts:32, and duplicate-scan target coverage omitscli-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 merge118d7add07f1aeb355edd52d29792ca405f04991. 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.