Skip to content

Editor: Clarify the site-wide impact of 'Apply Globally'#79436

Closed
yyppsk wants to merge 3 commits into
WordPress:trunkfrom
yyppsk:fix/79343-global-block-overwrites-undo
Closed

Editor: Clarify the site-wide impact of 'Apply Globally'#79436
yyppsk wants to merge 3 commits into
WordPress:trunkfrom
yyppsk:fix/79343-global-block-overwrites-undo

Conversation

@yyppsk

@yyppsk yyppsk commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #79343.

This PR updates the Apply globally flow to use a confirmation modal before applying block styles site-wide.

Why?

Applying styles globally has a broad impact, so users should explicitly confirm this action at the moment they trigger it. This approach makes the site-wide consequences clearer while avoiding redundant messaging later in the save flow.

How?

  • Added a confirmation modal shown when Apply globally is clicked.
  • Added explicit confirmation actions in the modal:
    • Cancel: dismisses without applying changes
    • Apply: proceeds with global style application
  • Kept the existing Undo snackbar behavior after applying.
  • Kept the existing Global Styles change listing behavior in the Save modal without adding additional explanatory copy.

Testing Instructions

  1. Open the editor in a block theme.
  2. Select a block with supported style controls (for example Group).
  3. Change a supported style (color, spacing, typography, or border).
  4. Click Apply globally.
  5. Confirm a modal appears asking for confirmation.
  6. Click Cancel and verify no global style change is applied.
  7. Click Apply globally again, then click Apply in the modal.
  8. Verify the style is applied globally and snackbar appears with Undo.
  9. Click Undo and confirm the applied global style reverts.

Testing Instructions for Keyboard

  1. Navigate to Apply globally via keyboard.
  2. Press Enter or Space to open the confirmation modal.
  3. Verify focus moves into the modal.
  4. Use keyboard to activate Cancel and confirm it closes without applying.
  5. Re-open modal and activate Apply using keyboard.
  6. Verify global apply succeeds and Undo snackbar is reachable.

Screenshots or screencast

Before:

  • Apply globally relied on the existing save flow without an upfront confirmation step.
Screen.Recording.2026-06-24.at.1.41.40.AM.mov

After

  • Apply globally opens a confirmation modal before applying site-wide changes.
image

Use of AI Tools

Used GitHub Copilot to help refine the implementation, copy, and PR description.

…ning and clearer save modal

- Add persistent info notice in block inspector after "Apply Globally" is clicked
- Notice displays: "These styles will apply to all [Block] blocks across the site when you save."
- Wire notice to actual Global Styles dirty state to auto-clear after save/undo
- Simplify entity record item display for global styles (no custom labels or duplicate bullets)
- Improve save modal with clearer phrasing: "This will update site-wide styles for:"
- Use standard WordPress Notice component with status="info" for restrained visual treatment
- Maintain minimal CSS styling (16px margin only, no custom colors)
@github-actions github-actions Bot added the [Package] Editor /packages/editor label Jun 23, 2026
@yyppsk yyppsk changed the title Enhance 'Apply Globally' UX with persistent notice and improved modal Editor: Clarify the site-wide impact of 'Apply Globally' Jun 23, 2026
@yyppsk yyppsk marked this pull request as ready for review June 23, 2026 11:25
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @hohoho-agency.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: hohoho-agency.

Co-authored-by: yyppsk <pranjalpratapsingh@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: fcoveram <fcoveram@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added the [Type] Enhancement A suggestion for improvement. label Jun 23, 2026
@yyppsk yyppsk marked this pull request as draft June 23, 2026 16:59
- open a confirmation modal when "Apply globally" is clicked
- apply changes only after explicit confirmation
- remove prior persistent info-notice flow
- remove prior save-modal text "This will update site-wide styles for:"
@yyppsk yyppsk marked this pull request as ready for review June 23, 2026 21:01
@t-hamano t-hamano added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jul 3, 2026
@t-hamano

t-hamano commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@yyppsk Thanks for the PR!

I found that #79839 allows users to select the style they want to apply within a modal. I believe it would be ideal to proceed with #79839. cc @aaronrobertshaw

I'd like to close this PR, but thanks for your effort!

@t-hamano t-hamano closed this Jul 3, 2026
@yyppsk

yyppsk commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@yyppsk Thanks for the PR!

I found that #79839 allows users to select the style they want to apply within a modal. I believe it would be ideal to proceed with #79839. cc @aaronrobertshaw

I'd like to close this PR, but thanks for your effort!

Sure thing! Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global blocks overwrites control

2 participants