Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use experiment flag for a couple of changes
  • Loading branch information
talldan committed Sep 10, 2025
commit f7ed41e3575c2cc4c65f19073594cb55446e5268
13 changes: 11 additions & 2 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ export function PrivateBlockToolbar( {

const _isZoomOut = isZoomOut();

// The switch style button appears more prominently with the
// content only pattern experiment.
const _showSwitchSectionStyleButton =
window?.__experimentalContentOnlyPatternInsertion
? _isZoomOut || isSectionBlock( selectedBlockClientId )
: _isZoomOut ||
( isNavigationModeEnabled &&
editingMode === 'contentOnly' &&
isSectionBlock( selectedBlockClientId ) );

return {
blockClientId: selectedBlockClientId,
blockClientIds: selectedBlockClientIds,
Expand All @@ -153,8 +163,7 @@ export function PrivateBlockToolbar( {
showSlots: ! _isZoomOut,
showGroupButtons: ! _isZoomOut,
showLockButtons: ! _isZoomOut,
showSwitchSectionStyleButton:
_isZoomOut || isSectionBlock( selectedBlockClientId ),
showSwitchSectionStyleButton: _showSwitchSectionStyleButton,
hasFixedToolbar: getSettings().hasFixedToolbar,
isNavigationMode: isNavigationModeEnabled,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ function __experimentalBlockVariationTransforms( { blockClientId } ) {
} );
};

if ( ! variations?.length || isContentOnly || isSection ) {
const hideVariationsForSections =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to hide the transforms menu? It's still there and usable:

Screenshot 2025-09-10 at 3 43 51 pm

Copy link
Contributor Author

@talldan talldan Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It hides the variations on the block card for groups. Only remembered this one is still there after doing it 😄 .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a commit that should address this.

window?.__experimentalContentOnlyPatternInsertion && isSection;

if ( ! variations?.length || isContentOnly || hideVariationsForSections ) {
return null;
}

Expand Down