Skip to content

Try: Reveal a nested List View appender on hover or focus - #85226

Closed
jeryj wants to merge 5 commits into
trunkfrom
try/list-view-nested-appender-on-hover
Closed

jeryj wants to merge 5 commits into
trunkfrom
try/list-view-nested-appender-on-hover

Conversation

@jeryj

@jeryj jeryj commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What?

Exploration, an alternate to #84866. There, a nested list in the List View gets an appender while its parent or a block inside it is selected. Here, the nested appender row is added, sliding open, while the pointer or keyboard focus is on the list's parent, on a block inside it, or on the appender itself, and removed otherwise. The top-level appender is unchanged and always shown. Every appender is inset to its level, so its "+" sits where the new item's icon will be.

This branch contains #84866 plus a trunk merge, so the diff to compare is the last two commits.

Why?

To compare the two triggers side by side. Hover and focus make adding an item a one-step action without first selecting the submenu, and selection then keeps its current meaning.

How?

  • The List View tracks a hovered client ID: each row reports itself on pointer enter and on focus, an appender row reports its parent, and the tree grid clears it when the pointer or focus leaves the grid. Rows never clear it themselves, so moving between rows does not pass through an empty state.
  • A nested branch renders its appender row while the hovered block is its parent or inside it. The row's content slides open over 0.1s (height and opacity, off under reduced motion). Removal is immediate.
  • The hovered block is frozen while blocks are dragged, so rows do not move under a drag. Hovering the source row before a drag can still close a nested appender above it; the drag helper in navigation-list-view.spec.js hovers twice to follow the row.
  • Appenders inset one indent level (24px) per nesting level, matching the rows' expander inset.

Known risk, by design: rows below a submenu move as its appender row opens and closes while the pointer passes over the list. This is the behavior to evaluate.

Behavior is generic to every List View that shows an appender, as in #84866, so the v1 sidebar and the extensible site editor's navigation route both get it.

Testing Instructions

  1. Open the site editor, then Navigation, then a menu with a submenu.
  2. Move the pointer over the submenu or one of its items: an "Add page" row slides open at the end of the submenu, inset with its items. Move the pointer to another top-level item, or out of the list: it goes.
  3. Tab into the list and arrow through the submenu: the appender row appears while focus is inside the submenu, the arrow keys reach it, and Enter adds a link inside the submenu.
  4. Repeat with the "Extensible site editor" experiment on, from admin.php?page=site-editor-v2&p=/navigation.
  5. In the post editor, open a Navigation block's inspector List View and drag items in and out of a submenu: rows do not move while a drag is in progress.

Automated: the nested appender test in test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js covers hover, focus, leaving the list, collapsing, the inset, and adding a link, and passes under both the default and the extensible site editor configs. test/e2e/specs/editor/blocks/navigation-list-view.spec.js targets the top-level appender explicitly and re-hovers before a drag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WfD1eLDy2gFm7w4gPm4THb

jeryj and others added 4 commits October 15, 2026 16:16
A nested branch shows its appender when its parent, or any block inside
the parent, is selected, so a submenu or a Buttons block in a Navigation
menu can take new items from the List View. The first level keeps its
appender at all times, and the nested branch now receives `showAppender`
so List Views without one stay without one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YY39mts89XNBXysaFcLtoa
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YY39mts89XNBXysaFcLtoa
…-appender-on-hover

# Conflicts:
#	packages/block-editor/CHANGELOG.md
#	test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js
…ction

Alternate to the selection rule: a nested list keeps its appender row at all times, so rows never move under the pointer, and the appender's toggle is shown while the pointer or focus is on the list's parent, on a block inside it, or on the appender itself. The List View tracks the hovered or focused row and clears it when the pointer or focus leaves the tree grid.

The post editor's List View tests target the top-level appender explicitly, since every submenu now carries an appender row too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfD1eLDy2gFm7w4gPm4THb
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

📦 Bundle size

Size Change: +964 B (+0.01%)

