From 3905d9a95eb05800ffad7d683552aa6c661e3a90 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Tue, 3 Feb 2026 15:10:57 +0800 Subject: [PATCH 1/2] List View support: Navigate back to top-level list --- packages/block-editor/src/components/block-card/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/block-card/index.js b/packages/block-editor/src/components/block-card/index.js index 6374082c6fc9d1..cad5d689553f68 100644 --- a/packages/block-editor/src/components/block-card/index.js +++ b/packages/block-editor/src/components/block-card/index.js @@ -113,10 +113,10 @@ function BlockCard( { const { getBlockParents, getBlockName } = select( blockEditorStore ); - // Find the closest parent block that is either: + // Find the top-most parent block that is either: // 1. A navigation block (special case for ad-hoc list view support) // 2. Any block with listView support - const parents = getBlockParents( clientId, true ); + const parents = getBlockParents( clientId, false ); const foundParentId = parents.find( ( parentId ) => { const parentName = getBlockName( parentId ); return ( From a935382f5b9676f295f07b61d38fdc4cd9a36097 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Tue, 3 Feb 2026 15:16:42 +0800 Subject: [PATCH 2/2] Avoid rendering list views for blocks already nested in a list view --- packages/block-editor/src/hooks/list-view.js | 29 ++++++++------------ 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/block-editor/src/hooks/list-view.js b/packages/block-editor/src/hooks/list-view.js index fa166670c1031e..df294f2532f409 100644 --- a/packages/block-editor/src/hooks/list-view.js +++ b/packages/block-editor/src/hooks/list-view.js @@ -45,30 +45,25 @@ export function ListViewPanel( { clientId, name } ) { const { getBlockCount, getBlockParents, getBlockName } = select( blockEditorStore ); - // When the ListView is shown in a section, avoid showing List Views - // for both parent and child blocks that have support. In this situation - // the parent will show the child anyway in its List. - // Search parents to see if there's one that also has support, and if so - // skip rendering. + // Avoid showing List Views for both parent and child blocks that have support. + // In this situation the parent will show the child in its list already. + // Search parents to see if there's one that also has support, and if so skip rendering. // This matches closely the logic in the `BlockCard` component. - let _isNestedListView = false; - if ( isSelectionWithinCurrentSection ) { - const parents = getBlockParents( clientId, true ); - _isNestedListView = parents.find( ( parentId ) => { - const parentName = getBlockName( parentId ); - return ( - parentName === 'core/navigation' || - hasBlockSupport( parentName, 'listView' ) - ); - } ); - } + const parents = getBlockParents( clientId, false ); + const _isNestedListView = parents.find( ( parentId ) => { + const parentName = getBlockName( parentId ); + return ( + parentName === 'core/navigation' || + hasBlockSupport( parentName, 'listView' ) + ); + } ); return { hasChildren: !! getBlockCount( clientId ), isNestedListView: _isNestedListView, }; }, - [ clientId, isSelectionWithinCurrentSection ] + [ clientId ] ); const title = useBlockDisplayTitle( { clientId,