Skip to content
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 block overlay with detected color does not work once saved #64702

Closed
richtabor opened this issue Aug 22, 2024 · 5 comments · Fixed by #65105
Closed

Cover block overlay with detected color does not work once saved #64702

richtabor opened this issue Aug 22, 2024 · 5 comments · Fixed by #65105
Assignees
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@richtabor
Copy link
Member

The current functionality for detecting dominant color and applying it to the cover block's overlay is nice, but it's limited—making it feel inconsistent.

The cover block has the isUserOverlayColor attribute, which when set to true does not detect color and apply a new customOverlayColor.

I propose that this value should only be true if the user actually picked a different color than what was detected and applied.

If I never changed the previously generated overlay color value, and I replaced the image, I'd expect the block to detect and apply the new image's dominant color to the overlay again. This works today — but again, only if I don't save the post. Once it's saved, isUserOverlayColor is no longer false and you're stuck with the previously saved overlay color unless you manually change it.

Related #54054.

Visual

CleanShot.2024-08-21.at.20.55.50.mp4
@richtabor richtabor added [Type] Bug An existing feature does not function as intended [Block] Cover Affects the Cover Block - used to display content laid over a background image labels Aug 22, 2024
@richtabor richtabor changed the title Cover block overly with detected color does not work once saved Cover block overlay with detected color does not work once saved Aug 22, 2024
@andrewserong
Copy link
Contributor

Interesting bug! I'm not sure of a solution yet, but while testing this out, I found that if I comment out this line from the last deprecation for the block, then replacing the image after reloading the post works again to update the cover overlay color:

This points to that deprecation's migrate function running on newly saved post content, which I think it probably shouldn't be. We'll likely need to dig into that deprecation's logic a little further to see why it's firing when it shouldn't.

@andrewserong andrewserong self-assigned this Sep 4, 2024
@andrewserong
Copy link
Contributor

Just assigning this one to myself since I've started looking into it, but anyone else is welcome to look, too, of course! 🙂

@Mamaduka
Copy link
Member

Mamaduka commented Sep 4, 2024

@andrewserong, the new deprecation seems to be broken. See #64480 (comment).

@andrewserong
Copy link
Contributor

I have a tentative fix open over in #65077 that's proposing removing the deprecation. Very happy for feedback on it, either way!

@andrewserong
Copy link
Contributor

I've opened an alternative fix over in #65105. Thanks to @ajlende for the guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
Status: Done
3 participants