Total Size: 9.05 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 604 kB +206 B (+0.03%)
build/styles/block-editor/style-rtl.css 20.7 kB +192 B (+0.93%)
build/styles/block-editor/style-rtl.min.css 17.7 kB +189 B (+1.08%)
build/styles/block-editor/style.css 20.8 kB +192 B (+0.93%)
build/styles/block-editor/style.min.css 17.6 kB +185 B (+1.06%)

10bfb4b Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 12eda2c trunk % Change
timeToFirstByte 40.9 ms +13.57% -7.58% 36 ms +19.31% -2.08% 13.61%
largestContentfulPaint 72 ms +5.56% -5.56% 68 ms +2.94% -8.82% 5.88%
lcpMinusTtfb 30.6 ms +6.21% -10.78% 27.2 ms +16.54% -9.01% 12.5%
wpBeforeTemplate 21.01 ms +17.04% -5.38% 18.83 ms +15.03% -1.65% 11.58%
wpTemplate 16.34 ms +1.84% -8.32% 14.03 ms +6.84% -3.64% 16.46%
wpTotal 37.5 ms +12.64% -7.57% 32.7 ms +19.2% -1.47% 14.68%
wpMemoryUsage 7.64 MB +0% -0% 7.61 MB +0% -0% 0.46%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 12eda2c trunk % Change
timeToFirstByte 33.35 ms +7.35% -3.75% 29.05 ms +8.26% -3.1% 14.8%
largestContentfulPaint 76 ms +2.63% -5.26% 68 ms +0% -5.88% 11.76%
lcpMinusTtfb 41.4 ms +3.14% -4.11% 36.65 ms +4.5% -4.23% 12.96%
wpBeforeTemplate 17.75 ms +10.76% -3.27% 16.12 ms +5.02% -3.04% 10.11%
wpTemplate 12.04 ms +8.39% -2.08% 10.29 ms +5.44% -6.12% 17.01%
wpTotal 30.34 ms +8.57% -3.69% 26.18 ms +10.24% -2.86% 15.89%
wpMemoryUsage 6.34 MB +0% -0% 6.30 MB +0% -0% 0.58%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 12eda2c trunk % Change
mediaProcessingJpeg 237.57 ms +1.18% -4.01% 229.01 ms +4.1% -3.33% 3.74%
mediaProcessingAvif 3865.58 ms +1.21% -2.09% 3724.42 ms +1.04% -1.42% 3.79%
mediaProcessingJpegToAvif 2656.92 ms +0.81% -2.74% 2552.57 ms +1.02% -0.57% 4.09%

media-upload

Metric 12eda2c trunk % Change
jpegUploadProcessing 1424.48 ms +4.31% -1.38% 1435.79 ms +0.34% -0.66% -0.79%
pngUploadProcessing 198.72 ms +9.83% -1.92% 185.03 ms +4.19% -1.95% 7.4%
largeJpegUploadProcessing 1401.75 ms +2.47% -0.47% 1421.83 ms +0.77% -0.95% -1.41%
multipleImageUploadProcessing 1462.96 ms +1.3% -0.71% 1491.22 ms +2.98% -0.42% -1.9%

post-editor

