Skip to content

Global Styles: report border, shadow, outline, filter and dimension changes - #81407

Merged
ramonjd merged 4 commits into
trunkfrom
update/global-styles-change-list
Aug 11, 2026
Merged

Global Styles: report border, shadow, outline, filter and dimension changes#81407
ramonjd merged 4 commits into
trunkfrom
update/global-styles-change-list

Conversation

@ramonjd

@ramonjd ramonjd commented Aug 11, 2026

Copy link
Copy Markdown
Member

What?

Report changes to border, shadow, outline, filter and dimensions in the global styles changelist.

Why?

The changelist compared four top-level style properties by name; the styles engine renders nine. Changing only one of the missing five was reported as no change at all.

This affects site-wide styles only. A change inside styles.blocks is named after the block rather than the property, so block-level changes were already covered.

How?

Take the compared properties from the same set the engine renders (STYLE_KEYS in core/render.tsx) and add a translationMap label for each. A property without a label is dropped, so both halves are required.

Follow up to #81373, which calls the changelist per block and so relies on this list for every block summary.

Testing Instructions

  1. Open the Site Editor -> Styles -> Shadows, and set a shadow on the site.
  2. Click Save. The panel lists the pending change as "Shadow styles." On trunk it is absent from the list.
  3. Save, then open Styles -> Revisions. The latest revision names Shadow too.
  4. Repeat with a site-wide outline, filter or dimension change.

Testing Instructions for Keyboard

No UI was added. The strings appear in the existing save panel and revisions list, which are reachable and readable as before.

Screenshots or screencast

Screenshot 2026-08-11 at 1 57 49 pm Screenshot 2026-08-11 at 2 00 26 pm Screenshot 2026-08-11 at 1 59 14 pm

…hanges

The changelist compared four style properties by name. The styles engine
renders nine, so changing only a border, shadow, outline, filter or
dimension reported no change at all: the revisions list and the
pre-publish save panel both told the user nothing had changed.

Take the compared properties from the same set the engine renders, and
add the labels each one needs. A property without a translationMap entry
is dropped, so both halves are required.
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Size Change: +976 B (+0.01%)

Total Size: 7.65 MB

📦 View Changed
Filename Size Change
build/scripts/core-data/index.min.js 36.9 kB +69 B (+0.19%)
build/scripts/edit-site/index.min.js 311 kB +79 B (+0.03%)
build/scripts/editor/index.min.js 510 kB +828 B (+0.16%)

compressed-size-action

@ramonjd ramonjd self-assigned this Aug 11, 2026
@ramonjd ramonjd added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Aug 11, 2026
@ramonjd
ramonjd requested a balanced review from Copilot August 11, 2026 04:19
@ramonjd
ramonjd marked this pull request as ready for review August 11, 2026 04:19
@github-actions

github-actions Bot commented Aug 11, 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.

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

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

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

Copilot AI 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.

Pull request overview

Adds missing global style properties to changelist reporting for pending saves and revisions.

Changes:

  • Reports border, shadow, outline, filter, and dimension changes.
  • Adds regression tests for individual and combined changes.
  • Documents the bug fix in the package changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/global-styles-engine/src/utils/get-global-styles-changes.ts Expands compared style keys and translations.
packages/global-styles-engine/src/test/get-global-styles-changes.test.ts Tests the newly reported properties.
packages/global-styles-engine/CHANGELOG.md Records the bug fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 3067184.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/31457462870
📝 Reported tests:

sort patterns in /test/e2e/specs/site-editor/patterns.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → POST http://localhost:8889/wp-json/wp/v2/blocks
    - user-agent: Playwright/1.62.1 (x64; ubuntu 24.04) node/20.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: ba1ef5781a
    - content-type: application/json
    - content-length: 133
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1786594289%7CKkVQssYE2OcOitwpZvjdoaAtWfkn3L9kI44I5bA3w1R%7C5ad9d05cf1a54a4853e7d5caf0045101de5a58b752b65e6a0e953d6bd69ce411; wp-settings-time-1=1786422294

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at RequestUtils.createRecord (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/records.ts:20:14)
    at RequestUtils.createBlock (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/blocks.ts:54:14)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/patterns.spec.js:209:17

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

This code change looks good to me 👍

The changelist compared four top-level style properties by name; the styles engine renders nine. Changing only one of the missing five was reported as no change at all.

In terms of the UI impact, in practice it seems that we don't have root-level UI controls for most of the added properties. So I'm assuming this is more of a code-quality change, or did we have in mind that one day we might have UI controls for more of this? This comment is in no way a blocker, though!

I was curious which ones we do have a UI for, so got Claude to produce the following table (I think it's wrong about dimensions, though, as we don't show minHeight, width, height at the root level):

Property Reachable from the root Global Styles UI?
dimensions Yes. Styles → Layout renders DimensionsPanel with minHeight, minWidth, width, height enabled (dimensions-panel.tsx), writing to root styles.dimensions.
border No root panel. useHasBorderPanel/BorderPanel are only wired up in screen-block.tsx — per-block, which already diffs via the blocks subtree.
outline No panel anywhere in Global Styles. It's a block-supports/element concern.
filter No root panel. FiltersPanel is block-screen only; duotone at root isn't exposed.
shadow No. Styles → Shadows edits settings.shadow.presets.*, not styles.shadow — and settings was already being compared.

And of course, apologies if I got this wildly wrong and missed something obvious! Just wanted to check if there is a UI change that's visible here that I should be testing. So far things seem to be working fine:

Image

Comment thread packages/global-styles-engine/src/utils/get-global-styles-changes.ts Outdated
Comment thread packages/global-styles-engine/src/test/get-global-styles-changes.test.ts Outdated
@andrewserong

Copy link
Copy Markdown
Contributor

So I'm assuming this is more of a code-quality change

🤦 I wasn't thinking, sorry, just saw the connection with your other PR in #81373 for the indicators, so I'm assuming this one's necessary for that one.

@ramonjd

ramonjd commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

In terms of the UI impact, in practice it seems that we don't have root-level UI controls for most of the added properties. So I'm assuming this is more of a code-quality change, or did we have in mind that one day we might have UI controls for more of this? This comment is in no way a blocker, thou

Thank you for testing @andrewserong!!

You're right - you won't see the border etc for top level, or even block level changes for save or revisions, but yes, the intention was to pimp up the summaries for #81373 👍🏻

Say why the compared list is not a reuse of the engine's STYLE_KEYS: the
order here is the order the changes are read in, so it is sorted by what
a person is most likely to have changed rather than for rendering.

Fold the separate property tests into the existing fixtures. They were
written to show a before and an after, which stops being worth saying
once the properties are simply reported like any other.
@ramonjd
ramonjd enabled auto-merge (squash) August 11, 2026 07:02
@ramonjd
ramonjd merged commit 7f8f873 into trunk Aug 11, 2026
44 checks passed
@ramonjd
ramonjd deleted the update/global-styles-change-list branch August 11, 2026 07:38
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 11, 2026
shail-mehta pushed a commit that referenced this pull request Aug 12, 2026
…hanges (#81407)

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
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 [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants