Skip to content

List View: Show an appender at the end of every expanded nested list - #85293

Draft
jeryj wants to merge 1 commit into
trunkfrom
try/list-view-nested-appender-expanded
Draft

jeryj wants to merge 1 commit into
trunkfrom
try/list-view-nested-appender-expanded

Conversation

@jeryj

@jeryj jeryj commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Part of #85154.

What?

Every expanded list in a List View with appenders ends with an appender, so an item can be added to a submenu, a Buttons block, or a Social Icons block right where it will go. An empty container, such as an empty Social Icons block, gets an appender too.

  • A nested appender is a plain +, inset with the items it adds to, in the color of the rows. It turns blue while hovered or focused, with no background.
  • The top-level appender keeps its filled style. In the site editor's navigation sidebar it is named "Add menu item", so it is not confused with a submenu's "Add page".
  • The sidebar's Options menu gains the "Add submenu link" item from the Navigation block, which turns a link into a submenu holding a new link.

All of this applies to both the site editor and the extensible site editor.

Why?

The List View only offered a top-level appender, so adding an item inside a submenu or a Buttons block meant going to the canvas. Expansion is an explicit, sticky act, so the appender for a list appears when the user opens that list and stays until they close it. Nothing appears or disappears on hover or selection while scanning the list.

How?

  • ListViewBranch ends every rendered branch with its appender. A collapsed branch is not rendered, so a collapsed list has no appender.
  • An empty block gets an appender row one level in, when it has block list settings and does not hide its appender on the canvas. useNestedSettingsUpdate records hidesAppender in the block list settings when renderAppender is false, so a link that could hold a submenu gets no row.
  • The appender row carries a class, and a per-level style insets each nested appender one indent level per nesting level.
  • PrivateListView takes an appenderLabel for the top-level appender.
  • AddSubmenuItem is exported from the Navigation block's leaf-more-menu as a private API, and computes its own disabled state. Both sidebar Options menus render it.

Accessibility notes

  • The appender is a row in the tree grid, reached with the arrow keys in reading order, and keeps the existing description ("Append to Submenu block at position 3, Level 2").
  • Each appender keeps an accessible name that says what it adds.
  • Nothing appears or disappears on hover.

Trade-off: one extra row per expanded list. In the site editor sidebar every submenu is expanded by default, so a deep menu shows an appender for each submenu.

Testing Instructions

  1. Open a navigation menu with a submenu, a Buttons block, and an empty Social Icons block in the site editor sidebar.
  2. Every submenu ends with a + inset with its items, as do the Buttons block and the empty Social Icons block. The menu ends with the filled top-level +.
  3. Hover a nested +: it turns blue, with no background.
  4. Click a submenu's +. The Link UI opens; pick a page. The new item lands at the end of that submenu.
  5. Collapse a submenu: its appender goes with its items. Expand it: it returns.
  6. Open a top-level link's Options menu and choose "Add submenu link". The link becomes a submenu holding the new link.
  7. In the post editor, add a Navigation block with a submenu and open the List View in the block inspector. Submenus start collapsed, so only the top-level + shows; expand a submenu to see its own.
  8. Enable the "Extensible site editor" experiment and repeat steps 2 to 6 from admin.php?page=site-editor-v2&p=/navigation.

Use of AI Tools

Written with Claude Code, including the implementation and the e2e tests. I reviewed and tested the changes.

🤖 Generated with Claude Code

@jeryj jeryj added [Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Type] Experimental Experimental feature or API. labels Oct 21, 2026
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

📦 Bundle size

Size Change: +1 kB (+0.01%)

Total Size: 8.69 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 557 kB +165 B (+0.03%)
build/scripts/edit-site/index.min.js 383 kB +71 B (+0.02%)
build/styles/block-editor/style-rtl.css 20.3 kB +139 B (+0.69%)
build/styles/block-editor/style-rtl.min.css 17.3 kB +127 B (+0.74%)
build/styles/block-editor/style.css 20.3 kB +136 B (+0.67%)
build/styles/block-editor/style.min.css 17.3 kB +130 B (+0.76%)
build/styles/edit-site/style-rtl.css 21.3 kB +58 B (+0.27%)
build/styles/edit-site/style-rtl.min.css 17.3 kB +60 B (+0.35%)
build/styles/edit-site/style.css 21.3 kB +58 B (+0.27%)
build/styles/edit-site/style.min.css 17.2 kB +60 B (+0.35%)

7cdba5b Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 3c8ed37 trunk % Change
timeToFirstByte 40.35 ms +7.68% -3.97% 36.55 ms +20.25% -2.33% 10.4%
largestContentfulPaint 64 ms +12.5% -3.13% 62 ms +6.45% -9.68% 3.23%
lcpMinusTtfb 24.45 ms +16.77% -8.79% 21.25 ms +22.59% -6.82% 15.06%
wpBeforeTemplate 20.51 ms +12.48% -1.02% 19.74 ms +19.76% -6.64% 3.9%
wpTemplate 15.86 ms +4.29% -2.96% 13.92 ms +7.26% -3.38% 13.94%
wpTotal 36.69 ms +6.9% -3.05% 33.27 ms +17.97% -3.07% 10.28%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 3c8ed37 trunk % Change
timeToFirstByte 35.95 ms +9.32% -4.31% 29.75 ms +5.21% -3.03% 20.84%
largestContentfulPaint 64 ms +9.38% -0% 56 ms +0% -7.14% 14.29%
lcpMinusTtfb 28.55 ms +4.38% -4.38% 25.9 ms +2.7% -8.88% 10.23%
wpBeforeTemplate 19.38 ms +8.51% -4.18% 16.33 ms +3.92% -0.43% 18.68%
wpTemplate 13.01 ms +6.76% -2.69% 10.2 ms +7.16% -1.76% 27.55%
wpTotal 32.9 ms +10.3% -4.41% 27.02 ms +6.11% -2.66% 21.76%
wpMemoryUsage 6.44 MB +0% -0% 6.40 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 3c8ed37 trunk % Change
mediaProcessingJpeg 240.71 ms +5.31% -2.49% 233.67 ms +0.18% -0.95% 3.01%
mediaProcessingAvif 3799.22 ms +0.42% -0.96% 4103.91 ms +0.72% -0.75% -7.42%
mediaProcessingJpegToAvif 2627.06 ms +0.38% -0.54% 2699 ms +0.32% -1.17% -2.67%

media-upload

Metric 3c8ed37 trunk % Change
jpegUploadProcessing 1440.56 ms +3.64% -1.34% 1443 ms +1.18% -1.04% -0.17%
pngUploadProcessing 208.65 ms +6.81% -3.09% 201.41 ms +0.83% -3.25% 3.59%
largeJpegUploadProcessing 1444.18 ms +1.11% -0.63% 1475.1 ms +0.38% -0.44% -2.1%
multipleImageUploadProcessing 1507.33 ms +1.09% -0.66% 1552.44 ms +1.37% -0.67% -2.91%

post-editor

