Skip to content

Core Actions: Move the Edit and Quick edit actions of the site editor lists (entity navigator) - #85291

Draft
oandregal wants to merge 14 commits into
trunkfrom
try/core-actions-edit-post-registry
Draft

oandregal wants to merge 14 commits into
trunkfrom
try/core-actions-edit-post-registry

Conversation

@oandregal

@oandregal oandregal commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #84932. Alternative to #85290.

Moves the "Edit" and "Quick edit" actions of the site editor lists from @wordpress/edit-site to @wordpress/core-actions, so the server registers them through the entity actions API like the other core actions.

Why?

The lists of pages, templates, template parts, and patterns built these two actions by hand (useEditPostAction and useQuickEditPostAction) and prepended them to the actions of usePostActions. As a result, plugins couldn't see, unregister, or replace them, and the extensible site editor had its own copy of Quick edit.

How?

How an entity is opened depends on the screen showing it, so the actions don't navigate by themselves. Instead, the screen sets a function in the editor store, and the callback of each action reads it from the registry DataViews passes to it. This differs from #85290, where each list handles the action ids in its onActionPerformed handler.

  • Editor: two private APIs, each set by the screen when it mounts and cleared when it unmounts:
    • setEntityNavigator / getEntityNavigator: ( { postType, postId } ) => void, opens an entity for editing.
    • setQuickEditOpener / getQuickEditOpener: ( { postType, postIds } ) => void, opens the quick edit form.
  • Core Actions
    • edit-post (in post_type_supports) is registered for pages, templates, template parts, and patterns when the user can edit them. It is not eligible for trashed items or theme patterns. Its callback calls the entity navigator.
    • quick-edit (in page) is registered for pages when the user can edit them, right after edit-post. Its label switches between "Quick edit" and "Bulk edit", and it supports bulk. Its callback calls the quick edit opener.
    • Both use context: 'list', so the post editor doesn't show them. On a screen that sets no function, they do nothing.
  • Site editor (v1)
    • The app sets the entity navigator once, inside the router: it navigates to the entity with the canvas in edit mode.
    • The pages list sets the quick edit opener: it adds the pages to the URL, which shows the form.
    • useEditPostAction, useQuickEditPostAction, and the dataviews-actions folder are removed. The pages list keeps its ordering. In the list layout, Quick edit is dropped and Edit is primary.
  • Extensible site editor (v2)
    • The lists open an item on click and set no entity navigator, so lib/experimental/extensible-site-editor.php unregisters edit-post for those four post types.
    • The posts list sets the quick edit opener and uses the core quick-edit action instead of defining its own.

Testing Instructions

  1. In the site editor, open Pages (table or grid layout). Open the actions menu of a page: it has Edit and Quick edit.
  2. Click Quick edit: the quick edit panel opens. Select several pages: the bulk action reads Bulk edit.
  3. Click Edit on a page: the editor opens with the page.
  4. Switch the pages list to the list layout: Quick edit is gone, and Edit is the primary action.
  5. Open Templates, Patterns → Site patterns, and Patterns → All template parts: each item has Edit, which opens it in the editor. Theme patterns have no Edit action.
  6. Enable the extensible site editor experiment. In its pages list, Quick edit opens the quick edit form and there is no Edit action. The templates and patterns lists have no Edit action either.
  7. As a contributor, query /wp/v2/entity-actions for pages: neither edit-post nor quick-edit is registered.

Testing Instructions for Keyboard

The actions are the same DataViews actions as before, in the same menus: open the actions menu of an item with the keyboard, and use Edit and Quick edit with Enter.

Screenshots or screencast

Site editor (v1), with this branch:

Pages Pages: Quick edit
pages pages-quick-edit
Templates Patterns Template parts
templates patterns template-parts

Use of AI Tools

This PR was authored with Claude Code (Claude Opus 5.5): code, tests, this description, and the screenshots. I reviewed the changes.

@oandregal oandregal added [Type] Enhancement A suggestion for improvement. [Package] Edit Site /packages/edit-site labels Oct 21, 2026
@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Fields /packages/fields labels 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: +792 B (+0.01%)

Total Size: 9.07 MB

📦 View Changed
Filename Size Change
build/modules/core-actions/page.min.js 2.4 kB +573 B (+31.35%) 🚨
build/modules/core-actions/post_type_supports.min.js 6.37 kB +167 B (+2.69%)
build/scripts/edit-site/index.min.js 424 kB -101 B (-0.02%)
build/scripts/editor/index.min.js 620 kB +153 B (+0.02%)

69d764f Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric e22d49a trunk % Change
timeToFirstByte 33.7 ms +12.31% -1.78% 33.1 ms +17.82% -1.81% 1.81%
largestContentfulPaint 64 ms +0% -6.25% 64 ms +3.13% -6.25% 0%
lcpMinusTtfb 26.75 ms +14.21% -7.29% 29.85 ms +4.52% -18.43% -10.39%
wpBeforeTemplate 17.99 ms +14.67% -1.5% 17.61 ms +24.08% -1.08% 2.16%
wpTemplate 12.8 ms +4.3% -3.44% 12.67 ms +4.58% -3.47% 1.03%
wpTotal 30.64 ms +11.68% -1.44% 30.32 ms +16.62% -1.88% 1.06%
wpMemoryUsage 7.68 MB +0% -0% 7.64 MB +0% -0% 0.51%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric e22d49a trunk % Change
timeToFirstByte 29.55 ms +7.28% -2.71% 26.3 ms +10.84% -3.61% 12.36%
largestContentfulPaint 68 ms +2.94% -0% 60 ms +3.33% -6.67% 13.33%
lcpMinusTtfb 38.45 ms +1.95% -5.98% 32.5 ms +6% -4% 18.31%
wpBeforeTemplate 16.44 ms +10.16% -2.92% 16.24 ms +10.04% -3.14% 1.23%
wpTemplate 10.34 ms +1.74% -4.16% 7.38 ms +9.76% -3.25% 40.11%
wpTotal 26.9 ms +8.44% -2.94% 24.06 ms +10.64% -3.99% 11.8%
wpMemoryUsage 6.37 MB +0% -0% 6.22 MB +0% -0% 2.44%
wpDbQueries 13 +0% -0% 9 +0% -0% 44.44%

media-processing

Metric e22d49a trunk % Change
mediaProcessingJpeg 216.65 ms +5.04% -0.96% 218.57 ms +1.33% -0.78% -0.88%
mediaProcessingAvif 3505.4 ms +1.01% -0.4% 3600.09 ms +0.36% -0.21% -2.63%
mediaProcessingJpegToAvif 2439.14 ms +0.7% -0.29% 2452.2 ms +0.17% -0.46% -0.53%

media-upload

Metric e22d49a trunk % Change
jpegUploadProcessing 1359.07 ms +4.18% -33.17% 891.37 ms +1.14% -1.31% 52.47%
pngUploadProcessing 159.86 ms +2.16% -7.91% 143.95 ms +5.63% -6.79% 11.05%
largeJpegUploadProcessing 936.9 ms +48.42% -1.06% 872.77 ms +1.69% -1.28% 7.35%
multipleImageUploadProcessing 1485.08 ms +0.7% -1.23% 1411.38 ms +1.87% -29.68% 5.22%

post-editor

Metric e22d49a trunk % Change
serverResponse 486.84 ms +0.79% -3.59% 505.25 ms +5.74% -4.2% -3.64%
firstPaint 355.84 ms +35.56% -17.05% 405.91 ms +24.41% -29.37% -12.34%
domContentLoaded 1175.34 ms +4.37% -2.39% 1190.58 ms +2.13% -3.61% -1.28%
loaded 1176.66 ms +4.33% -2.41% 1191.61 ms +2.11% -3.6% -1.25%
firstContentfulPaint 445.32 ms +18.53% -16.11% 514.81 ms +3.2% -2.22% -13.5%
firstBlock 3407.44 ms +3.33% -2.76% 3451.63 ms +5.62% -0.98% -1.28%
type 18.26 ms +1.31% -4.44% 18.4 ms +6.25% -3.86% -0.76%
typeWithoutInspector 17.95 ms +3.51% -4.51% 18.31 ms +6.99% -3% -1.97%
typeWithTopToolbar 22.53 ms +11.23% -4.7% 22.43 ms +7.27% -3.52% 0.45%
typeContainer 8.53 ms +6.21% -2.11% 9.06 ms +1.88% -11.81% -5.85%
focus 118.43 ms +8.79% -3.99% 120.4 ms +10.71% -2.85% -1.64%
firstFocus 220.78 ms +0% -0% 224.35 ms +0% -0% -1.59%
selectAll 560.15 ms +2.01% -2.58% 571.49 ms +1.7% -0.86% -1.98%
listViewOpen 83.35 ms +6.81% -9.53% 78.04 ms +11.17% -8.69% 6.8%
inserterOpen 40.02 ms +19.97% -9.65% 43.2 ms +2.52% -5.69% -7.36%
inserterHover 11.05 ms +17.1% -5.88% 11.78 ms +10.87% -5.94% -6.2%
inserterSearch 8.28 ms +10.63% -10.51% 8.46 ms +6.03% -5.2% -2.13%
loadPatterns 635.72 ms +1.72% -4.85% 642.25 ms +4.07% -2% -1.02%
wpTotal 477.17 ms +0.73% -3.55% 495.87 ms +5.7% -4.39% -3.77%
wpMemoryUsage 14.72 MB +0% -0% 14.67 MB +0% -0% 0.32%
wpDbQueries 55 +0% -1.82% 54.5 +0.92% -0.92% 0.92%

site-editor

