Skip to content

Split browser-extension-settings into pairing hook + card components - #866

Merged
selfcontained merged 1 commit into
mainfrom
agt_fec454a09eb1/job-componentizer-4cf5d386
Aug 2, 2026
Merged

Split browser-extension-settings into pairing hook + card components#866
selfcontained merged 1 commit into
mainfrom
agt_fec454a09eb1/job-componentizer-4cf5d386

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

What

browser-extension-settings.tsx (640 lines) was the componentizer backlog's top candidate: one export mixing the pairing-approval state machine, connections query/revoke, setup instructions, and the paired-browser list.

Split into:

  • use-extension-pairing.ts (215) — useExtensionConnections (connections query + revoke mutation) and useExtensionPairing (approval state machine, URL pairing params, refresh-until-connected polling)
  • browser-extension-pairing-card.tsx (147) — approval card
  • browser-extension-setup-card.tsx (182) — download + install-guide card
  • browser-extension-connections-card.tsx (141) — paired browsers list
  • browser-extension-settings.tsx (640 → 111) — thin composition shell

Notes

  • Pure structural refactor — no behavior, markup, or copy changes.
  • useCopyText and the install-guide auto-close effect deliberately stay in the shell: the setup card is conditionally mounted, and useCopyText's pending timer must not move into a component that can unmount (the state-lifetime rule from the agent-card split, PR Split agent-card.tsx into header, status, details, and actions files #803).
  • The existing test file (10 tests, all through BrowserExtensionSettings) is untouched and passes.
  • Validated: finalize:web green, full e2e green (175 passed, incl. the settings pairing/setup specs), plus a Playwright visual pass on both the setup-guide and pairing-approval states.

Next run

Queued: re-audit agents-view.tsx (906 lines, regrew ~130 since the last extraction pass).

🤖 Generated with Claude Code

browser-extension-settings.tsx had grown to 640 lines mixing the pairing
approval flow, connections query/revoke, setup instructions, and the
paired-browser list. Extract:

- use-extension-pairing.ts: connection query + revoke mutation
  (useExtensionConnections) and the approval state machine with its
  refresh-until-connected polling (useExtensionPairing)
- browser-extension-pairing-card.tsx: approval card
- browser-extension-setup-card.tsx: download + install guide card
- browser-extension-connections-card.tsx: paired browsers list

The settings component is now a ~115-line shell. useCopyText and the
install-guide auto-close effect stay in the shell since the setup card
is conditionally mounted. Pure refactor: no behavior change, existing
tests untouched and passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit e86562c into main Aug 2, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_fec454a09eb1/job-componentizer-4cf5d386 branch August 2, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant