Block Editor: Avoid rendering empty Slot for block alignments#55689
Merged
Conversation
Member
Author
|
@jsnajdr, we need to try a different approach to reduce store subscription numbers for this control. Maybe something like #55345. However, I need to double-check if Update: Here's the draft PR #55692. |
|
Size Change: +6 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
ntsekouras
approved these changes
Oct 30, 2023
ntsekouras
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thank you!
Member
Author
|
Thanks for testing, Nik! |
Member
|
Oops, thanks for fixing the regression I introduced 😨 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes #55687.
A regression was introduced in #55449.
PR restores the
useAvailableAlignmentscall in thewithToolbarControlsHoC to avoid rendering an empty block toolbars slot.P.S. A similar optimization was attempted in #34593 but later was restored via #35822 for similar reasons.
Why?
There's a mismatch between values returned by
getValidAlignmentsanduseAvailableAlignments. The latter takes alignments available for the given layout, which will be none for the root-level blocks in the site editor (#30079).Testing Instructions
Screenshots or screencast