Skip to content

Bring the interactive site selector to pull-reprint#3729

Open
epeicher wants to merge 7 commits into
trunkfrom
studio-10-bring-the-interactive-site-selector-to-pull-reprint
Open

Bring the interactive site selector to pull-reprint#3729
epeicher wants to merge 7 commits into
trunkfrom
studio-10-bring-the-interactive-site-selector-to-pull-reprint

Conversation

@epeicher

@epeicher epeicher commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Related issues

Selector compared with previous one

CleanShot 2026-06-09 at 18 16 32@2x

How AI was used in this PR

Claude Code adapted the existing pull site selector (pickSyncSite) into a trimmed pull-reprint variant per the issue's guidance to copy rather than abstract (since pull is being deprecated), added unit tests for both the picker and the source-resolution flow, and verified the change — cli:build, typecheck, and the new test suites all pass. I reviewed the diff against the reference implementation and confirmed there are no behavior changes on the non-interactive paths.

Proposed Changes

When you run pull-reprint without --url and have more than one connected WordPress.com site, the command previously printed the list and aborted, forcing you to re-run with an explicit --url. Now, in an interactive terminal, it opens a searchable site picker (type to filter by name or hostname, arrow keys to navigate, Enter to select) — the same friendly selection experience already offered by pull. Cancelling with Esc or Ctrl-C is treated as a clean no-op: nothing is downloaded and no local state is created.

Existing behavior is preserved everywhere else: a single connected site is still auto-selected, the zero-site and --url/--secret paths are unchanged, and non-interactive callers (CI, the Desktop app driving the CLI) keep the original print-list-and-abort behavior so scripted usage is unaffected.

Testing Instructions

  1. Authenticate with a WordPress.com account that has two or more connected sites (studio auth login).
  2. From an interactive terminal, run:
    STUDIO_ENABLE_PULL_REPRINT=true node apps/cli/dist/cli/main.mjs pull-reprint --verbose
    
    (run npm run cli:build first)
  3. Confirm the interactive picker appears. Type to filter, select a site, and verify the pull proceeds against the chosen site.
  4. Re-run and press Esc (or Ctrl-C) at the picker — confirm it exits cleanly with no site created under ~/Studio/ and no state under ~/.studio/pulls/.
  5. Regression checks: with a single connected site it should auto-select without prompting; piping to a non-TTY (e.g. ... pull-reprint | cat) should fall back to printing the list and aborting.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

epeicher added 2 commits June 9, 2026 18:09
…interactive-site-selector-to-pull-reprint

# Conflicts:
#	apps/cli/commands/tests/pull-reprint.test.ts
@epeicher epeicher marked this pull request as ready for review June 9, 2026 16:20
…ring-the-interactive-site-selector-to-pull-reprint
@epeicher epeicher requested a review from fredrikekelund June 9, 2026 16:21
@wpmobilebot

wpmobilebot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e34606f vs trunk

app-size

Metric trunk e34606f Diff Change
App Size (Mac) 1358.09 MB 1358.09 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk e34606f Diff Change
load 1660 ms 1665 ms +5 ms ⚪ 0.0%

site-startup

Metric trunk e34606f Diff Change
siteCreation 9043 ms 9063 ms +20 ms ⚪ 0.0%
siteStartup 4396 ms 4398 ms +2 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants