Skip to content

Page List: Edit pages in place in a Navigation block and turn on Auto add new pages - #87304

Draft
jeryj wants to merge 39 commits into
try/auto-add-pagesfrom
add/navigation-page-list-converts-on-edit
Draft

jeryj wants to merge 39 commits into
try/auto-add-pagesfrom
add/navigation-page-list-converts-on-edit

Conversation

@jeryj

@jeryj jeryj commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #84508.

What?

Inside a Navigation block, the Page List's pages become editable menu items, and the menu's "Auto add new pages" setting is always shown. While the menu has a Page List of all pages, the setting shows as on, since the Page List already shows every new page. Changing one of its pages turns the Page List into plain links and saves the setting as on, so new pages keep arriving. Switching the setting off instead turns the Page List into links with the setting off.

  • The Page List shows its pages as Navigation Links and Submenus. One click selects a page link, and it has the same toolbar and options as the menu's other links, including "Add before" and "Add after".
  • It stays a live Page List until a page link is moved, removed, relabeled, or a link is added or dropped among them. Then the Page List is replaced by the links as they are after that change, and "Auto add new pages", already shown as on, is saved as on. One undo reverts both, except after typing a new label (see Known limitations).
  • While a menu has a Page List of all pages, the "Auto add new pages" setting shows as on, since the Page List already shows every new page (and the server doesn't add a page a Page List already shows). A Page List limited to one parent page shows only the pages under it, so it leaves the setting as saved. Switching it off replaces the Page List of all pages with links to its pages and turns the setting off in one edit, so one undo brings the Page List back. A Page List with more than 100 pages, which can't become links, keeps the switch on and disabled.
  • Creating a page from an appender's link UI in a menu with a Page List of all pages adds the link where it was added and turns the Page List into links, with "Auto add new pages" on. A Page List would also show the new page, so the menu would list it twice.
  • The default menu a site creates for itself stays a Page List, as on trunk and Navigation: Add an "Auto add new pages" Navigation Menu setting #84508. So a new site's menu shows its pages as links with "Auto add new pages" shown as on, and its first edit saves the setting as on.
  • In a Navigation block there is no separate Detach for the Page List any more: editing one of its pages is the detach.
  • The Page List stays as it was (a live list, with Detach) when it can't be converted: in a Navigation block without a menu, when it is locked, when the menu doesn't allow inserting links, or when it has its own styles or other settings, which converting would drop.
  • One-step moves go to the next place you can see:
    • In the canvas, a link next to the Page List moves past one page, not the whole list, and the first and last page can move out of it. Submenus among the pages are never entered from the canvas.
    • In the Navigation List Views (the block inspector's List View tab, the site editor's navigation sidebar, and the extensible site editor's navigation screen), "Move down" past an expanded submenu puts the item into it, and past a collapsed one moves past it. The first or last child of a submenu moves out.
  • A newly published page is added at the end of its level (the end of the menu, or the end of its parent's submenu).

Why?

The Page List is a live mirror of the page tree, so editing it meant detaching it first, behind a dialog. Now editing it in place is the detach, and the auto add setting keeps the one thing the Page List did that plain links didn't.

How?

  • page-list/edit.jsx: in a Navigation block (up to 100 pages), the inner blocks are built with the existing Detach conversion and are still controlled. The list opts out of the block overlay, uses the Submenu's container settings, and passes two private container settings to useInnerBlocksProps: detachesOnEditKey and isMoveTransparentKey.
  • Detach on edit (block-editor, private): a root reducer step, withDetachOnEdit, replaces a container marked with detachesOnEditKey by its inner blocks when a persistent change alters them, in the same action. So the Navigation block's sync records one undo level by construction. If the replaced block was selected, as when its first inner block is deleted, the block before it or its parent is selected instead, as selectPreviousBlock does. The Navigation block reads getLastDetachedBlocks and turns the menu's meta on right after its onChange; that cached edit joins the same level.
  • One-step moves (block-editor, private): getBlockMoveDestination works out where one step lands, given which containers count as expanded and which are transparent (isMoveTransparentKey). moveBlocksUp, moveBlocksDown and the mover buttons use it with nothing expanded. List View row menus use the shared ListViewMoveMenuItems, which follows the List View's expanded rows: the three navigation List Views and the content-only List View.
  • The private container settings use symbol keys, so they aren't public useInnerBlocksProps options. useInnerBlocksProps relays them under string props, since React 18 drops symbol-keyed props, and the block list settings reducer compares symbol keys, which fast-deep-equal skips.
  • The extensible site editor renders the Navigation block's own AutoAddPagesControl as its footer, so there is one "Auto add new pages" control.
  • AutoAddPagesControl finds a Page List of all pages in the menu record and, when switched off, converts it through the menu record (editEntityRecord with the new blocks and the setting together). So it works outside the menu's block editor too, as in the site editors' footers.
  • Changes to core behavior that would be their own PRs:
    • isDropTargetValid no longer requires a dragged block's first allowed parent to be the drop target when the target's allowed blocks list it, which they only do once allowed parents are accounted for. Before, a link dragged by its toolbar handle couldn't drop between the Page List's pages.
    • withResetControlledBlocks moves inside withPersistentBlockChange, so the inner blocks it removes take the action's history mode. Before, its internal removal used up a history: 'ignore' mark.
    • withPersistentBlockChange doesn't compare the next action with a detach's own steps, so they don't split the undo step that caused the detach. For typing, this only pays off once Block Editor: Stop duplicate controllers from taking the selection #82706 lands.

Known limitations

  • This is a prototype. The block-editor part would likely be its own PR.
  • In the editor, the Page List in link mode renders a ul holding the links' div wrappers.
  • Each page link carries the same URL binding a Detach adds, so opening a menu with a Page List fetches each page once (up to 100 requests). Adding the bindings only at conversion would avoid that.
  • Using the mover arrows with the keyboard, the step that converts the Page List moves focus from the arrow into the moved item, because the item is moved into a new parent and remounts. Later steps keep focus.
  • Typing into a page link converts the list on the first keystroke, and the link's text field remounts. So a pause in that typing doesn't end the undo step, as it would on an ordinary link.
  • Typing a new label into a page link takes two undos to bring the Page List back. The Page List's inner block controller cleans up when it unmounts, between two keystrokes, and that starts a new undo step. Block Editor: Stop duplicate controllers from taking the selection #82706 fixes this: its undo grouping keeps a typing run across a change outside the history that leaves the typed block alone. The e2e test is pinned with test.fixme until then.
  • The mover buttons' screen reader description counts positions within the Page List, so a move out of or into it is described with the wrong positions.
  • getLastDetachedBlocks covers only the latest change to the blocks. A second block change in the same batch would hide a detach from the Navigation block, and "Auto add new pages" would stay off. Nothing dispatches that way today.
  • A menu with two Page Lists: converting one turns "Auto add new pages" on, but it doesn't add the pages the other list shows, since the server skips a page a Page List already shows.
  • If the menu doesn't allow Submenus (hidden in Preferences, or filtered out), a Page List with child pages still shows as links, and an edit isn't saved.
  • Adding a link among the pages and then canceling it still converts the Page List, since any change converts it.
  • Removing a page's only child page leaves the parent page as an empty Submenu. The move out of the Page List remounts the Submenu, so its switch back to a link when it loses its last child doesn't run. "Convert to Link" in its toolbar fixes it.
  • A Page List limited to one parent's subpages also turns "Auto add new pages" on when converted, so new top-level pages are added to that menu. This was a deliberate choice for now. And since the converted menu has no link to that parent, the parent's new subpages aren't added.
  • On a local test site, these e2e tests fail on trunk (e540c01) as well: cover.spec.js "can use focal point picker to set the focal point of the cover image" (one run of two), rich-text.spec.js "should preserve internal formatting" and template-part.spec.js "doesn't throw a block error when clicking on a link".

Testing Instructions

  1. On a site with a few pages (one with a child page) and no menus, insert a Navigation block. Its default menu is a Page List.
  2. Click a page in the menu: it is selected and nothing changes. The List View tab shows "Auto add new pages" switched on.
  3. Move, delete, rename, or "Add after" on a page link: the Page List becomes links and "Auto add new pages" stays on. Undo once: the Page List is back. After typing a new label, it takes two undos (see Known limitations).
  4. With a link right before the Page List, click its "Move right" arrow: it lands after the first page.
  5. In the List View tab, on a link above an expanded submenu, choose Options > Move down: it moves into the submenu. Collapse the submenu and try again: it moves past it.
  6. On a menu with a Page List of all pages, switch "Auto add new pages" off, in the List View tab or at the bottom of the site editor's navigation sidebar: the Page List becomes links to its pages and the setting is off. Undo once: the Page List is back, and the setting shows as on.

Automated coverage: navigation-page-list-conversion.spec.ts, navigation-step-movers.spec.ts and site-editor/navigation-list-view-movers.spec.ts (also run with the extensible site editor config).

🤖 Generated with Claude Code

jeryj and others added 4 commits November 23, 2026 15:41
A newly published top-level page goes at the end of the menu, and a child
page goes at the end of its parent's submenu, instead of among its sibling
page links in page order. A menu someone has rearranged keeps its order,
and the new link is easy to find.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inside a Navigation block, the Page List shows its pages as Navigation
Links and Submenus, which can be selected with one click and edited like
the menu's other links. It stays a live Page List until one of them is
changed: moved, removed, relabeled, or a link is added or dropped among
them. Then the Page List is replaced by the links as they are after that
change, and the menu's "Auto add new pages" setting is switched on, so
new pages keep arriving. One undo reverts both.

- The links are rebuilt only when the page data changes. The pages query
  returns a new array whenever a single page record is received, which
  replaced the links (and dropped a selection) shortly after load.
- The list opts out of the block overlay. Outside a Navigation block a
  click on a page selects the Page List itself, as before.
- The list's container gets the Navigation Submenu's settings, so its
  links get "Add before" and "Add after".
- With more than 100 pages the list stays as it is, since the query stops
  at 100 and converting would drop the rest.
- The "Auto add new pages" setting is hidden while the menu has a Page
  List, in the block inspector and on the extensible site editor's
  navigation screen.
- The setting's description is back to "Adds pages to this navigation
  when they are published."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… menu screen

On the extensible site editor's navigation screen, the setting sits at the
bottom of the menu area, under a full-width line that matches the page
header's border. When the menu is taller than the screen, it follows the
last item and is reached by scrolling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge List pages

A one-step move (Move up/down, Move left/right, and their shortcuts) now
goes to the next place the person can see, instead of past the next
sibling block whatever it holds.

- In the Navigation List Views (the block inspector's List View tab, the
  site editor's navigation sidebar, and the extensible site editor's
  navigation screen), "Move down" past an expanded submenu puts the item
  in it as the first child, and past a collapsed one goes past it. The
  first or last child of a submenu moves out of it.
- Inside a Navigation block, the Page List's links count as the menu's
  own items. A neighbor moves past one page at a time instead of the
  whole list, the first and last page can move out, and a submenu among
  the pages is never entered from the canvas. Moving across the list's
  edge converts it to links, and one undo reverts the move and the
  conversion.

How: a private `getBlockMoveDestination` selector works out where one step
lands, given which containers count as expanded and which are
transparent. Blocks opt in to being transparent with the private
`setBlockMoveTransparent` action; the Page List does in a Navigation
block. `moveBlocksUp` and `moveBlocksDown`, and the mover buttons'
disabled state, use it with nothing expanded. List View passes its own
expanded state to custom row menus through the private
`useListViewMoveDestination` hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🏷️ 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: +2.06 kB (+0.02%)

Total Size: 8.86 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 564 kB +1.1 kB (+0.19%)
build/scripts/block-library/index.min.js 437 kB +999 B (+0.23%)
build/scripts/edit-site/index.min.js 377 kB -42 B (-0.01%)

e314c63 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 21a402d try/auto-add-pages % Change
timeToFirstByte 58.2 ms +1.98% -3.35% 61.75 ms +5.18% -4.53% -5.75%
largestContentfulPaint 90 ms +6.67% -6.67% 92 ms +8.7% -0% -2.17%
lcpMinusTtfb 29 ms +23.1% -3.45% 30.6 ms +13.24% -2.61% -5.23%
wpBeforeTemplate 30.49 ms +7.74% -2.1% 32.34 ms +11.1% -4.73% -5.72%
wpTemplate 23.21 ms +2.84% -4.39% 24.71 ms +2.83% -3.93% -6.07%
wpTotal 54.21 ms +2.12% -3.78% 57.45 ms +5.69% -4.47% -5.64%
wpMemoryUsage 7.77 MB +0% -0% 7.75 MB +0% -0% 0.24%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 21a402d try/auto-add-pages % Change
timeToFirstByte 50.05 ms +4.1% -3.9% 51.65 ms +4.94% -3.78% -3.1%
largestContentfulPaint 84 ms +4.76% -0% 88 ms +4.55% -4.55% -4.55%
lcpMinusTtfb 35.5 ms +1.83% -3.24% 36.25 ms +2.48% -2.48% -2.07%
wpBeforeTemplate 28.09 ms +12.53% -2.21% 29.44 ms +8.02% -4.72% -4.59%
wpTemplate 17.43 ms +2.18% -2.29% 18.01 ms +5.05% -4.44% -3.22%
wpTotal 46.59 ms +4.53% -3.76% 48.36 ms +4.65% -4.9% -3.66%
wpMemoryUsage 6.45 MB +0% -0% 6.43 MB +0% -0% 0.29%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 21a402d try/auto-add-pages % Change
mediaProcessingJpeg 401.56 ms +2.1% -0.19% 403.89 ms +0.97% -1.12% -0.58%
mediaProcessingAvif 6126.53 ms +0.19% -0.07% 6163.65 ms +0.07% -0.09% -0.6%
mediaProcessingJpegToAvif 4205.76 ms +0.12% -0.1% 4254.08 ms +0.12% -0.35% -1.14%

media-upload

Metric 21a402d try/auto-add-pages % Change
jpegUploadProcessing 1989.06 ms +1.45% -23.29% 2008.39 ms +1.64% -19.97% -0.96%
pngUploadProcessing 279.51 ms +2.28% -4.84% 302.37 ms +4.9% -5.18% -7.56%
largeJpegUploadProcessing 1733.58 ms +14.62% -13.07% 2023.33 ms +0.81% -2.27% -14.32%
multipleImageUploadProcessing 2103.09 ms +2.45% -0.84% 2363.08 ms +2.01% -5.25% -11%

post-editor

Metric 21a402d try/auto-add-pages % Change
serverResponse 322.61 ms +3.34% -10.55% 332.93 ms +2.9% -1.88% -3.1%
firstPaint 349.47 ms +4.48% -12.69% 303.29 ms +17.48% -2.45% 15.23%
domContentLoaded 645.58 ms +1.18% -1.01% 645.62 ms +2.31% -0.56% -0.01%
loaded 646.51 ms +1.19% -1% 646.6 ms +2.31% -0.55% -0.01%
firstContentfulPaint 366.18 ms +4.56% -2.98% 359.07 ms +2.74% -1.18% 1.98%
firstBlock 1732.1 ms +2.6% -0.81% 1731.37 ms +0.24% -0.86% 0.04%
type 14.36 ms +4.53% -9.4% 14.45 ms +4.29% -8.79% -0.62%
typeWithoutInspector 14.14 ms +3.11% -12.09% 14.4 ms +12.64% -11.11% -1.81%
typeWithTopToolbar 18.77 ms +1.86% -3.78% 18.26 ms +6.85% -9.42% 2.79%
typeContainer 7.06 ms +3.12% -13.31% 7.1 ms +10.28% -13.24% -0.56%
focus 84.99 ms +3.2% -8.87% 87.45 ms +6.86% -3.12% -2.81%
firstFocus 210.5 ms +0% -0% 211.44 ms +0% -0% -0.44%
selectAll 313.22 ms +4.47% -5.86% 306.11 ms +0.01% -0.21% 2.32%
undo 23.9 ms +3.14% -5.4% 26.29 ms +3.8% -5.25% -9.09%
listViewOpen 29.34 ms +3.78% -2.62% 31.76 ms +6.74% -6.2% -7.62%
inserterOpen 32.79 ms +5.58% -6.56% 35.08 ms +7.81% -9.72% -6.53%
inserterHover 9.03 ms +3.77% -6.87% 9.72 ms +6.89% -6.28% -7.1%
inserterSearch 6.86 ms +5.54% -4.96% 7.34 ms +3.68% -7.63% -6.54%
loadPatterns 508.94 ms +2.91% -0.74% 542.83 ms +1.2% -4.15% -6.24%
wpTotal 313.95 ms +3.45% -10.81% 323.65 ms +3.13% -1.72% -3%
wpMemoryUsage 14.81 MB +0% -0% 14.81 MB +0% -0% 0.02%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 21a402d try/auto-add-pages % Change
serverResponse 262.77 ms +1.56% -8.08% 251.9 ms +1.29% -3.24% 4.32%
firstPaint 280.61 ms +14.53% -10.88% 258.3 ms +15.48% -6.26% 8.64%
domContentLoaded 558.69 ms +7.43% -2.94% 528.27 ms +1.75% -2.13% 5.76%
loaded 559.53 ms +7.44% -2.93% 529.14 ms +1.76% -2.12% 5.74%
firstContentfulPaint 319.04 ms +5.05% -3.34% 296.21 ms +2.06% -1.76% 7.71%
firstBlock 1699.42 ms +4.94% -1.78% 1611.86 ms +1.55% -0.76% 5.43%
type 12.8 ms +4.45% -12.34% 12.14 ms +2.88% -6.51% 5.44%
navigate 71.41 ms +8.7% -2.39% 84.42 ms +2.88% -6.04% -15.41%
loadPatterns 1075.87 ms +2.9% -3.87% 1089.96 ms +5.71% -3.24% -1.29%
loadPages 914.58 ms +1.01% -1.99% 919.8 ms +1.5% -1.34% -0.57%
wpTotal 256.26 ms +1.65% -8.34% 245.66 ms +1.27% -3.34% 4.31%
wpMemoryUsage 12.85 MB +0% -0% 12.83 MB +0% -0% 0.18%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

e314c63 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.

Navigates the items list via UP/DOWN arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page Two')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByLabel('Page Two') with timeout 5000ms
  - waiting for getByLabel('Page Two')
    14 × locator resolved to <button type="button" tabindex="-1" aria-pressed="false" id="view-list-0-226-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-226-label" aria-describedby="view-list-0-226-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:146:49
two users concurrently move list items (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts, passed after 1 failed attempt.
Error: expect(received).toBeLessThan(expected)

Expected: < 3
Received:   4

Call Log:
- Timeout 10000ms exceeded while waiting on the predicate
    at assertMovedOrder (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts:646:8)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts:650:10

yields to All notes when the canvas is too narrow in /test/e2e/specs/editor/various/block-notes-floating.spec.js, passed after 1 failed attempt.

e314c63 Run

- Page List: keep the links mounted while the pages refetch (after a page
  is saved), so a move across the list's edge still undoes in one step.
- Page List: no Detach in link mode. Editing a page already turns the
  list into links, with "Auto add new pages" on.
- Block mover: its description (at the start/end, can't be moved) follows
  where the block can move, like its disabled state.
- Unit tests for `getBlockMoveDestination` and `moveBlocksDown` with a
  transparent block.
- Put `expandBlock`'s doc comment back on it, and make the extensible site
  editor's menu items accessible when disabled, like the other two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oves

- Page List: links only when the conversion can happen: the Navigation
  block has a menu to switch "Auto add new pages" on for, the list can be
  removed, and links can be inserted in its place. Otherwise it stays a
  Page List as before (a Navigation block without a menu, a locked list,
  or a menu with an insert lock).
- Page List: in link mode it accepts whatever the Navigation block
  accepts, so a Home Link or Search steps past one page like a link does.
- One-step moves: a block that can't be removed stays in its parent, and
  in List View a collapsed transparent block is passed whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Page List: in link mode, take only the blocks its parent takes, so a
  list inside a submenu can't hold blocks the submenu would drop. Switch
  "Auto add new pages" on only once the list is really replaced.
- Page List: stay a Page List when its Parent Page isn't among the
  fetched pages (not published), instead of showing every top-level page.
- One-step moves: an edge child of a transparent block with nothing
  beyond it can't step out, since that step would look like no move.
- Navigation List View menus: guard the move against a missing
  destination in all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oves

- Page List: find the Parent Page among all the built links by page ID,
  so a parent under an unpublished page, or an unpublished parent, shows
  its children instead of every top-level page. This also fixes Detach,
  and replaces the guard added for unpublished parents.
- One-step moves: no destination for blocks locked against moving, so
  every caller (movers and List View menus) disables the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Page List: subscribe again whenever the links are rebuilt, so the check
  for a change the Navigation block already recorded stays after the
  links' own sync even when they first appear after a notice. One undo
  then still reverts a move across the list's edge.
- Navigation Link: links a Page List shows in a Navigation block are top
  level, so they use the menu's colors like their siblings, not the
  submenu colors.
- Page List conversion: a Parent Page that isn't found gives no links,
  matching the block's own list and the front end, instead of every
  top-level page (affects Detach).
- Block settings menu: Move up/down follows where the blocks can move,
  like the block movers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeryj and others added 7 commits November 23, 2026 22:48
A Page List in link mode now marks itself with a private block-editor flag, `setBlockDetachesOnEdit`. When a persistent, non-ignored change alters a flagged block's inner blocks, a root reducer step moves them out to where the block was and removes it, in the same action. The Navigation block's sync then records one undo level by construction, and the Navigation block turns "Auto add new pages" on right after it, from `getLastDetachedBlocks`, so the cached meta edit joins that level synchronously.

This removes the Page List's recorder subscription, its persistence check against a snapshot, and the microtask for the meta edit, which depended on subscriber order and broke on remounts.

`withResetControlledBlocks` moves inside `withPersistentBlockChange`, so the inner blocks it removes take the action's history mode. Before, its internal removal used up a `history: 'ignore'` mark, and a marked `setHasControlledInnerBlocks( clientId, false )` counted as persistent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A container's two private behaviors, passing its children one at a time on one-step moves and detaching on edit, are now private block list settings. Page List passes them to `useInnerBlocksProps` under the symbol keys `isMoveTransparentKey` and `detachesOnEditKey`, next to its other link-mode settings, so they land and go with those settings and are removed with the block.

This removes the `setBlockMoveTransparent` and `setBlockDetachesOnEdit` actions, their reducers and state, and the Page List effect that set and cleared them.

React 18 drops symbol-keyed props passed through JSX, so `useInnerBlocksProps` passes the private options on under string props, set after the options so only the symbol keys set them. `fast-deep-equal` skips symbol keys, so the block list settings reducer also compares them, or an update that changes only a private setting would be dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Navigation block's List View, the site editor's navigation sidebar and the extensible site editor's navigation screen each had their own Move up and Move down items, rewritten the same way. A private `ListViewMoveMenuItems` component in block-editor now renders them for all three. It reads the destinations when the menu opens, so the moves follow the rows the List View shows expanded, disables an item with nowhere to go while keeping it focusable, moves the blocks and closes the menu.

It replaces the private `useListViewMoveDestination` hook, which nothing else used. The copies had already drifted: the extensible site editor's closed the menu on a move with no destination.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sible site editor

The extensible site editor's navigation screen had its own copy of the "Auto add new pages" switch, with the same Page List rule, meta key and copy. It now renders the Navigation block's private `AutoAddPagesControl` as its footer, read from block-library's private APIs once the editor assets load, as `editor/content.tsx` already does. The control takes an optional `className` in place of its default class, so the inspector's styles can't reach the footer.

The screen also gains the control's `canUser( 'update' )` check. The route's loader already fetched the menu, which fills in the permission, so it costs no request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Typing into a page link's label converts the Page List on the first keystroke, and the rest of the word then started a second undo step. Two things split it: the detach's own move and remove steps became the last action that the next keystroke is compared with, and so did the Page List controller's cleanup when it unmounted, a change outside the undo history. `withPersistentBlockChange` now skips both when it remembers the last action, so one undo reverts the typing, the conversion and "Auto add new pages".

Skipping changes outside the history applies everywhere: such a change no longer splits an undo step that updates the same attribute.

Also from review:
- The content-only List View's Move up and Move down use `ListViewMoveMenuItems`. They follow the rows the List View shows expanded, like the navigation List Views, and every List View row no longer works out two move destinations on each store change.
- The Navigation block reads the detached blocks before its `onChange`, since the signal covers only the latest change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing undo steps

The previous commit left every change marked `history: 'ignore'` out of the last action that the next change is compared with. An undo resets the blocks that way, so typing straight after an undo joined the undone step: redo stayed enabled and dropped the new text.

Now only a change marked not persistent that changed nothing is left out. A detach also lets go of the block's controlled inner blocks itself, so the controller's cleanup when it unmounts changes nothing and still doesn't split the typing that caused the detach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hanging undo grouping

Leaving out every marked change that changes nothing, from the previous commit, also merged separate undo steps elsewhere: picking Cover overlay colors one after another, where each pick ends with a marked update that finds its flag already set.

`withPersistentBlockChange` is back to trunk's rule, apart from leaving out a detach's own steps. Instead, `useBlockSync` skips its cleanup on unmount for a block that is gone and no longer controlled, which only a detach leaves behind (it lets go of the controlled inner blocks itself, while an ordinary removal keeps the flag for the cleanup to clear). So nothing splits the typing that converts a Page List.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nc fix

Remove the `useBlockSync` early return for a block that is gone and no longer controlled, and the detach step that let go of the controlled inner blocks so the early return could tell a detach apart. Both only kept the typing that converts a Page List in one undo step.

The cleanup between two keystrokes now starts a new undo step again, so typing a new label takes two undos to bring the Page List back. #82706 fixes this: its undo grouping keeps a typing run across a change outside the history that leaves the typed block alone. The e2e test for it is pinned with `test.fixme` until then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeryj added a commit that referenced this pull request Nov 24, 2026
…nc fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks list

`isDropTargetValid` also required a dragged block's first allowed parent to be the drop target itself. A target's allowed blocks already take the allowed parents into account (see `canInsertBlockType`), so this only turned away blocks a container lists explicitly. A link dragged by its block toolbar handle couldn't drop between a Page List's page links, since a link's allowed parent is the Navigation block. The parent check now applies only at the root, where there are no allowed blocks to go by.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeryj added a commit that referenced this pull request Nov 24, 2026
…ks list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeryj and others added 6 commits November 24, 2026 11:38
- A page with an empty title converts to a link labeled "(no title)", as the Page List shows it. With an empty label, the link and its child pages weren't rendered on the front end.
- When the detach removes a selected block, select the block before it or its parent, as `selectPreviousBlock` does. Deleting the first page link left nothing selected, since removing it selected the Page List.
- The detach test for typing no longer sets up controlled inner blocks, which only an assertion removed earlier needed.
- The root comment in `isDropTargetValid` no longer suggests the root can match an allowed parent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A multi-selection that started on the detached block collapsed onto the block before it, which wasn't part of it. Only a single selection, which is what removing a block's first inner block leaves, moves now.

Also read the page title as defensively as the Page List does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Converting a Page List replaces it with its links and drops its own attributes, such as its colors, font size, class or anchor. In link mode, any edit to a page converts it, so an unrelated edit removed the styles without a warning. A Page List with attributes other than its parent page, lock and metadata now stays a live list, with Detach and its warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default menu is a Page List again, and in a Navigation block its pages show as links. The collaboration undo test waits for those links instead of Page List items, and a new test edits a page in the default menu, which converts it and turns "Auto add new pages" on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeryj added a commit that referenced this pull request Nov 24, 2026
jeryj and others added 2 commits November 24, 2026 14:48
…ript

Trunk now requires new files in the e2e tests to be TypeScript (#84829). The page helpers create pages through the REST API, since `createPage()` takes no menu order or parent page.

Trunk also added a test that calls `useNestedSettingsUpdate()` without the two private settings, so they are optional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeryj added a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rts-on-edit

# Conflicts:
#	packages/block-editor/src/store/private-selectors.ts
#	packages/block-library/src/navigation/edit/leaf-more-menu.jsx
#	packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.jsx
#	routes/navigation-edit/editor/leaf-more-menu.tsx
jeryj added a commit that referenced this pull request Dec 1, 2026
jeryj and others added 12 commits December 1, 2026 14:24
…rts-on-edit

# Conflicts:
#	lib/compat/wordpress-7.3/navigation-auto-add-pages.php
…rts-on-edit

# Conflicts:
#	packages/block-library/src/navigation/edit/auto-add-pages-control.tsx
#	routes/navigation-edit/stage.tsx
#	routes/navigation-edit/style.module.scss
… List

A Page List already shows every new page, so a menu that holds one now shows the setting switched on instead of hiding it. Switching it off replaces the Page List with links to the pages it shows and turns the setting off in one edit to the menu, so one undo brings the Page List back. The edit goes through the menu record, so it works the same in the block's List View tab and in both site editors, where the setting sits outside the menu's block editor. A Page List with more pages than it can turn into links keeps the setting on.

The Page List's link conversion moves to TypeScript so the setting can use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rts-on-edit

# Conflicts:
#	packages/block-library/src/navigation/edit/inner-blocks.tsx
#	packages/block-library/src/navigation/edit/leaf-more-menu.tsx
#	packages/block-library/src/page-list/edit.tsx
#	packages/block-library/src/page-list/use-convert-to-navigation-links.ts
…rts-on-edit

# Conflicts:
#	lib/compat/wordpress-7.3/navigation-auto-add-pages.php
A Page List limited to one parent page shows only the pages under it, and the server now adds other new pages next to it. So such a menu shows the setting as saved, and switching the setting off converts only Page Lists of all pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rts-on-edit

# Conflicts:
#	lib/compat/wordpress-7.3/navigation-auto-add-pages.php
#	packages/block-library/src/navigation/edit/auto-add-pages-control.tsx
#	phpunit/navigation-auto-add-pages-test.php
#	routes/navigation-edit/auto-add-pages-toggle.tsx
#	routes/navigation-edit/stage.tsx
#	test/e2e/specs/site-editor/navigation-auto-add-pages.spec.ts
…rts-on-edit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a menu with a Page List of all pages, creating a page from an appender's link UI also added a link to it, while the Page List showed the page too, so the menu listed it twice. The link UI now closes without a link in that case, which removes the new link, and the Page List shows the page once it is published. A link that already has a URL, a submenu, and a menu whose Page List is limited to one parent page keep the link as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e List

Leaving the new page to the Page List made the create flow look like it did nothing: the link UI closed, and the page showed up inside the Page List in page order rather than where it was added. The create flow adds its link again, and now turns the menu's Page Lists of all pages into links first, by moving each one's first link out to where the Page List is. That is an edit to the Page List's links, so it converts the Page List and turns "Auto add new pages" on, as the menu's other edits do. The page then shows once, as the new link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

[Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Edit Site /packages/edit-site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant