Skip to content

Shrink the connector API: derive custom-domains + xdebug-site from the site list - #4012

Merged
youknowriad merged 2 commits into
trunkfrom
shrink-connector-derive-site-data
Jun 30, 2026
Merged

Shrink the connector API: derive custom-domains + xdebug-site from the site list#4012
youknowriad merged 2 commits into
trunkfrom
shrink-connector-derive-site-data

Conversation

@youknowriad

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Built with Claude Code. While auditing the agentic UI's connector surface we noticed two methods were pure derivations over the site list; this splits that cleanup out of the larger surface PR. I reviewed the diff.

Proposed Changes

Shrinks the agentic UI's Connector API by removing two methods that returned data the UI already holds.

getAllCustomDomains() and getXdebugEnabledSite() were each just a map/find over the full site list on the desktop side (SiteServer.getAllDetails().map/find(...)), and every SiteDetails from getSites() already carries customDomain and enableXdebug. So the UI now derives both from the existing useSites() query instead of a separate IPC round-trip:

  • useExistingCustomDomains()sites.map( s => s.customDomain ).filter( … )
  • useXdebugEnabledSite()sites.find( s => s.enableXdebug ) ?? null

The methods are removed from the Connector interface and its implementations. The desktop main-process IPC handlers stay — the legacy apps/studio renderer still calls them directly. User impact: none — behavior is identical (the create/edit forms still flag duplicate custom domains and the Xdebug conflict); this just removes two redundant data round-trips and trims the connector surface.

Testing Instructions

  • npm run typecheck --workspace=apps/ui is clean.
  • In the agentic UI: the create/edit site forms still warn on a duplicate custom domain and on enabling Xdebug when another site already has it — now derived from the loaded site list.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? — typecheck clean; no behavior change.

🤖 Generated with Claude Code

youknowriad and others added 2 commits June 30, 2026 15:49
…omains from the connector

The connector's getAllCustomDomains just mapped every site to its customDomain — data the UI already holds via getSites(). Replace it with a useSites()-derived selector in useExistingCustomDomains, removing the method from the Connector interface and all three connectors (ipc/hosted/local). Net deletion, and it closes the local-surface gap for free (the local connector returned [] only because there was no route). The desktop IPC handler stays — the legacy apps/studio renderer still calls it directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ledSite from the connector

Like getAllCustomDomains, the desktop handler was just sites.find(s => s.enableXdebug) — data the UI already holds via getSites(). useXdebugEnabledSite now derives from useSites(); the method is removed from the Connector interface and all three connectors. Closes the local-surface gap (it returned null only for lack of a route). The desktop IPC handler stays — the legacy apps/studio renderer still calls it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@youknowriad
youknowriad merged commit 91bfd32 into trunk Jun 30, 2026
11 of 12 checks passed
@youknowriad
youknowriad deleted the shrink-connector-derive-site-data branch June 30, 2026 14:12
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 4f46750 vs trunk

app-size

Metric trunk 4f46750 Diff Change
App Size (Mac) 1316.76 MB 1316.76 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk 4f46750 Diff Change
load 1109 ms 1122 ms +13 ms ⚪ 0.0%

site-startup

Metric trunk 4f46750 Diff Change
siteCreation 6493 ms 6518 ms +25 ms ⚪ 0.0%
siteStartup 6561 ms 6581 ms +20 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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

Labels

None yet

2 participants