Metric 12eda2c trunk % Change
serverResponse 322.24 ms +4.45% -11.59% 309.89 ms +5.93% -9.1% 3.99%
firstPaint 249.6 ms +29.01% -22.04% 311.64 ms +22.12% -43.36% -19.91%
domContentLoaded 913.7 ms +2.81% -4.16% 889.38 ms +3.79% -1.2% 2.73%
loaded 914.76 ms +2.8% -4.18% 890.37 ms +3.79% -1.19% 2.74%
firstContentfulPaint 396.9 ms +4.27% -17.72% 386.75 ms +2.86% -5.67% 2.62%
firstBlock 2793.87 ms +0.71% -4.87% 2718.41 ms +4.19% -3.84% 2.78%
type 15.87 ms +3.84% -1.07% 15.39 ms +4.29% -2.79% 3.12%
typeWithoutInspector 15.68 ms +2.55% -3.64% 15.52 ms +4.19% -4.83% 1.03%
typeWithTopToolbar 19.86 ms +2.52% -1.76% 19.4 ms +6.03% -3.76% 2.37%
typeContainer 7.23 ms +5.95% -7.47% 7.05 ms +6.24% -6.38% 2.55%
focus 97.72 ms +2.81% -2.97% 90.31 ms +2.19% -2.5% 8.21%
firstFocus 184.66 ms +0% -0% 183.87 ms +0% -0% 0.43%
selectAll 464.7 ms +0.4% -2.98% 439.71 ms +0.35% -0.42% 5.68%
listViewOpen 59 ms +1.42% -8.2% 60.22 ms +6.24% -5.08% -2.03%
inserterOpen 35.4 ms +6.44% -7.54% 31.06 ms +12.36% -5.22% 13.97%
inserterHover 9.87 ms +6.99% -2.84% 9.95 ms +5.23% -5.23% -0.8%
inserterSearch 6.94 ms +13.83% -9.65% 6.9 ms +9.57% -3.33% 0.58%
loadPatterns 510.01 ms +3.57% -2.87% 513.74 ms +5.36% -3.35% -0.73%
wpTotal 313.88 ms +4.11% -11.85% 301.6 ms +6.05% -9.37% 4.07%
wpMemoryUsage 14.66 MB +0% -0% 14.63 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 12eda2c trunk % Change
serverResponse 520.04 ms +3.79% -7.1% 515.59 ms +4.04% -2.08% 0.86%
firstPaint 286.76 ms +14.63% -13.82% 266.55 ms +30.59% -6.57% 7.58%
domContentLoaded 1334.14 ms +1.36% -1.78% 1329.04 ms +1.26% -1.13% 0.38%
loaded 1335.63 ms +1.36% -1.79% 1330.45 ms +1.25% -1.15% 0.39%
firstContentfulPaint 530.88 ms +2.05% -2.85% 518.08 ms +8.56% -2.83% 2.47%
firstBlock 5144.81 ms +1.64% -2.86% 5111.08 ms +0.92% -0.16% 0.66%
type 23.04 ms +2.04% -12.8% 21.54 ms +2.79% -2.79% 6.96%
navigate 136.23 ms +19.19% -2.94% 134.48 ms +12.73% -2.85% 1.3%
loadPatterns 1420.75 ms +14.73% -2.22% 1350.54 ms +3.91% -12.02% 5.2%
loadPages 1046.71 ms +2.65% -2.24% 1030.46 ms +1.52% -1.68% 1.58%
wpTotal 510.93 ms +3.72% -7.37% 506.41 ms +4.07% -2.21% 0.89%
wpMemoryUsage 12.70 MB +0% -0% 12.66 MB +0% -0% 0.29%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

10bfb4b 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.

Regression: updating a specific option will only change its value and will not corrupt others in /test/e2e/specs/editor/various/core-settings.spec.js, passed after 1 failed attempt.
Error: expect(received).toStrictEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Array [
    "rewrite_rules",
-   "SERIALIZED DATA",
+   "",
  ]
    at forEach (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:46:26)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:43:35
keeps the blocks selected after dropping a multi-selection in /test/e2e/specs/editor/various/draggable-blocks.spec.js, passed after 1 failed attempt.
TypeError: Cannot read properties of null (reading 'y')
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:824:57
    at dragSelectionBelowLanding (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:823:3)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:908:3
restores the blocks when a multi-selection drag is canceled in /test/e2e/specs/editor/various/draggable-blocks.spec.js, passed after 1 failed attempt.
TypeError: Cannot read properties of null (reading 'y')
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:824:57
    at dragSelectionBelowLanding (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:823:3)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:871:3

From 08bb0db, not the current head. Run

The nested appender row is added while its list is hovered or holds focus, sliding open as it arrives, and removed otherwise, instead of a blank row waiting at the end of every submenu. The hovered block is frozen while blocks are dragged, so rows do not move under a drag. Each appender is inset one indent level per nesting level, so its toggle sits where the new item's icon will be.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfD1eLDy2gFm7w4gPm4THb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant