Repository navigation
Conversation
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>
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: +2.06 kB (+0.02%) Total Size: 8.86 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome 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
|
This was referenced Nov 23, 2026
- 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>
jeryj
added a commit
that referenced
this pull request
Nov 23, 2026
…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>
jeryj
added a commit
that referenced
this pull request
Nov 23, 2026
- 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>
jeryj
added a commit
that referenced
this pull request
Nov 23, 2026
…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>
jeryj
added a commit
that referenced
this pull request
Nov 24, 2026
- 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
added a commit
that referenced
this pull request
Nov 24, 2026
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>
jeryj
added a commit
that referenced
this pull request
Nov 24, 2026
…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>
- 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
…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
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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 touseInnerBlocksProps:detachesOnEditKeyandisMoveTransparentKey.block-editor, private): a root reducer step,withDetachOnEdit, replaces a container marked withdetachesOnEditKeyby 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, asselectPreviousBlockdoes. The Navigation block readsgetLastDetachedBlocksand turns the menu's meta on right after itsonChange; that cached edit joins the same level.block-editor, private):getBlockMoveDestinationworks out where one step lands, given which containers count as expanded and which are transparent (isMoveTransparentKey).moveBlocksUp,moveBlocksDownand the mover buttons use it with nothing expanded. List View row menus use the sharedListViewMoveMenuItems, which follows the List View's expanded rows: the three navigation List Views and the content-only List View.useInnerBlocksPropsoptions.useInnerBlocksPropsrelays them under string props, since React 18 drops symbol-keyed props, and the block list settings reducer compares symbol keys, whichfast-deep-equalskips.AutoAddPagesControlas its footer, so there is one "Auto add new pages" control.AutoAddPagesControlfinds a Page List of all pages in the menu record and, when switched off, converts it through the menu record (editEntityRecordwith the new blocks and the setting together). So it works outside the menu's block editor too, as in the site editors' footers.isDropTargetValidno 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.withResetControlledBlocksmoves insidewithPersistentBlockChange, so the inner blocks it removes take the action's history mode. Before, its internal removal used up ahistory: 'ignore'mark.withPersistentBlockChangedoesn'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
block-editorpart would likely be its own PR.ulholding the links'divwrappers.test.fixmeuntil then.getLastDetachedBlockscovers 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.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" andtemplate-part.spec.js"doesn't throw a block error when clicking on a link".Testing Instructions
Automated coverage:
navigation-page-list-conversion.spec.ts,navigation-step-movers.spec.tsandsite-editor/navigation-list-view-movers.spec.ts(also run with the extensible site editor config).🤖 Generated with Claude Code