Skip to content

Excerpt Generation: Move generation into its own sidebar panel with a review modal - #1139

Open
ntsekouras wants to merge 2 commits into
WordPress:developfrom
ntsekouras:update-excerpt-gen-like-meta-description
Open

ntsekouras wants to merge 2 commits into
WordPress:developfrom
ntsekouras:update-excerpt-gen-like-meta-description

Conversation

@ntsekouras

@ntsekouras ntsekouras commented Oct 8, 2026 •

Copy link
Copy Markdown

What?

See WordPress/gutenberg#76076

Alternative to #1129, following the suggestion in #1129 (comment) to match the Meta Description experience.

Replaces the two buttons the Excerpt Generation experiment injected into core's excerpt UI with a single "Excerpt generation" panel in the document sidebar, registered via PluginDocumentSettingPanel. Generation happens in a modal where the suggestion can be reviewed and edited before it is applied to the post.

Why?

Gutenberg's DataForm-based inspector (see the linked issue) replaces the post summary and never renders the __experimentalPluginPostExcerpt slot, so the popover button would stop appearing there.

Independently of that, relying on a deprecated slot and injecting markup next to core's excerpt field by targeting class names was never a sound integration. PluginDocumentSettingPanel is the supported extension point and renders below the summary in both inspectors.

Compared to #1129, the modal keeps the experience consistent with Meta Description and lets the user edit and approve the suggestion before anything is written to the excerpt, instead of applying it automatically.

How?

  • One PluginDocumentSettingPanel replaces the inline button and the popover fill. It follows core's Excerpt panel preference, so it hides when that panel is disabled or removed.
  • The panel holds a single "Generate excerpt" / "Regenerate excerpt" button that opens a modal mirroring MetaDescriptionModal: an editable textarea with Apply, Regenerate, Copy to clipboard and Cancel. Closing the modal cancels an in-flight request. The hook only writes the excerpt to the store on Apply.
  • The panel does not repeat the excerpt text, since core's Summary already shows and edits it.

Testing Instructions

  1. Enable the Excerpt Generation experiment and connect a provider.
  2. Create a post with under 250 characters of content. Open the document sidebar: the "Excerpt generation" panel below Summary shows a disabled button with the too-short reason as a hint.
  3. Add more content. The hint disappears and the button is enabled. Click "Generate excerpt".
  4. A modal opens in a busy state, then the suggestion lands in the textarea. Edit it if you like and click "Apply": the Summary's excerpt row shows the text and the panel button reads "Regenerate excerpt".
  5. Click "Regenerate excerpt" and then "Cancel" in the modal: the excerpt is unchanged.
  6. Preferences → Panels: turn off "Excerpt". The "Excerpt generation" panel disappears too.
  7. With the Gutenberg plugin and the "Editor Inspector: Use DataForm" experiment enabled, repeat steps 2 to 4. The panel renders below the DataForm summary and the Excerpt field updates.

Screenshots or screencast

Before and after, same flow:

excerpt-generation-modal-before-after.mp4

Same flow with the DataForm inspector experiment:

excerpt-generation-modal-dataform-inspector.mp4

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Fable 5.1
Used for: Implementation, e2e tests, docs and changelog drafts; reviewed, directed and edited by me.

Open WordPress Playground Preview

@ntsekouras
ntsekouras requested a review from a team October 8, 2026 09:43
@ntsekouras
ntsekouras requested a review from jeffpaul as a code owner October 8, 2026 09:43
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

onClose: () => void;
}

function CopyButton( {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but some components could be reused across experiments. I think it would help with UI consistency without the risk of drifting.

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.67%. Comparing base (775f152) to head (2d6c377).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1139   +/-   ##
==========================================
  Coverage      81.67%   81.67%           
  Complexity      3103     3103           
==========================================
  Files            129      129           
  Lines          12334    12335    +1     
==========================================
+ Hits           10074    10075    +1     
  Misses          2260     2260           
Flag Coverage Δ
unit 81.67% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter dkotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and tests well and I do think this is the better approach compared to #1129. One minor thing around the changelog but otherwise is good for me.

@jeffpaul Still worth your eyes on this as this is a fairly significant change to how excerpt generation currently works.

Comment thread CHANGELOG.md
Comment on lines +6 to +7
### Changed
- Move Excerpt Generation into its own document sidebar panel instead of injecting buttons into the core excerpt field ([#1139](https://github.com/WordPress/ai/pull/1139)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this entry. Changelog is built at release time so as long as this changelog entry is in the PR description, that's good enough

@dkotter dkotter added this to the 1.5.0 milestone Oct 9, 2026
@jeffpaul jeffpaul moved this from Triage to Needs review in WordPress AI Roadmap Oct 9, 2026

@jeffpaul jeffpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My biggest concern is that there's nothing around the primary excerpt location for this, only a new sidebar panel below. Not sure moving the excerpt generation away from the excerpt field improves the authoring/editing workflows. I'm open to the amended excerpt generation modal approach, but would wildly prefer that injected into the existing excerpt modal than how this PR currently works.

Image

@dkotter

dkotter commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

My biggest concern is that there's nothing around the primary excerpt location for this, only a new sidebar panel below. Not sure moving the excerpt generation away from the excerpt field improves the authoring/editing workflows. I'm open to the amended excerpt generation modal approach, but would wildly prefer that injected into the existing excerpt modal than how this PR currently works.

So you can read the original PR (#1129) and particularly my comment and the follow ups. It seems the hook we were using to inject into that excerpt panel is being removed, likely in WP 7.2, and so this is an alternative that will still work once 7.2 goes out.

I agree though that this seems like a downgrade from what we have but if this WordPress/Gutenberg isn't going to give us* a better entry point, we don't have many options.

* Worth maybe an upstream issue/comment to see if we can get hooks in place? I know we had some traction on similar requests (though still waiting changes) so this may be another one we can ask on?

@jeffpaul

jeffpaul commented Oct 9, 2026

Copy link
Copy Markdown
Member

@oandregal as the one working on the upstream changes in Gutenberg, what's your advice on the most optimal user experience here?

@ntsekouras

ntsekouras commented Oct 19, 2026 •

Copy link
Copy Markdown
Author

JFYI the PR in GB to stabilize the DataForm inspector is up and is aimed to land today (and for 7.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

3 participants