Metric e22d49a trunk % Change
serverResponse 471.32 ms +4.68% -3.31% 485.95 ms +5.27% -4.12% -3.01%
firstPaint 261.79 ms +43.06% -14.37% 255.2 ms +16.77% -9.13% 2.58%
domContentLoaded 1257.62 ms +0.45% -2.09% 1278.87 ms +1.32% -1.47% -1.66%
loaded 1258.53 ms +0.47% -2.1% 1280.09 ms +1.29% -1.46% -1.68%
firstContentfulPaint 506.81 ms +4.07% -26.43% 520.07 ms +2.47% -9.83% -2.55%
firstBlock 4507.26 ms +0.68% -0.76% 4695.28 ms +1.34% -1.19% -4%
type 17.98 ms +6.84% -6.45% 17.43 ms +5.11% -2.7% 3.16%
navigate 112.03 ms +18.7% -3.38% 124.28 ms +7.57% -6.03% -9.86%
loadPatterns 1247.75 ms +5.12% -4.92% 1275.42 ms +3.01% -1.51% -2.17%
loadPages 975.52 ms +3.99% -1.81% 945.74 ms +7.28% -1.19% 3.15%
wpTotal 461.97 ms +4.7% -3.26% 476.64 ms +5.32% -4.21% -3.08%
wpMemoryUsage 12.73 MB +0% -0% 12.69 MB +0% -0% 0.36%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

69d764f 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

69d764f Run

oandregal and others added 12 commits October 23, 2026 13:37
Add the `setEntityNavigator` private action and the `getEntityNavigator`
private selector to the editor store. The screen sets, once, the function
opening an entity for editing the way it does, `( { postType, postId } )
=> void`, and the actions opening an entity read it from the registry
DataViews passes to their callbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register the `edit-post` action of the `page` collection for pages, first,
when the user can edit them. Its data (label, `context: 'list'`) is in
`action.php`; its callback opens the page with the entity navigator the
screen sets in the editor store, and does nothing when the screen sets none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set the entity navigator of the site editor once, inside the router: it
navigates to the entity with the canvas in edit mode. The pages list then
uses the `edit-post` action the server registers instead of the one of
`useEditPostAction`, which templates and patterns keep using, in the same
place: first and primary in the list layout, before "Quick edit" otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `edit-post` action opens a page with the entity navigator the screen
sets in the editor store, which the extensible site editor does not set:
its lists open a page when it is clicked. Unregister the action while the
experiment is enabled.

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

Move the `edit-post` action from the `page` collection to the
`post_type_supports` one, and register it, first, for pages, templates,
template parts, and patterns, when the user can edit them. It opens the
entity with the entity navigator the screen sets, so the site editor lists
can use it instead of the one of `useEditPostAction`. It is not offered for
the patterns of the theme, which are not entity records.

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

Core now registers the `edit-post` action for templates, template parts, and
patterns too. The extensible site editor sets no entity navigator, so it
unregisters the action for those post types as well, not only for pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The templates list uses the `edit-post` action the server registers, first,
instead of the one of `useEditPostAction`. It opens the template with the
entity navigator the app sets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The patterns and template parts lists use the `edit-post` action the server
registers, first, instead of the one of `useEditPostAction`. It is not
offered for the patterns of the theme, which cannot be edited. With no list
using it anymore, remove `useEditPostAction`.

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

Add the `setQuickEditOpener` private action and the `getQuickEditOpener`
private selector to the editor store. The screen listing the entities sets
the function opening their quick edit form the way it does,
`( { postType, postIds } ) => void`, and the "Quick edit" action reads it from
the registry DataViews passes to its callback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register the `quick-edit` action of the `page` collection for pages, after
the Edit action, when the user can edit them. Its data (label, `context:
'list'`, primary, bulk) is in `action.php`; its script parts label it "Bulk
edit" for several pages, and its callback opens the quick edit form with the
opener the screen sets in the editor store. It does nothing when the screen
sets none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pages list sets the quick edit opener while it is mounted: it adds the
pages to the URL, which shows the quick edit form. It then uses the
`quick-edit` action the server registers instead of the one of
`useQuickEditPostAction`, in the same place: after "Edit" outside the list
layout, and not in the list layout, which shows the page instead. With no
list using it anymore, remove `useQuickEditPostAction`, the last hook of
`dataviews-actions`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The posts list of the extensible site editor sets the quick edit opener
while it is mounted, and uses the `quick-edit` action the server registers
instead of its own, in the same place: first, and not in the list layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oandregal
oandregal force-pushed the try/core-actions-edit-post-registry branch from 190cfb6 to 43453fb Compare October 23, 2026 11:40
oandregal and others added 2 commits October 23, 2026 14:18
Register the `edit-post` action for `wp_navigation` too, for the users
who can edit navigation menus. Like for the other post types, it opens
the menu with the entity navigator the screen sets in the editor store.

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

Replace the route's own Edit action of navigation menus with the one of
`@wordpress/core-actions`. The list sets the entity navigator the action
opens a menu with, and shows the action as a button, since clicking a menu
only previews it. The experiment keeps the action of navigation menus
registered.

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] Edit Site /packages/edit-site [Package] Editor /packages/editor [Package] Fields /packages/fields [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant