Skip to content

Site Editor: Show the inserter for an empty Navigation Menu in the sidebar - #84003

Open
jeryj wants to merge 1 commit into
trunkfrom
fix/navigation-sidebar-empty-menu-appender
Open

jeryj wants to merge 1 commit into
trunkfrom
fix/navigation-sidebar-empty-menu-appender

Conversation

@jeryj

@jeryj jeryj commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What?

Shows the list view and its appender in the site editor sidebar for an empty Navigation Menu, instead of only "This Navigation Menu is empty."

Why?

That empty screen came from #50870, when the sidebar was read-only. The sidebar is editable now, so the early return just leaves empty menus with no way to add a first item.

How?

Removes the early return so empty menus render like any other menu. The extensible site editor never had it. The new tests run against both editors in CI.

Testing Instructions

  1. With a block theme active (for example, Twenty Twenty-Five), go to Appearance > Editor.
  2. Open a template or template part that contains a Navigation block, such as the Header, and select the Navigation block.
  3. In the block settings sidebar, open the "Choose or create a Navigation Menu" (⋮) dropdown and choose "Create new Menu".
  4. Save the site.
  5. Go back to the Site Editor's main sidebar, open Navigation, and select the menu you just created.
  6. Confirm the sidebar shows the list view with a + ("Add page") button. On trunk, it only shows "This Navigation Menu is empty."
  7. Click +, search for an existing page, and select it.
  8. Confirm the page appears in the sidebar as the menu's first item.

Testing Instructions for Keyboard

  1. Follow steps 1 to 5 above.
  2. Press Tab until the "Add page" button has focus, then press Enter.
  3. Confirm focus moves to the link search field, and type the title of an existing page.
  4. Press Down Arrow to highlight the matching result, then press Enter.
  5. Confirm the page appears in the sidebar as the menu's first item.

Screenshots

Before

before

After

after

Use of AI Tools

Claude Code (Claude Opus 5.5) debugged the cause, wrote the tests and fix, and drafted this description. I reviewed the changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FxdL4e4Dpj8Z3h78C5wi8K

…debar

The sidebar replaced the list view with a "This Navigation Menu is empty."
message whenever a menu had no content. That screen dates from #50870, when
the sidebar was deliberately read-only. The sidebar has since become editable,
so the early return now leaves an empty menu with no way to add its first
item. Remove it so empty menus get the same list view and appender as any
other menu.

The extensible site editor never had this early return. The new tests run
against both editors in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxdL4e4Dpj8Z3h78C5wi8K
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jeryj <jeryj@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: -23 B (0%)

Total Size: 8.25 MB

📦 View Changed
Filename Size Change
build/scripts/edit-site/index.min.js 382 kB -23 B (-0.01%)

1572147 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric fe06944 trunk % Change
timeToFirstByte 58.65 ms +4.69% -3.24% 58.15 ms +2.84% -3.44% 0.86%
largestContentfulPaint 100 ms +6% -6% 96 ms +8.33% -2.08% 4.17%
lcpMinusTtfb 37.35 ms +16.33% -3.35% 37.7 ms +19.23% -9.81% -0.93%
wpBeforeTemplate 28.21 ms +9.54% -0.39% 28.66 ms +7.75% -4.08% -1.57%
wpTemplate 25.4 ms +6.93% -2.64% 24.89 ms +3.74% -4.18% 2.05%
wpTotal 54.62 ms +4.71% -3.57% 54.18 ms +2.62% -3.62% 0.81%
wpMemoryUsage 7.62 MB +0% -0% 7.59 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric fe06944 trunk % Change
timeToFirstByte 47.9 ms +5.74% -2.09% 43.35 ms +6% -3.11% 10.5%
largestContentfulPaint 104 ms +5.77% -0% 92 ms +4.35% -0% 13.04%
lcpMinusTtfb 57.1 ms +1.4% -0.7% 49.9 ms +1.3% -2.51% 14.43%
wpBeforeTemplate 24.95 ms +13.19% -1.04% 25.36 ms +5.64% -3.59% -1.62%
wpTemplate 19.06 ms +3.83% -1.99% 14.71 ms +2.65% -2.52% 29.57%
wpTotal 44.51 ms +5.39% -2.2% 40.28 ms +6.01% -3.45% 10.5%
wpMemoryUsage 6.25 MB +0% -0% 6.07 MB +0% -0% 2.92%
wpDbQueries 14 +0% -0% 10 +0% -0% 40%

media-processing

Metric fe06944 trunk % Change
mediaProcessingJpeg 415.77 ms +1.19% -0.99% 412.55 ms +1.57% -0.24% 0.78%
mediaProcessingAvif 6172.23 ms +0.24% -0.2% 6189.32 ms +0.49% -0.11% -0.28%
mediaProcessingJpegToAvif 4331.91 ms +0.28% -0.06% 4327.24 ms +0.04% -0.16% 0.11%

media-upload

