Commit cb4d9656fac for woocommerce
commit cb4d9656fac1837784d81f59404d82b2f46dab7a
Author: Pavel Dohnal <pavel.dohnal@automattic.com>
Date: Mon Oct 5 10:29:00 2026 +0200
Hide the core Content panel in the email editor sidebar (#69337)
* Hide core Content panel in email editor sidebar
The Email tab showed core’s quick-navigation “Content” panel because
the email editor runs in template-locked mode. In an email the panel
only lists the single body block, which already fills the canvas, so
clicking it had no visible effect.
Core has no opt-out that keeps the body editable: the
editor.postContentBlockTypes filter also drives content-only editing.
Hide the panel with a scoped CSS rule instead, and cover it with an
e2e test.
* Limit the Content panel rule to the email document tab
The rule matched any tab panel in the sidebar, so it also emptied the
Block tab’s own Content list for content-only blocks such as synced
patterns. It also keyed on a class that older core does not render on
quick-navigation items, so the panel stayed visible on WordPress 6.8.
Match only direct panels of the document tab, and key on the block
icon inside a button, which both core versions render. Add an e2e test
that the Block tab’s Content list stays visible.
diff --git a/packages/js/email-editor/changelog/update-STOMAIL-8567-hide-email-sidebar-content-panel b/packages/js/email-editor/changelog/update-STOMAIL-8567-hide-email-sidebar-content-panel
new file mode 100644
index 00000000000..16054faa159
--- /dev/null
+++ b/packages/js/email-editor/changelog/update-STOMAIL-8567-hide-email-sidebar-content-panel
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Hide the “Content” section in the Email tab of the email editor sidebar, as it only listed the email body.
diff --git a/packages/js/email-editor/src/components/sidebar/style.scss b/packages/js/email-editor/src/components/sidebar/style.scss
index 72c60af4d0c..5207769f292 100644
--- a/packages/js/email-editor/src/components/sidebar/style.scss
+++ b/packages/js/email-editor/src/components/sidebar/style.scss
@@ -8,3 +8,13 @@
// resetting margin fits the notice to the full column width
margin: 0;
}
+
+// Hide core’s quick-navigation “Content” panels (template and template part)
+// from the document tab only. They list the single block that fills the canvas
+// and core has no opt-out that keeps the body editable. The block icon class is
+// used because older core has no class on the quick-navigation markup.
+.editor-sidebar__panel > [role="tabpanel"] {
+ > .components-panel__body:has(.components-button .block-editor-block-icon) {
+ display: none;
+ }
+}
diff --git a/plugins/woocommerce/changelog/update-STOMAIL-8567-hide-email-sidebar-content-panel b/plugins/woocommerce/changelog/update-STOMAIL-8567-hide-email-sidebar-content-panel
new file mode 100644
index 00000000000..16054faa159
--- /dev/null
+++ b/plugins/woocommerce/changelog/update-STOMAIL-8567-hide-email-sidebar-content-panel
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Hide the “Content” section in the Email tab of the email editor sidebar, as it only listed the email body.
diff --git a/plugins/woocommerce/tests/e2e/tests/email-editor/email-editor-settings-sidebar.spec.ts b/plugins/woocommerce/tests/e2e/tests/email-editor/email-editor-settings-sidebar.spec.ts
index e13ce0ef594..8232197a41b 100644
--- a/plugins/woocommerce/tests/e2e/tests/email-editor/email-editor-settings-sidebar.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/email-editor/email-editor-settings-sidebar.spec.ts
@@ -185,4 +185,59 @@ test.describe( 'WooCommerce Email Editor Settings Sidebar Integration', () => {
await expect( page.getByTestId( 'email_cc' ) ).toHaveValue( ccEmail );
await expect( page.getByTestId( 'email_bcc' ) ).toHaveValue( bccEmail );
} );
+
+ test( 'Does not show the core Content block list in the Email tab', async ( {
+ page,
+ } ) => {
+ await accessTheEmailEditor( page, 'Customer note' );
+
+ const emailTab = page.getByLabel( 'Email' );
+ await expect(
+ emailTab.getByRole( 'button', { name: 'Settings' } )
+ ).toBeVisible();
+ await expect(
+ emailTab.getByRole( 'button', { name: 'Content', exact: true } )
+ ).toHaveCount( 0 );
+
+ // Asserting the item exists keeps this test from passing when core never
+ // rendered the panel. If core stops rendering it, remove the CSS rule.
+ const quickNavItem = emailTab
+ .locator( '.components-button .block-editor-block-icon' )
+ .first();
+ await expect( quickNavItem ).toBeAttached();
+ await expect( quickNavItem ).toBeHidden();
+ } );
+
+ test( 'Shows the Content list in the Block tab of a content-only block', async ( {
+ page,
+ } ) => {
+ await accessTheEmailEditor( page, 'Customer note' );
+ await expect( page.getByLabel( 'Email' ) ).toBeVisible();
+
+ await page.evaluate( () => {
+ const { createBlock } = window.wp.blocks;
+ const { select, dispatch } = window.wp.data;
+ const group = createBlock(
+ 'core/group',
+ { templateLock: 'contentOnly' },
+ [ createBlock( 'core/paragraph', { content: 'Nested text' } ) ]
+ );
+ const [ postContent ] =
+ select( 'core/block-editor' ).getBlocksByName(
+ 'core/post-content'
+ );
+ dispatch( 'core/block-editor' ).insertBlocks(
+ group,
+ 0,
+ postContent
+ );
+ dispatch( 'core/block-editor' ).selectBlock( group.clientId );
+ } );
+
+ await page.getByRole( 'tab', { name: 'Block' } ).click();
+ const sidebar = page.locator( '.editor-sidebar__panel' );
+ await expect(
+ sidebar.getByRole( 'button', { name: 'Paragraph' } )
+ ).toBeVisible();
+ } );
} );