-
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
Cover: Try allowing the auto overlay color when changing images to be more permissive #65077
Cover: Try allowing the auto overlay color when changing images to be more permissive #65077
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: -102 B (-0.01%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
The deprecation is in place for existing blocks prior to auto overlay color to not re-color when updating an image as that's a change in behavior that may be unexpected. All blocks prior to auto-color were user-specified which is why it's a deprecation. Relevant discussion here #54054 (comment) and here #54054 (review).
I think what we need is just to set |
Excellent, thanks for the extra context and the suggestion @ajlende! I'll close this out, I've opened a separate PR over in #65105 that implements this idea 👍 — let's see if we can land that approach instead. |
What?
Fixes: #64702
This PR seeks to make the Cover block's behaviour where it adds an auto overlay color more permissive than it is currently. That is, as described in #64702, currently the auto color only works up until you first save a post. One you've saved and reloaded, the deprecation in the Cover block fires, and sets
isUserOverlayColor
totrue
, preventing the auto overlay color from happening again.To recap: the auto overlay color feature is that when you upload or add an image to the Cover block, the overlay color is selected based on average colors within the image.
Why?
As described in #64702, it can be unexpected for the auto color behaviour to suddenly stop working. The boundary between reloading can also be a bit unexpected. Further, this deprecation was applying more frequently than expected, and there could be alternate ways to approach the feature. For now, this PR proposes removing the deprecation altogether, as its only purpose was to switch
isUserOverlayColor
totrue
. This might also resolve an issue described in #64480 (comment).However, I might very well be missing context as to why this deprecation was added originally, so very happy for feedback or to close out this PR if there is a better way to address this problem.
How?
save
state, and its only responsibility was to add theisUserOverlayColor
attribute and set it totrue
.Testing Instructions
Follow the reproduction steps in #64702. Basically:
Testing Instructions for Keyboard
Screenshots or screencast
This screengrab demos the auto color overlay holding up beyond reloading the post editor. It only sticks once a user sets an overlay color deliberatly:
cover-block.mp4