Repository navigation
refactor(ui): finish browser panel ownership and component refs - #175293
Conversation
…ents-browser-final
…ents-browser-final
…ents-browser-final
|
🦞👀 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30957b8284
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export type BrowserPanelElement = HTMLElement & | ||
| BrowserPanelInputs & | ||
| BrowserPanelMethods & | ||
| Pick<BrowserPanelPresentation, "hostedTabs" | "activeHostedTabId" | "updateComplete">; |
There was a problem hiding this comment.
Migrate remaining renderRoot consumers
Removing renderRoot from the browser-panel host leaves unchanged callers reading undefined: ui/src/pages/chat/chat-pane-session-panel-toggle.test.tsx:428-433 now compares undefined with "Local preview", while ui/src/lib/board/widgets/browser.test.ts:113-118 and :254-255 expect queries through that accessor to return elements or null. These suites will fail whenever they run, so either preserve the light-DOM accessor or migrate all remaining callers to query the panel directly as part of this cutover.
AGENTS.md reference: AGENTS.md:L52-L53
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR replaces the remaining Browser presentation class and generic panel adapters with a retained factory and native Solid bridge, and converts nearby components to owned refs and listeners. Example: An embedded Browser panel displaying https://example.test/remote is detached and reattached with unchanged inputs.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this maintainer-authored refactor open; its direction is sound, but incomplete caller migration and broken replacement tests need repair before merge. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI Browser presentation connects host properties and DOM lifecycle to synchronous browser navigation, capture, native-browser, and dock owners, producing rendered controls and hosted-tab notifications. flowchart LR
A[Chat and dashboard callers] --> B[Native Solid bridge]
B --> C[Browser presentation factory]
C --> D[Synchronous browser owner]
C --> E[Dock layout owner]
D --> F[Gateway and native browser]
C --> G[Solid browser view]
Technical reviewBest possible solution: Complete the caller migration and repair the replacement tests while preserving the existing navigation, background-refresh, and bridge disposal contracts. Do we have a high-confidence way to reproduce the issue? Source inspection and exact-head CI annotations establish the stale-accessor and replacement-test failures; no local execution or current-main product reproduction was performed. Is this the best way to solve the issue? The retained factory and existing native bridge fit the established ownership direction, but the replacement tests must preserve the behavior their predecessors protected. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 22799f805a84. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -126, Tests -82. Total -208 across 23 files. Added test files: 1. View PR surface stats
Review metrics
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 17, 2026, 3:45 AM ET / 07:45 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…claw#175293) * refactor(ui): replace browser presentation class with factory * refactor(ui): simplify browser bridge completion lookup * refactor(ui): retire shared panel adapters and own component refs * fix(ui): preserve browser host completion and public test contracts
The Browser panel routes rendering through a generic panel controller and bridge adapter. Replace that inheritance with one retained presentation factory, the native Solid bridge, and owner-scoped setup and cleanup. Keep synchronous navigation and native-browser admission in the existing TypeScript owner. The host completion promise still waits for the native bridge commit before presentation completion, and reattaching a host resumes capture even when its inputs are unchanged.
Retire the generic panel adapters and their controller-only tests after migrating their last consumer. Browser tests exercise public host methods, native events, rendered DOM and Gateway fixtures. FilePreview, Lightbox, HomeSession and OptionCard now use owned DOM refs or owner-scoped listeners; DockResizer and Sparkline use Solid class arrays. Tags, classes, routes and lazy imports remain unchanged.
Proof
pnpm tsgo:uipassed on the final integrated sourcepnpm deadcode:knippassed after removing the unused adapters7dcd9a34be0d3e67df7c81ff306e6d2579db322bvs heade9c355f38fe: canonical builds and strict paired check passed; startup JS 337,547 → 337,542 B gzip (−5 B), 7 → 7 requests; CSS 38,697 → 38,697 B gzip, 1 → 1 request; chat boot −82 B, New boot −59 Bci:fullrun39015028639complete: all 3 UI unit shards pass; six unrelated or main-matching root jobs retained via native admin evidenceCI repair
The first full run (
39013602031) exposed three Browser cases, two Board cases, one Chat case and coupled type errors caused by this cutover. The repair preserves the disconnected completion result, exercises refresh through the public browser-toggle entry point instead of navigation, and migrates Board/Chat assertions from the removed LitrenderRootto the native light-DOM host. All six affected behavior cases and both failed UI core-type leaves passed once locally, as did UI types and scoped lint/format. The identity, focus, error and authorization assertions remain intact. The separate Reader metadata suite import failure was inherited and has been repaired on main by #175297 (6249e5b5051b). The original auto request was confirmed cancelled before the fix push; landing will use native replacement recovery for the reviewed repair head.Size and ownership
Final true-scope metrics, including both adapter deletions and the two coupled Board/Chat tests: 25 changed paths and production LOC 2,363 → 2,237 (−126). Controller-pattern matching lines are 0 → 0; the removed Browser subclass inherited the lifecycle under a name outside that regex. Render effects fall 2 → 0, direct listeners 6 → 3, and semantic DOM queries 13 → 2.
createEffectchanges 5 → 6 for native presentation/geometry after committed DOM;untrackremains 4 → 4. No effect copies derived state. Test/helper LOC is 4,015 → 3,934 (−81).These metrics use the actual integrated main merge base above after Terminal landed and all four generic panel adapter/test files were deleted. No dependency or startup-boundary changes were made. Paired builds used the same existing toolchain and normalized build identity. The baseline initially lacked per-plugin dependency links; linking the existing package dependencies resolved that tooling prerequisite without an install. No cloud lease was created.
Inspected before/after captures
All captures use the same synthetic fixture and viewport. Crops focus on the touched component; complete frames were inspected for incidental data before upload.
Full CI attribution
Repaired-head run
39015028639is complete. Latest scheduled main run39013936147fails the same five UI cases with the same assertion: both child-expansion variants at line 70, pinned-rail cold load at line 352, mobile Sessions inset at line 400, and Agents catalog model/fallback persistence at line 278. The older scheduled run passed the Agents case; only the latest matching evidence is used.checks-fast-baseline-ratchetssrc/process/exec-scope-settlement.test.ts:35; failed test, reaper, checker and baseline byte-identical to the tested main parentcheck-test-types-core-5checks-ui-e2e (1/9)checks-ui-e2e (3/9)checks-ui-e2e (7/9)checks-ui-e2e-real-gateway (2/2)The CI checkout is
bff49af7ac720f82f25e9db7574a0627bae80b1e, with ordered parents9ff9472609c79f3f753c7471548c1226bd99341cand repaired heade9c355f38fe8552677deb4602f255be264e3cc1d. Local merge-tree reproduces the exact tree and 25-path authored scope. Native replacement/admin recovery retains all six failed jobs and the downstream CI gate; this is not a claim that full CI passed.