Agentic UI: Site Creation#3941
Conversation
…tion # Conflicts: # apps/studio/src/modules/sync/lib/ipc-handlers.ts
📊 Performance Test ResultsComparing 6ef4ab7 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) |
bcotrim
left a comment
There was a problem hiding this comment.
On this branch my Pressable site no longer shows up in the sync sites list — on
trunk it does. I traced it to the filter → filters rename on /me/sites
(756ed7c): the singular filter isn't a real API param so it's silently ignored
(all sites come back), while the corrected filters=atomic,wpcom actually filters
and drops Pressable (Jetpack-hosted, not Atomic/WPcom). Confirmed locally —
reverting just the rename brings the site back.
This is a regression, not just a behavior change: The filters filter is the right idea (it correctly drops a8c/non-syncable sites), it just shouldn't drop Pressable too.
Since this filtering + environment-label work (756ed7c + 12c975a) is unrelated
to the site-creation scope here, could we pull it into its own PR? That clears the
regression from this PR and lets us land the filtering properly with focused testing and discussion.
…uping in connect picker
…tion # Conflicts: # apps/ui/src/data/core/connectors/hosted/index.ts
…aged list client-side
Related issues
How AI was used in this PR
This PR is AI-assisted and intentionally large. AI was used to draft the initial agentic UI onboarding implementation, iterate on UI states, identify duplicated/default UI behavior, and review cross-app risk. The implementation has been manually reviewed and adjusted, especially around shared sync behavior, default UI impact, and WordPress.com site filtering.
Because of the PR size, reviewers should not treat the raw diff as the primary review artifact. Please use the review guide below to focus on the product and architecture decisions this code implies.
Executive summary
This PR adds an Add Site onboarding flow to the agentic UI (
apps/ui,ui-classic) so users can build a new site, start from a blueprint, import a backup, or connect a WordPress.com/Pressable site. The main intent is to bring the core Add Site flows into the agentic UI while the default Studio UI still exists.Some shared helpers were moved into
tools/commonso the default UI and agentic UI display the same blueprint curation, site thumbnails, and environment labels. The connect flow creates a local site shell, persists the WordPress.com connection, and starts a first pull from the live site. That lifecycle is intentionally not fully solved in this PR; durable first-pull lifecycle/error state is tracked separately in STU-1956.The most important review is not line-by-line CSS. Please focus on whether the flow boundaries, shared sync/API changes, and agentic-vs-default UI architecture are acceptable.
Proposed Changes
tools/commonso the default UI and agentic UI do not drift./me/sitesv1.3 API and the documentedfiltersparam.Review guide
Please focus review here
Overall Add Site flow shape
apps/ui/src/ui-classic/router/route-onboarding-home/index.tsxConnect remote site architecture
apps/ui/src/ui-classic/router/route-onboarding-connect/index.tsxapps/ui/src/data/queries/use-wpcom-sites.tsapps/studio/src/modules/sync/lib/ipc-handlers.tsShared sync/API behavior
tools/common/lib/sync/sync-api.tstools/common/lib/sync/transform-sites.tsapps/studio/src/stores/sync/wpcom-sites.tsapps/cli/lib/api.ts/me/sitesv1.3 pagination,filters=atomic,wpcom, staging/environment handling, and CLI/default UI impacts acceptable?Shared helpers extracted from default UI
tools/common/lib/blueprint-curation.tstools/common/lib/sync/environment-utils.tstools/common/lib/sync/mshots.tsState handoff patterns
apps/ui/src/lib/pending-slot.tsapps/ui/src/lib/pending-backup.tsapps/ui/src/lib/pending-blueprint.tsapps/ui/src/hooks/use-add-site-listener.tsOkay to skim
apps/ui.Diff breakdown
/me/sitesfetch now affects CLI sync site resolution; default UI staging/environment handling was aligned.Screenshots
Known tradeoffs / follow-ups
/me/sitesfetch now uses v1.3 pagination. This should improve large-account behavior, but it is shared with CLI/default UI and deserves review.Safety checklist
/me/sitesmoved to v1.3 for shared syncable-site fetching; uses documentedfiltersparam.Testing Instructions
Automated checks used during this PR:
npx eslint --fixon modified TypeScript/TSX filesnpm run typechecknpm test -- apps/ui/src/data/queries/use-wpcom-sites.test.tsx apps/ui/src/hooks/use-add-site-listener.test.tsxnpm -w @studio/ui run dev:web -- --host 127.0.0.1 --port 5300, then browser smoke checks for/onboarding,/onboarding/blueprint,/onboarding/create, and/onboarding/connectin light and dark color schemes. The standalone web target renders these routes; its expected backend-connection failures were filtered out of the console check.Suggested reviewer checks:
/me/sitesbehavior changed.Pre-merge Checklist