Repository navigation
Refactor block editor components to remove zoom out mode dependencies #71807
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
Changes from 8 commits
c9d62b7
00ccd3b
d6d5473
ed18d27
01b78d3
ad4be2c
46fab01
f6f3be1
021e0f9
38089c1
20aaf5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,7 @@ export function PrivateBlockToolbar( { | |
|
|
||
| // The switch style button appears more prominently with the | ||
| // content only pattern experiment. | ||
| // @ZOOMOUTMODE | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm inclined to keep this one, as I think quickly being able to toggle through the section styles is nice behaviour 👍 |
||
| const _showSwitchSectionStyleButton = | ||
| window?.__experimentalContentOnlyPatternInsertion && | ||
| ( _isZoomOut || isSectionBlock( selectedBlockClientId ) ); | ||
|
|
@@ -139,7 +140,6 @@ export function PrivateBlockToolbar( { | |
| shouldShowVisualToolbar: isValid && isVisual, | ||
| toolbarKey: `${ selectedBlockClientId }${ parentClientId }`, | ||
| showParentSelector: | ||
| ! _isZoomOut && | ||
| parentBlockType && | ||
| editingMode !== 'contentOnly' && | ||
| getBlockEditingMode( parentClientId ) !== 'disabled' && | ||
|
|
@@ -152,11 +152,12 @@ export function PrivateBlockToolbar( { | |
| isUsingBindings: _isUsingBindings, | ||
| hasParentPattern: _hasParentPattern, | ||
| hasContentOnlyLocking: _hasTemplateLock, | ||
| // @ZOOMOUTMODE | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is to indicate questionable areas... that is, "should I stay or should I go". Like that song.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the
|
||
| showShuffleButton: _isZoomOut, | ||
| showSlots: ! _isZoomOut, | ||
| showGroupButtons: ! _isZoomOut, | ||
| showLockButtons: ! _isZoomOut, | ||
| showBlockVisibilityButton: ! _isZoomOut, | ||
| showBlockVisibilityButton: true, | ||
| showSlots: true, | ||
| showGroupButtons: true, | ||
| showLockButtons: true, | ||
| showSwitchSectionStyleButton: _showSwitchSectionStyleButton, | ||
| }; | ||
| }, [] ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,6 +168,7 @@ function InbetweenInsertionPointPopover( { | |
| // Other operations such as "group" are when the editor tries to create a row | ||
| // block by grouping the block being dragged with the block it's being dropped | ||
| // onto. | ||
| // @ZOOMOUTMODE | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Grouping while dragging onto things horizontally can be a fairly fine-grained action. For now, I lean toward leaving this in (return early if we're not inserting), but we could always revisit in follow-ups. I'll remove this comment for now. |
||
| if ( isZoomOutMode && operation !== 'insert' ) { | ||
| return null; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -342,6 +342,7 @@ function BlockStyleControls( { | |
| }, | ||
| }, | ||
| }; | ||
|
|
||
| if ( blockEditingMode !== 'default' ) { | ||
| return null; | ||
| } | ||
|
|
||

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.
I've removed
isZoomOutfrom this check, otherwise we get stuck on a row if we hit "enter" while zoomed out:Before
2025-10-08.16.55.03.mp4
With this removal
2025-10-08.16.54.18.mp4