-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Styles: Add block variations to the isactive style variation calculation #62798
Conversation
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. |
Size Change: +54 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the ping to review @scruffian 👍
This PR highlighted some code that was missed in the recent efforts to switch shared variations from styles.blocks.variations
to styles.variations
.
Those changes landed yesterday in #62712. The result is that the useResolvedBlockStyleVariationsConfig
has no effect and isn't required anymore. I've created a PR to remove that hook entirely in #62808.
On trunk
I can't replicate the original issue so I think we might be able to close both the issue and this PR.
What?
Fixes #62758.
This processes style variation previews in the same way that we process variations when they are committed so that they are formatted the same way and can be detected as the same.
Why?
This is necessary so that style variations are marked as active:
How?
Process the style variation with
useResolvedBlockStyleVariationsConfig
before comparing it to the saved user variation.There are some other possibilities for how to solve this:
useResolvedBlockStyleVariationsConfig
call to insideareGlobalStyleConfigsEqual
so that other uses of this function benefit from the change.useResolvedBlockStyleVariationsConfig
up the call stack so that the variation is processed before this point.Testing Instructions
Screenshots or screencast