Fix Sync modal capping at 20 sites on the Sync modal - #3356
Merged
Conversation
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.
…list-pagination-cap
ivan-ottinger
marked this pull request as ready for review
May 6, 2026 08:46
katinthehatsite
approved these changes
May 6, 2026
katinthehatsite
left a comment
Contributor
There was a problem hiding this comment.
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
Collaborator
📊 Performance Test ResultsComparing 49851d2 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
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
perPage: 200touseGetWpComSitesQueryin the classic Sync modal so the site list isn't silently capped at the 20-per-page default introduced in Redesign site list and Add Site flow with richer sync metadata #3161.Background
PR #3161 added server-side pagination to
getWpComSitesinapps/studio/src/stores/sync/wpcom-sites.tsand switched/me/sitesfromrest/v1.2(unpaginated) torest/v1.3(paginated). The newqueryFndefaults toperPage = 20when no caller overrides it.The redesigned modal (
sync-sites-modal-selector.tsx, behind theenableBlueprintsGalleryfeature flag) explicitly passesperPage: 100and 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
npm start)./me/sitesrequest now usesper_page=200.Pre-merge Checklist