Skip to content

Conversation

@nightnei
Copy link
Contributor

@nightnei nightnei commented Oct 24, 2025

Fixes STU-907

Proposed Changes

We want to display each site separately in the Sync dialog, so we no longer group production and staging together. We need this to be consistent with the "create site from wpcom" stepper.

Currently WPcom sites group production and staging sites under the same row. So with this PR we split them, so each row has only a site. That's the current behaviour for Pressable sites.

Also, I analyzed the code, and I don't see the necessity to have any migration. We just stopped using stagingSiteIds, and they will be cleaned up automatically over time.

Testing Instructions

  1. Open wordpress.com and create site and staging site
  2. Checkout out to trunk (don't apply this patch)
  3. Open Sync tab in studio and connect that site
    Screenshot 2025-10-24 at 13 35 25
  4. git checkout add/untanglingProdAndStagingSites
  5. Open Sync tab and assert that now you see prod and staging sites as separate entities
    Screenshot 2025-10-24 at 13 45 04
  6. Click on "Connect another site" and assert that you see both sites as separate entities and both of them "Already connected" and disabled
    Screenshot 2025-10-24 at 13 45 41
  7. Try to push/pull and assert that it still works well after untangling
  8. Open wordpress.com and delete staging site
  9. Open Studio and assert that you see:
    Screenshot 2025-10-24 at 13 58 21
  10. Click on "Disconnect" button
  11. Open wordpress.com and delete main site
  12. Open wordpress.com and delete staging site:
    Screenshot 2025-10-24 at 14 02 38
  13. Open wordpress.com and create new site and staging site
  14. Open Sync tab in studio, click on "Connect another site"
  15. Assert that you see both prod and staging sites, created in 14-th step
  16. Connect one and then the second one
  17. Assert that everything went well
  18. Try to push/pull and assert that it still works well

@nightnei nightnei requested review from a team and sejas October 24, 2025 16:01
@nightnei nightnei self-assigned this Oct 24, 2025
@github-actions
Copy link

github-actions bot commented Oct 24, 2025

📊 Performance Test Results

Comparing 0f03c1c vs trunk

site-editor

Metric trunk 0f03c1c Diff Change
load 12283.00 ms 9973.00 ms -2310.00 ms 🟢 -18.8%

site-startup

Metric trunk 0f03c1c Diff Change
siteCreation 19127.00 ms 17224.00 ms -1903.00 ms 🟢 -9.9%
siteStartup 5990.00 ms 6008.00 ms +18.00 ms 🔴 0.3%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

const isModalOpen = useRootSelector( connectedSitesSelectors.selectIsModalOpen );
const { connectedSites } = useConnectedSitesData();
const { syncSites, isFetching, refetchSites } = useSyncSitesData();

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like unintended change :)

Copy link
Contributor

@katinthehatsite katinthehatsite left a comment

Choose a reason for hiding this comment

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

This worked well for me 👍 I did not spot any regressions. Also, the code looked good on my end and I don't have any further concerns:

Image

Two questions that I had were:

  • is this change something that we want to ship behind the feature flag or should this be available right away to the user?
  • I am finding the grouping of sites a bit messy in the modal to connect sites now that they are separate. I am wondering if we should improve how the sites are organized in there e.g. perhaps first showing all production sites and then all staging sites etc. It does not need to be handled as a part of this PR though, just something to consider further in this project 👍

@nightnei
Copy link
Contributor Author

nightnei commented Oct 27, 2025

@katinthehatsite

is this change something that we want to ship behind the feature flag or should this be available right away to the user?

Yep, we are going to ship it w/o feature flag.

I am finding the grouping of sites a bit messy in the modal to connect sites now that they are separate. I am wondering if we should improve how the sites are organized in there e.g. perhaps first showing all production sites and then all staging sites etc. It does not need to be handled as a part of this PR though, just something to consider further in this project 👍

I was also thinking that we should reconsider the design, for example, we can make sections narrower, at least remove the gray line between the site name and the URL, since now it makes feeling like it's 2 different items. But as you menthioned and I agree - it should be a separate issue. This PR is preety big, so I would keep it focused on one thing - untangling.

@katinthehatsite
Copy link
Contributor

But as you menthioned and I agree - it should be a separate issue. This PR is preety big, so I would keep it focused on one thing - untangling.

Sounds good, we can open a separate issue to handle this and to ask for design input 👍

@nightnei
Copy link
Contributor Author

@katinthehatsite created issue in Linear STU-918
@sejas when you get a chance, could you please also take a look at this PR and at the created issue

@nightnei nightnei force-pushed the add/untanglingProdAndStagingSites branch from 075c5ec to bb5f445 Compare October 27, 2025 14:59
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