Skip to content

Add the Content Summarization UI#147

Merged
jeffpaul merged 39 commits intoWordPress:developfrom
dkotter:feature/content-summarization-ui
Feb 5, 2026
Merged

Add the Content Summarization UI#147
jeffpaul merged 39 commits intoWordPress:developfrom
dkotter:feature/content-summarization-ui

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Dec 18, 2025

What?

Closes #12

The base Content Summarization Experiment and Ability were added in #136. This PR builds on top of that to add in the actual UI to trigger content summarization within the post editor.

Why?

With #136 merged in, you can manually trigger summarization by using the Ability but there isn't a way to trigger that from the UI. This PR adds in that UI, making that Experiment more useful.

How?

  • Ensure we properly build the needed assets for the Content Summarization Experiment and then load that properly in the admin
  • Add a component that renders in the Post Status section of the block editor. This will render a button that can be clicked to generate a summary
  • When that button is clicked, hit the Content Summarization Ability endpoint and if successful, store the summary in post meta and also render that in the editor
  • Create a block variation of the paragraph block that we use to render the summary
  • Add a custom button to the toolbar of this block that can also be used to re-generate a summary
  • Also updates our NPM dependencies to their latest versions

Testing Instructions

  1. Go to Settings > AI Credentials and ensure you have a valid AI provider configured
  2. Go to Settings > AI Experiments and ensure you have the Content Summarization Experiment enabled
  3. Edit a post that has content (or add new content) and ensure you see a Generate AI Summary button in the Post Status sidebar
  4. Ensure you can click on this button, a loading state shows and once it completes, a block is automatically inserted into the editor with a summary
  5. Click into that block and ensure you see a Regenerate button in the toolbar
  6. Click on that button and ensure it works as expected

Screenshots or screencast

Generate Summary button showing in the Post Status section of the block editor
AI generated summary being rendered in the AI Summary paragraph block variation
Re-generate Summary button showing in the Post Status section of the block editor
Regeneration button working in the AI Summary block variation Open WordPress Playground Preview

@dkotter dkotter added this to the 0.2.0 milestone Dec 18, 2025
@dkotter dkotter self-assigned this Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 47.82609% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.99%. Comparing base (7de6575) to head (c2098b0).
⚠️ Report is 41 commits behind head on develop.

Files with missing lines Patch % Lines
...cludes/Experiments/Summarization/Summarization.php 47.82% 12 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #147      +/-   ##
=============================================
- Coverage      49.00%   48.99%   -0.02%     
- Complexity       469      473       +4     
=============================================
  Files             30       30              
  Lines           2306     2329      +23     
=============================================
+ Hits            1130     1141      +11     
- Misses          1176     1188      +12     
Flag Coverage Δ
unit 48.99% <47.82%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@jeffpaul
Copy link
Member

@jeffpaul
Copy link
Member

Note we'll want to update the screenshot numbers when this gets merged in, I left it with a hash instead of a number depending on when this versus other experiments get merged in.

@jeffpaul jeffpaul modified the milestones: 0.2.0, 0.3.0 Jan 7, 2026
@jeffpaul jeffpaul mentioned this pull request Jan 14, 2026
@dkotter dkotter requested a review from jeffpaul February 4, 2026 20:11
@dkotter
Copy link
Collaborator Author

dkotter commented Feb 4, 2026

@jeffpaul This is ready for final testing now

@jeffpaul
Copy link
Member

jeffpaul commented Feb 5, 2026

@dkotter primary issue I'm seeing is regenerating the summary resets any styles applied to that block, secondary but non-blocking here is the regenerate icon when shown in top toolbar appears to be placed lower than the other icons in the toolbar

Screen.Recording.2026-02-05.at.9.59.20.AM.mov

… to that. Make our button styles more specific so they only apply to the inline toolbar and not the top toolbar
… if there isn't an existing one. If there is an existing one, just update the content when a regeneration happens
@dkotter
Copy link
Collaborator Author

dkotter commented Feb 5, 2026

@dkotter primary issue I'm seeing is regenerating the summary resets any styles applied to that block, secondary but non-blocking here is the regenerate icon when shown in top toolbar appears to be placed lower than the other icons in the toolbar

Both of these should be fixed now. I've never used the fixed top-toolbar so hadn't tested that but adjusted the styling to work there as well.

And modified it so when we generate a summary, if a summary block doesn't exist, we create it and insert it. If it does exist, we now replace the content but leave the rest alone, so things like block styles should persist (inline styling, like bold and italics won't though).

jeffpaul
jeffpaul previously approved these changes Feb 5, 2026
Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Lovely, let's ship it!

@jeffpaul
Copy link
Member

jeffpaul commented Feb 5, 2026

Seeing the Dependency Review check fail, seems is bailing on mdn-data@2.12.2 in the package-lock.json file. That shows as a CC0-1.0 license which in some reading seems to be GPL-compatible, so I've opened #212 for that.

@jeffpaul
Copy link
Member

jeffpaul commented Feb 5, 2026

Bah, now seeing argparse@2.0.1 with the Python-2.0 license which I do not think is GPL-compatible. Do we know where that's coming in / if its used?

@dkotter
Copy link
Collaborator Author

dkotter commented Feb 5, 2026

Bah, now seeing argparse@2.0.1 with the Python-2.0 license which I do not think is GPL-compatible. Do we know where that's coming in / if its used?

That's not a dependency we are directly including but in doing some quick digging, seems that is pulled in via @wordpress/scripts which in turn includes eslint v8.57.1 which then includes this. This was updated here and went out in the 31.3.0 release of @wordpress/scripts, which this PR bumped from 31.2.0 to 31.4.0 and thus we're getting that warning now.

Quick fix is to downgrade back to 31.2.0 here though not necessarily a great long-term plan

@jeffpaul
Copy link
Member

jeffpaul commented Feb 5, 2026

Let's downgrade for now so we can get this feature merged/released, meantime I'll check with some folks on how best to proceed with >31.2.0

@dkotter
Copy link
Collaborator Author

dkotter commented Feb 5, 2026

Let's downgrade for now so we can get this feature merged/released, meantime I'll check with some folks on how best to proceed with >31.2.0

Okay, downgrading just that didn't work but I downgraded everything to what is currently in develop and good now. Worth noting though that in looking through our lockfile that is in develop, seems that particular dependency already exists so not sure why it wasn't getting flagged before and/or why it's getting flagged now. But at least on this PR, that check is passing 😂

Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Ok, a quick test and things still work as expected, let's merge this in!

@jeffpaul jeffpaul merged commit 0069203 into WordPress:develop Feb 5, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content Summarization

2 participants