Metric fe06944 trunk % Change
jpegUploadProcessing 1448.99 ms +34.21% -1.76% 1445.73 ms +0.8% -1.22% 0.23%
pngUploadProcessing 211.67 ms +5.42% -16.55% 223.64 ms +4.41% -15.1% -5.35%
largeJpegUploadProcessing 1418.16 ms +0.89% -0.58% 1426.38 ms +0.97% -1.09% -0.58%
multipleImageUploadProcessing 1585.92 ms +2.92% -1.35% 1588.66 ms +32.35% -1.5% -0.17%

post-editor

Metric fe06944 trunk % Change
serverResponse 326.9 ms +3.58% -7.77% 331.36 ms +2.97% -7.6% -1.35%
firstPaint 182.81 ms +8.92% -19.54% 175.22 ms +20.47% -15.52% 4.33%
domContentLoaded 862.85 ms +2.58% -2.62% 853.26 ms +0.48% -1.93% 1.12%
loaded 863.97 ms +2.57% -2.64% 854.35 ms +0.49% -1.92% 1.13%
firstContentfulPaint 360 ms +5.57% -8.94% 356.76 ms +0.88% -1.98% 0.91%
firstBlock 2488.34 ms +1.6% -0.52% 2487.64 ms +1.53% -1.33% 0.03%
type 15.89 ms +10.45% -5.79% 15.98 ms +1.69% -3.44% -0.56%
typeWithoutInspector 15.57 ms +1.22% -2.83% 15.43 ms +4.02% -1.23% 0.91%
typeWithTopToolbar 19.79 ms +3.79% -3.84% 18.65 ms +9.28% -3.86% 6.11%
typeContainer 7.02 ms +10.83% -8.12% 6.77 ms +12.41% -3.84% 3.69%
focus 59.01 ms +1.3% -4.15% 56.6 ms +4.19% -2.72% 4.26%
firstFocus 167.66 ms +0% -0% 179.36 ms +0% -0% -6.52%
selectAll 457.3 ms +1.99% -5.68% 406.94 ms +1.63% -0.12% 12.38%
listViewOpen 46.48 ms +11.66% -9.6% 49.36 ms +8.83% -3.4% -5.83%
inserterOpen 19.21 ms +8.22% -7.76% 19.43 ms +5.82% -11.94% -1.13%
inserterHover 1.98 ms +2.02% -8.08% 1.94 ms +9.79% -3.09% 2.06%
inserterSearch 6.62 ms +6.8% -3.47% 7.08 ms +2.54% -8.76% -6.5%
loadPatterns 524.47 ms +3.49% -5.72% 516.03 ms +3.4% -4.71% 1.64%
wpTotal 317.39 ms +3.95% -7.89% 322.09 ms +3.1% -7.66% -1.46%
wpMemoryUsage 13.17 MB +0% -0% 13.13 MB +0% -0% 0.28%
wpDbQueries 54 +0% -0% 54 +0% -0% 0%

site-editor

Metric fe06944 trunk % Change
serverResponse 424.28 ms +1.4% -8.19% 420.43 ms +2.11% -2.4% 0.92%
firstPaint 273.66 ms +61.65% -15.91% 245.44 ms +11.9% -11.55% 11.5%
domContentLoaded 1075.45 ms +1.11% -1.56% 1095.99 ms +2.18% -1.07% -1.87%
loaded 1076.55 ms +1.11% -1.56% 1097.14 ms +2.17% -1.06% -1.88%
firstContentfulPaint 443.11 ms +2.75% -3.92% 431.72 ms +1.57% -1.03% 2.64%
firstBlock 3912.46 ms +1.3% -0.53% 3871.88 ms +1.49% -0.7% 1.05%
type 16.95 ms +11.5% -4.6% 17.05 ms +4.16% -4.93% -0.59%
navigate 115.42 ms +4.06% -7.42% 115.26 ms +6.13% -12.11% 0.14%
loadPatterns 1334.06 ms +2.24% -3.88% 1333.49 ms +4.18% -3.02% 0.04%
loadPages 1045.78 ms +1.83% -1.43% 1038.9 ms +1.26% -0.75% 0.66%
wpTotal 414.91 ms +1.47% -8.33% 411.26 ms +2.08% -2.58% 0.89%
wpMemoryUsage 12.14 MB +0% -0% 12.09 MB +0% -0% 0.41%
wpDbQueries 43.5 +1.15% -1.15% 43 +2.33% -0% 1.16%

1572147 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 cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49

1572147 Run

@github-actions github-actions Bot added the [Package] Edit Site /packages/edit-site label Oct 1, 2026
@jeryj jeryj added [Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement. labels Oct 1, 2026
@jeryj jeryj self-assigned this Oct 1, 2026
@annezazu

annezazu commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

I took this for a spin! Nice quality of life improvement. I noticed two minor things:

  • I was prompted to save even though I didn't make any changes and just clicked + but didn't add anything.
  • When adding pages that didn't exist, when I searched "About" it still showed "Sample Page" but the same thing didn't happen with adding a "Contact" page.
  • There is what I think is a new line that's hard to see but that separates the results vs create page and add block. When there aren't any results when searching, it felt a bit janky.
Screenshot 2026-10-01 at 2 24 55 PM
Screen.Recording.2026-10-01.at.2.22.25.PM.mov

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

[Block] Navigation Affects the Navigation Block [Package] Edit Site /packages/edit-site [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants