Skip to content

Conversation

@gcsecsey
Copy link
Contributor

@gcsecsey gcsecsey commented May 13, 2025

Related issues

Proposed Changes

While working on 182791-ghe-Automattic/wpcom I ran into the issue of not being able to add more preview sites. The Usage tab showed 9 sites but I couldn't press the Create preview site button to add a new one.

  • Update the snapshot count in create-preview-button.tsx to use the same state as user-settings.tsx for the number of active sites

Testing Instructions

  • Follow the test instructions on 182791-ghe-Automattic/wpcom
  • Make sure that when the usage tab shows <10 active sites, the Create preview site button is enabled
  • Check that when you have 10 active preview sites, the Create preview site button is disabled
9 sites 10 sites
CleanShot 2025-05-13 at 15 21 29@2x CleanShot 2025-05-13 at 15 21 16@2x

Pre-merge Checklist

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

@gcsecsey gcsecsey requested a review from a team May 13, 2025 14:24
Copy link
Contributor

@fredrikekelund fredrikekelund left a comment

Choose a reason for hiding this comment

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

Good catch 👍 I haven't tested it, but I can verify that this is the correct behavior.

@gcsecsey
Copy link
Contributor Author

We double-checked this with @wojtekn just now, and it seems that the root cause of the issue was the state mismatch here, the backend was counting active sites correctly. I went ahead and closed 182791-ghe-Automattic/wpcom now.

Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

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

Nice find! The proposed change looks good and works as expected. 👌🏼

I was able to reproduce the issue with only one active preview site and the PR fixes it:

Before After
Markup on 2025-05-13 at 17:45:53 Markup on 2025-05-13 at 17:53:26

@gcsecsey gcsecsey merged commit df57f35 into trunk May 13, 2025
9 checks passed
@gcsecsey gcsecsey deleted the stu-484-cant-add-more-than-3-preview-sites branch May 13, 2025 16:08
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.

5 participants