You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
This PR fixes a regression, likely introduced in #56914, that restores the visualizer's behavior of hiding the Block Toolbar when the Block Interface is hidden.
Why?
An additional isBlockInterfaceHidden() check seems to have been omitted here:
A check for ! isBlockInterfaceHidden() was added while determining _showBlockToolbarPopover.
Additional Context
If we choose not to fix this regression, we should at least clean up the following unused code:
The global state is updated via hideBlockInterface and showBlockInterface, but this serves no purpose since isBlockInterfaceHidden() is currently unused.
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 props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! As a nitpick, ! isBlockInterfaceHidden() could be first in the list of conditions so when it evaluates to false it short-circuits the rest of them.
I agree with restoring this functionality because it does seem to have been unintentionally removed. That said, after testing, I do find it can feel a little distracting or mysterious in some cases. I guess mainly when there are no padding values to visualize but the block toolbar hides anyway. This and a few other details are covered in #45503 but I’m not suggesting we pursue any of that in this PR.
Thanks for the review, @stokesman! I've implemented the suggested changes. As a follow-up to this PR, I'd like to work on the enhancements outlined in #45503.
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?
Closes #68711
This PR fixes a regression, likely introduced in #56914, that restores the visualizer's behavior of hiding the
Block Toolbar
when theBlock Interface
is hidden.Why?
An additional
isBlockInterfaceHidden()
check seems to have been omitted here:gutenberg/packages/block-editor/src/components/block-tools/use-show-block-tools.js
Line 48 in 4ac0ade
How?
A check for
! isBlockInterfaceHidden()
was added while determining_showBlockToolbarPopover
.Additional Context
If we choose not to fix this regression, we should at least clean up the following unused code:
hideBlockInterface
andshowBlockInterface
, but this serves no purpose sinceisBlockInterfaceHidden()
is currently unused.gutenberg/packages/block-editor/src/hooks/dimensions.js
Lines 34 to 35 in 4ac0ade
Testing Instructions
Block Toolbar
hides when changing margins.Testing Instructions for Keyboard
Same.
Screencast