Untangling prod and staging sites - #1929
Conversation
📊 Performance Test ResultsComparing 26cf0a7 vs trunk site-editor
site-startup
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(); | ||
|
|
There was a problem hiding this comment.
Looks like unintended change :)
katinthehatsite
left a comment
There was a problem hiding this comment.
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:
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 👍
Yep, we are going to ship it w/o feature flag.
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. |
Sounds good, we can open a separate issue to handle this and to ask for design input 👍 |
|
@katinthehatsite created issue in Linear STU-918 |
075c5ec to
bb5f445
Compare
sejas
left a comment
There was a problem hiding this comment.
Great work! I confirm that the Staging and Production sites are now treated equally, and users can connect to them independently.
I confirm that existing connections were ported correctly to separate blocks, and connecting to and disconnecting sites work as expected.
I just left a suggestion to simplify the logic on src/modules/sync/components/sync-sites-modal-selector.tsx:284
| Before | After |
|---|---|
![]() |
![]() |
| * Generate updated site data to be stored in `appdata-v1.json`: | ||
| * -- Update the list of `connectedSites` with fresh data (name, URL, etc) |
There was a problem hiding this comment.
Wow! this simplified the logic a lot! 🥳
| { ! isPressable && ( | ||
| <> | ||
| <EnvironmentBadge type={ getSiteEnvironment( site ) } selected={ isSelected } /> | ||
| { site.stagingSiteIds.length > 0 && ( | ||
| <EnvironmentBadge type="staging" selected={ isSelected } /> | ||
| ) } | ||
| </> | ||
| <EnvironmentBadge type={ getSiteEnvironment( site ) } selected={ isSelected } /> | ||
| ) } | ||
| { isPressable && ( | ||
| <EnvironmentBadge type={ getSiteEnvironment( site ) } selected={ isSelected } /> |
There was a problem hiding this comment.
Now Pressable and WPcom sites can use the same code. Let's unify the logic.
<div className="flex gap-2">
<EnvironmentBadge type={ getSiteEnvironment( site ) } selected={ isSelected } />
</div>There was a problem hiding this comment.
Oh, yeah, missed it, thanks 👍


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
trunk(don't apply this patch)git checkout add/untanglingProdAndStagingSites