Shrink the connector API: derive custom-domains + xdebug-site from the site list - #4012
Merged
Merged
Conversation
…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>
Collaborator
📊 Performance Test ResultsComparing 4f46750 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
studio uisurface PR (Add the studio ui local web surface #3953) so it can land independently.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
ConnectorAPI by removing two methods that returned data the UI already holds.getAllCustomDomains()andgetXdebugEnabledSite()were each just amap/findover the full site list on the desktop side (SiteServer.getAllDetails().map/find(...)), and everySiteDetailsfromgetSites()already carriescustomDomainandenableXdebug. So the UI now derives both from the existinguseSites()query instead of a separate IPC round-trip:useExistingCustomDomains()→sites.map( s => s.customDomain ).filter( … )useXdebugEnabledSite()→sites.find( s => s.enableXdebug ) ?? nullThe methods are removed from the
Connectorinterface and its implementations. The desktop main-process IPC handlers stay — the legacyapps/studiorenderer 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/uiis clean.Pre-merge Checklist
🤖 Generated with Claude Code