Metric 3c8ed37 trunk % Change
serverResponse 396.89 ms +2.43% -7.34% 400.22 ms +0.2% -2.35% -0.83%
firstPaint 402.46 ms +1.39% -6.09% 382.11 ms +12.53% -7.95% 5.33%
domContentLoaded 787.65 ms +1.27% -1.36% 765.64 ms +0.92% -1.11% 2.87%
loaded 788.66 ms +1.27% -1.34% 766.74 ms +0.92% -1.13% 2.86%
firstContentfulPaint 450.28 ms +1.71% -3.5% 430.51 ms +2.68% -1.82% 4.59%
firstBlock 1941.48 ms +2.44% -0.33% 1955.74 ms +0.18% -0.76% -0.73%
type 16.55 ms +7.49% -8.4% 16.93 ms +4.96% -9.92% -2.24%
typeWithoutInspector 16.39 ms +5.86% -7.08% 18.56 ms +1.56% -19.94% -11.69%
typeWithTopToolbar 22.55 ms +6.12% -8.16% 22.87 ms +7.48% -4.46% -1.4%
typeContainer 7.86 ms +7.63% -6.87% 7.77 ms +6.18% -8.37% 1.16%
focus 110.57 ms +12.04% -3.55% 109.7 ms +4.07% -3.11% 0.79%
firstFocus 248.48 ms +0% -0% 241.92 ms +0% -0% 2.71%
selectAll 313.98 ms +3.91% -1% 326.4 ms +4% -1.5% -3.81%
undo 27.52 ms +4.22% -5.63% 27.61 ms +9.53% -2.39% -0.33%
listViewOpen 73.97 ms +4.79% -4.04% 69 ms +10.25% -16.97% 7.2%
inserterOpen 38.17 ms +9.35% -3.48% 39.02 ms +4.51% -10.56% -2.18%
inserterHover 11.02 ms +11.07% -8.98% 11.06 ms +7.69% -3.98% -0.36%
inserterSearch 8.04 ms +9.7% -5.22% 8.33 ms +6.84% -5.64% -3.48%
loadPatterns 620.29 ms +4.47% -2.95% 622.65 ms +6.72% -2.19% -0.38%
wpTotal 387.3 ms +2.46% -7.51% 390.08 ms +0.36% -2.24% -0.71%
wpMemoryUsage 14.81 MB +0% -0% 14.77 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 3c8ed37 trunk % Change
serverResponse 474.29 ms +0.63% -0.97% 460.63 ms +2.63% -7.19% 2.97%
firstPaint 441.32 ms +3.84% -10.27% 416.64 ms +11.21% -8.82% 5.92%
domContentLoaded 837.27 ms +3.5% -0.81% 824.19 ms +1.74% -1.27% 1.59%
loaded 838.23 ms +3.5% -0.82% 825.22 ms +1.72% -1.29% 1.58%
firstContentfulPaint 462.89 ms +2.57% -1.78% 462.6 ms +1.09% -1.65% 0.06%
firstBlock 2590.34 ms +6.07% -1.77% 2576.05 ms +1.23% -1.84% 0.55%
type 16.53 ms +10.04% -5.51% 17.59 ms +4.32% -7.5% -6.03%
navigate 105.78 ms +5.46% -1.46% 109.19 ms +9.68% -6.27% -3.12%
loadPatterns 1245.97 ms +14.5% -1.8% 1315.13 ms +3.95% -5.48% -5.26%
loadPages 961.79 ms +1.17% -2.25% 964.45 ms +1.19% -3.87% -0.28%
wpTotal 464.74 ms +0.67% -1.02% 451.22 ms +2.66% -7.36% 3%
wpMemoryUsage 12.83 MB +0% -0% 12.80 MB +0% -0% 0.25%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

7cdba5b Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

should select synced pattern in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]') with timeout 5000ms
  - waiting for locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
    14 × locator resolved to <div tabindex="0" role="document" draggable="true" data-title="Pattern" data-type="core/block" data-is-drop-zone="true" aria-label="Block: Pattern" id="block-fa86385b-714b-4056-a933-342e79ff52f7" data-block="fa86385b-714b-4056-a933-342e79ff52f7" class="block-editor-block-list__block wp-block is-selected is-reusable block-library-block__reusable-block-container wp-block-block block-editor-block-list__layout">…</div>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1464:5

7cdba5b Run

Every expanded list in a List View with appenders now ends with an appender, so an item can be added to a submenu, a Buttons block or a Social Icons block from the List View. An empty container gets one too, unless it hides its appender on the canvas, which `useNestedSettingsUpdate` now records as `hidesAppender` in the block list settings.

A nested appender is a plain + in the color of the rows that turns blue while hovered or focused. The top-level appender keeps its filled style, and `PrivateListView` can name it with `appenderLabel`; the site editor's navigation sidebar names it "Add menu item".

The sidebar's Options menu, in both the site editor and the extensible site editor, gains the "Add submenu link" item from the Navigation block, now a private `AddSubmenuItem` export of the block library.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeryj
jeryj force-pushed the try/list-view-nested-appender-expanded branch from 649c6f5 to 7cdba5b Compare November 20, 2026 19:23
@github-actions github-actions Bot added [Package] Block library /packages/block-library [Package] Edit Site /packages/edit-site labels Nov 20, 2026
@jeryj jeryj changed the title Try: Show a labeled appender at the end of every expanded List View list List View: Show an appender at the end of every expanded nested list Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Edit Site /packages/edit-site [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant