Skip to content

Core Actions: Move the Edit and Quick edit actions of the site editor lists - #85290

Draft
oandregal wants to merge 11 commits into
trunkfrom
try/core-actions-edit-post-on-action-performed
Draft

oandregal wants to merge 11 commits into
trunkfrom
try/core-actions-edit-post-on-action-performed

Conversation

@oandregal

@oandregal oandregal commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #84932.

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 a post is edited depends on the screen listing it, so neither action navigates by itself. Their callback only calls onActionPerformed with the items, and each list handles the action id in the onActionPerformed handler it passes to usePostActions.

  • 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.
    • 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.
    • Both use context: 'list', so the post editor doesn't show them.
  • Site editor (v1)
    • useEditPostAction is replaced by useEditPostHandler, which navigates to the editor on edit-post.
    • useQuickEditPostAction is replaced by useQuickEditPostHandler, which opens the quick edit form on quick-edit.
    • 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 don't handle edit-post, so lib/experimental/extensible-site-editor.php unregisters it for those four post types.
    • The v2 pages list uses Quick edit, so it keeps the action: it opens the form from its existing onActionPerformed instead of defining its own action.

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.

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.

@github-actions github-actions Bot added [Package] Edit Site /packages/edit-site [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: +267 B (0%)

Total Size: 9.07 MB

📦 View Changed
Filename Size Change
build/modules/core-actions/page.min.js 2.17 kB +337 B (+18.44%) ⚠️
build/modules/core-actions/post_type_supports.min.js 6.32 kB +112 B (+1.8%)
build/scripts/edit-site/index.min.js 424 kB -182 B (-0.04%)

02f50d3 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 3f03bdf trunk % Change
timeToFirstByte 53.55 ms +11.39% -2.15% 54.7 ms +14.26% -3.75% -2.1%
largestContentfulPaint 92 ms +4.35% -4.35% 94 ms +4.26% -6.38% -2.13%
lcpMinusTtfb 35 ms +15.29% -4.71% 36.35 ms +14.72% -8.39% -3.71%
wpBeforeTemplate 29.08 ms +17.5% -2.72% 29.13 ms +19.02% -2.06% -0.17%
wpTemplate 21.07 ms +3.18% -4.51% 21.44 ms +2.57% -5.27% -1.73%
wpTotal 49.96 ms +11.75% -2.34% 50.95 ms +13.42% -4.26% -1.94%
wpMemoryUsage 7.68 MB +0% -0% 7.64 MB +0% -0% 0.52%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 3f03bdf trunk % Change
timeToFirstByte 45.8 ms +8.41% -1.31% 46.1 ms +5.42% -1.3% -0.65%
largestContentfulPaint 102 ms +3.92% -1.96% 104 ms +0% -3.85% -1.92%
lcpMinusTtfb 55.3 ms +4.61% -0.99% 54.75 ms +3.93% -1.64% 1%
wpBeforeTemplate 26.58 ms +11.36% -1.05% 26.8 ms +1.04% -0.67% -0.82%
wpTemplate 16.38 ms +4.46% -3.36% 16.26 ms +3.2% -1.91% 0.74%
wpTotal 42.86 ms +8.42% -1.42% 43.1 ms +4.9% -1.37% -0.56%
wpMemoryUsage 6.37 MB +0% -0% 6.33 MB +0% -0% 0.64%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 3f03bdf trunk % Change
mediaProcessingJpeg 397.98 ms +0.66% -0.29% 399.97 ms +0.98% -1.32% -0.5%
mediaProcessingAvif 6061.13 ms +0.52% -0.03% 6080.75 ms +0.38% -0.12% -0.32%
mediaProcessingJpegToAvif 4195.64 ms +0.46% -0.2% 4190.52 ms +0.37% -0.32% 0.12%

media-upload

Metric 3f03bdf trunk % Change
jpegUploadProcessing 1432.41 ms +38.13% -0.55% 1445.56 ms +0.4% -1.33% -0.91%
pngUploadProcessing 213.83 ms +17.55% -14.26% 199.64 ms +12.67% -8.49% 7.11%
largeJpegUploadProcessing 1418.47 ms +0.89% -0.56% 1430.47 ms +0.28% -0.93% -0.84%
multipleImageUploadProcessing 1601.33 ms +27.22% -1.55% 1580.78 ms +8.03% -0.1% 1.3%

post-editor

Metric 3f03bdf trunk % Change
serverResponse 527.32 ms +3.36% -9.83% 495.44 ms +2.01% -2.75% 6.43%
firstPaint 417.05 ms +22.93% -29.06% 477.73 ms +7.73% -40.41% -12.7%
domContentLoaded 1207.21 ms +5.7% -0.69% 1200.29 ms +3.38% -1.65% 0.58%
loaded 1208.34 ms +5.7% -0.68% 1201.33 ms +3.37% -1.65% 0.58%
firstContentfulPaint 528.59 ms +6.21% -3.97% 505.54 ms +5.69% -4.52% 4.56%
firstBlock 3476.66 ms +3.97% -1.43% 3559.91 ms +3.04% -1.48% -2.34%
type 17.37 ms +10.48% -0.4% 18.24 ms +8.99% -1.37% -4.77%
typeWithoutInspector 17.8 ms +4.83% -1.4% 19.73 ms +7.55% -13.48% -9.78%
typeWithTopToolbar 22.83 ms +5.91% -2.76% 23.62 ms +8.09% -4.87% -3.34%
typeContainer 8.07 ms +13.75% -9.29% 9.01 ms +7.33% -5.66% -10.43%
focus 123.15 ms +3.35% -1.07% 119.6 ms +6.9% -2.28% 2.97%
firstFocus 243.2 ms +0% -0% 237.59 ms +0% -0% 2.36%
selectAll 550.55 ms +1.41% -2.97% 577.74 ms +5.19% -4.78% -4.71%
listViewOpen 77.66 ms +13.71% -8.13% 78.14 ms +10.71% -3.61% -0.61%
inserterOpen 42.75 ms +3.98% -12.07% 38.32 ms +13.78% -2.17% 11.56%
inserterHover 13 ms +2.85% -9.92% 11.4 ms +15.35% -5% 14.04%
inserterSearch 7.69 ms +7.15% -6.89% 9.03 ms +3.43% -13.62% -14.84%
loadPatterns 660.76 ms +0.58% -3.27% 665.54 ms +53.37% -3.51% -0.72%
wpTotal 517.4 ms +3.23% -9.97% 485.73 ms +2.01% -2.84% 6.52%
wpMemoryUsage 14.72 MB +0% -0% 14.67 MB +0% -0% 0.32%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric 3f03bdf trunk % Change
serverResponse 318.93 ms +2.33% -13.74% 309.38 ms +3.82% -6.59% 3.09%
firstPaint 215.64 ms +55.35% -23.05% 244.38 ms +21.08% -2.76% -11.76%
domContentLoaded 954.05 ms +3.49% -0.92% 973.32 ms +2.48% -2.24% -1.98%
loaded 955.14 ms +3.48% -0.95% 974.13 ms +2.52% -2.25% -1.95%
firstContentfulPaint 401.26 ms +8.4% -14.89% 414.62 ms +6.04% -7.65% -3.22%
firstBlock 3405.06 ms +1.72% -0.9% 3479.36 ms +0.63% -1.43% -2.14%
type 15.88 ms +1.01% -4.66% 15.86 ms +5.74% -3.09% 0.13%
navigate 92.86 ms +8.65% -6.28% 88.52 ms +10.29% -7.02% 4.9%
loadPatterns 1009.42 ms +9.66% -4.45% 1069.18 ms +5.29% -12.15% -5.59%
loadPages 1030.84 ms +1.67% -2.34% 1059.04 ms +1.31% -0.94% -2.66%
wpTotal 310.97 ms +2.32% -14.14% 301.29 ms +3.92% -6.85% 3.21%
wpMemoryUsage 12.73 MB +0% -0% 12.69 MB +0% -0% 0.37%
wpDbQueries 44 +2.27% -0% 44.5 +1.12% -1.12% -1.12%

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

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


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

02f50d3 Run

oandregal and others added 9 commits October 23, 2026 13:35
Register the `edit-post` action of the site editor's pages list in the
`page` collection, for the users who can edit pages, in the `list`
context and first among the actions of pages.

The action does not navigate by itself: its callback only calls
`onActionPerformed` with the pages, so the screen listing it opens the
editor from the `onActionPerformed` handler it passes to
`usePostActions`. A list that does not handle it gets a no-op button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pages list now gets its Edit action from `usePostActions`, which
loads the `edit-post` action of `@wordpress/core-actions`, and opens the
editor from its `onActionPerformed` handler when that action is
performed. The order of the actions is unchanged: in the list layout,
Edit comes first as a primary action; in the other layouts, Edit and
Quick edit come before the other actions.

`useEditPostAction` stays in edit-site for the templates and patterns
lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `edit-post` action of `@wordpress/core-actions` only signals it was
performed and leaves the navigation to the list showing it. The lists of
the extensible site editor open an item on click and do not handle the
action, so the experiment unregisters it rather than showing a button
that does nothing.

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

Move the `edit-post` action from the `page` collection to
`post_type_supports` and register it for the post types the lists of the
site editor show: pages, templates, template parts, and patterns, when the
user can edit them. It stays first among the actions of each post type.

The action is not eligible for the patterns of the theme, which the
patterns list shows along the patterns of the user but which cannot be
edited.

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

The `edit-post` action of `@wordpress/core-actions` is now registered for
templates, template parts, and patterns too. The lists of the extensible
site editor open an item on click and do not handle the action, so the
experiment unregisters it for those post types as well.

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

The templates, template parts, and patterns lists now get their Edit
action from `usePostActions` and open the editor from the
`onActionPerformed` handler they pass to it, like the pages list. The
three lists share that handler, `useEditPostHandler`.

`useEditPostAction` has no consumers left, so it is removed.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oandregal
oandregal force-pushed the try/core-actions-edit-post-on-action-performed branch from 87e2217 to c48f7f4 Compare October 23, 2026 11:37
oandregal and others added 2 commits October 23, 2026 14:02
Register the `edit-post` action for `wp_navigation`, when the user can
edit navigation menus, so the navigation list of the extensible site
editor can use it instead of its own.

The action is primary for navigation menus only: clicking a menu in its
list only previews it, so the list shows the action opening the editor
as a button, like the action it replaces. The other post types keep it
in the actions menu.

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

Replace the Edit action of the navigation list with the `edit-post`
action of `@wordpress/core-actions`, which is registered for navigation
menus and is primary for them. The list opens the editor from the
`onActionPerformed` handler it passes to `usePostActions`.

The route no longer uses `@wordpress/icons`, so it drops the dependency.

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] Fields /packages/fields [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant