Global Styles: report border, shadow, outline, filter and dimension changes - #81407
Conversation
…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.
|
Size Change: +976 B (+0.01%) Total Size: 7.65 MB 📦 View Changed
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
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.
|
Flaky tests detected in 3067184. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/31457462870 sort patterns in
|
There was a problem hiding this comment.
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:
🤦 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. |
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.
…hanges (#81407) Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
What?
Report changes to
border,shadow,outline,filteranddimensionsin 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.blocksis 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_KEYSincore/render.tsx) and add atranslationMaplabel 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
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