Skip to content

Fix Sync modal capping at 20 sites on the Sync modal - #3356

Merged
ivan-ottinger merged 3 commits into
trunkfrom
fix-sync-modal-site-list-pagination-cap
May 6, 2026
Merged

Fix Sync modal capping at 20 sites on the Sync modal#3356
ivan-ottinger merged 3 commits into
trunkfrom
fix-sync-modal-site-list-pagination-cap

Conversation

@ivan-ottinger

@ivan-ottinger ivan-ottinger commented May 6, 2026

Copy link
Copy Markdown
Contributor

Related issues

Related issue report: p1777991412633529-slack-C06DRMD6VPZ

How AI was used in this PR

Investigation of the regression and identification of the fix were done with Claude Code. The author reviewed all findings and the diff manually.

Proposed Changes

Background

PR #3161 added server-side pagination to getWpComSites in apps/studio/src/stores/sync/wpcom-sites.ts and switched /me/sites from rest/v1.2 (unpaginated) to rest/v1.3 (paginated). The new queryFn defaults to perPage = 20 when no caller overrides it.

The redesigned modal (sync-sites-modal-selector.tsx, behind the enableBlueprintsGallery feature flag) explicitly passes perPage: 100 and wires up server-side search, so users with large accounts can still find sites past the page-1 cap.

The classic modal — the default modal for users without the feature flag — passed no perPage, so it inherited the 20-per-page default. Its search box is client-side only (filters the already-fetched list), so anything past site number 20 became unreachable. Reported in p1777991412633529-slack-C06DRMD6VPZ where a user's account had 20+ WordPress.com sites and the missing site never appeared in the modal nor in client-side search.

Testing Instructions

  1. Have access to a WordPress.com account with 20+ atomic/wpcom sites where the 21st site (or beyond) is one you can identify.
  2. Run Studio on this branch (npm start).
  3. Open a local site → Sync tab → Connect → click to open the site picker.
  4. Verify all of your WordPress.com sites appear (not just the first 20).
  5. In the Network tab, confirm the /me/sites request now uses per_page=200.
  6. Search for the previously-missing site by name in the modal's search box and confirm it appears.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
The classic Sync modal's site list was silently capped at 20 sites,
hiding any site past #20 from users with larger WordPress.com accounts.
Pass an explicit perPage of 200 to match the redesigned modal pattern.
@ivan-ottinger ivan-ottinger self-assigned this May 6, 2026
@ivan-ottinger ivan-ottinger changed the title Fix Sync modal capping at 20 sites on classic modal May 6, 2026
@ivan-ottinger
ivan-ottinger marked this pull request as ready for review May 6, 2026 08:46
@ivan-ottinger
ivan-ottinger requested a review from a team May 6, 2026 08:48

@katinthehatsite katinthehatsite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, I can see more than 20 sites in the modal:

Screen.Recording.2026-05-06.at.10.54.07.AM.mov
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 49851d2 vs trunk

app-size

Metric trunk 49851d2 Diff Change
App Size (Mac) 1404.87 MB 1404.87 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 49851d2 Diff Change
load 1504 ms 1505 ms +1 ms ⚪ 0.0%

site-startup

Metric trunk 49851d2 Diff Change
siteCreation 8085 ms 8085 ms 0 ms ⚪ 0.0%
siteStartup 4945 ms 4937 ms 8 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@ivan-ottinger
ivan-ottinger merged commit 6c852b7 into trunk May 6, 2026
10 checks passed
@ivan-ottinger
ivan-ottinger deleted the fix-sync-modal-site-list-pagination-cap branch May 6, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants