Skip to content

Add multisite warning to push dialog for WordPress.com targets - #2991

Merged
bcotrim merged 4 commits into
trunkfrom
stu-1377-multisite-sync-warning
Apr 8, 2026
Merged

Add multisite warning to push dialog for WordPress.com targets#2991
bcotrim merged 4 commits into
trunkfrom
stu-1377-multisite-sync-warning

Conversation

@bcotrim

@bcotrim bcotrim commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Implementation was AI-assisted. All code was reviewed and iterated on manually.

Proposed Changes

  • Add multisite detection utility that reads wp-config.php for the MULTISITE constant
  • Add getIsMultisite IPC handler and useIsMultisite React hook (same pattern as getWpVersion/useGetWpVersion)
  • Show a non-blocking warning in the push dialog when pushing a multisite site to WordPress.com (Pressable is excluded since it supports multisite)
  • Refactor push dialog warnings into a collapsible "N warnings — Show/Hide" section to keep the UI clean when multiple warnings are present
  • Replace the semi-transparent blurred bottom bar with an opaque background for better readability
Push (hidden) Push Preview Sites
image image image

Testing Instructions

  • Import a blueprint with "step": "enableMultisite" to create a multisite site
  • Connect the site to a WordPress.com site
  • Open the Push dialog — verify the multisite warning appears in a collapsible warnings section
  • Click "Hide" to collapse warnings, click "Show" to expand — verify the toggle works and padding adjusts
  • If a version mismatch warning is also present, verify both warnings show with a "2 warnings" label
  • Connect to a Pressable site instead — verify the multisite warning does NOT appear
  • Open a Pull dialog — verify no warnings section appears
  • Run npm test -- tools/common/lib/tests/is-multisite.test.ts — all 7 tests pass

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim bcotrim self-assigned this Apr 6, 2026
@bcotrim
bcotrim requested a review from a team April 6, 2026 18:43
@wpmobilebot

wpmobilebot commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 0f71438 vs trunk

app-size

Metric trunk 0f71438 Diff Change
App Size (Mac) 1249.54 MB 1249.55 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 0f71438 Diff Change
load 1863 ms 1929 ms +66 ms 🔴 3.5%

site-startup

Metric trunk 0f71438 Diff Change
siteCreation 8184 ms 8206 ms +22 ms ⚪ 0.0%
siteStartup 4851 ms 4946 ms +95 ms 🔴 2.0%

Results are median values from multiple test runs.

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

className="!p-0 !h-auto text-[12px] [&.is-link]:text-frame-text-secondary [&.is-link]:hover:text-frame-theme"
onClick={ () => setWarningsExpanded( ! warningsExpanded ) }
>
{ warningsExpanded ? __( 'Hide' ) : __( 'Show' ) }

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.

I am not sure if it is me but this is looking slightly misaligned for me by a couple of pixels:

Image

e.g. Hide and Show seem slightly higher than the warning

@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.

Thanks for all the changes - I like that there is an option to hide the warnings so that they are not taking too much space. Should we slightly drop the space below the database when the modal is open?

Image

I am also wondering - do you know if multisites could create unexpected issues for the preview sites?

@katinthehatsite

katinthehatsite commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Another question that I forgot to add to the review: I am currently seeing that when you open the modal, it shows by default the warnings and then you can hide them. Should we hide them by default so that they don't initially take too much space and then the user can open the later?

@bcotrim

bcotrim commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @katinthehatsite
I've made some changes to the layout and added the same warning on preview sites (it already existed for mismatched PHP/WordPress versions)
Can you take another look, please?

Another question that I forgot to add to the review: I am currently seeing that when you open the modal, it shows by default the warnings and then you can hide them. Should we hide them by default so that they don't initially take too much space and then the user can open the later?

It was intentional, since it could be an operation that breaks the production site, I think having them open by default increases the chance our users won't miss it.
What do you think?

@bcotrim
bcotrim requested a review from katinthehatsite April 7, 2026 10:38
@katinthehatsite

Copy link
Copy Markdown
Contributor

It was intentional, since it could be an operation that breaks the production site, I think having them open by default increases the chance our users won't miss it.
What do you think?

I don't have a strong opinion as I can see the benefits either way. I will give it another review 👀

@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.

I have retested it and I think it looks and works better. Also thanks for adding it to the preview sites 👍

I am not sure what is the expected design for this though. It might be worth confirming this with design. On my side, I don't have any further comments

@bcotrim
bcotrim merged commit dac3d53 into trunk Apr 8, 2026
10 checks passed
@bcotrim
bcotrim deleted the stu-1377-multisite-sync-warning branch April 8, 2026 11:19

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works as expected. I see the warning when pushing to WPcom but not to Pressable. I also see a warning when creating a preview site.

Push WPcom Push Pressable Preview site
Image Image Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants