Skip to content

Update the "Generate Excerpt" button to indicate when excerpt generation is in progress.#389

Open
iamdharmesh wants to merge 3 commits intoWordPress:developfrom
iamdharmesh:fix/380
Open

Update the "Generate Excerpt" button to indicate when excerpt generation is in progress.#389
iamdharmesh wants to merge 3 commits intoWordPress:developfrom
iamdharmesh:fix/380

Conversation

@iamdharmesh
Copy link
Copy Markdown
Member

@iamdharmesh iamdharmesh commented Apr 9, 2026

What?

Closes #380

Updates the “Generate Excerpt” button to say Generating... when excerpt generation is happening.

Why?

While we have a loading state on these buttons, updating the text makes it more clear and matches how we do things in other places.

How?

Updates the “Generate Excerpt” button to show Generating... while excerpt generation is in progress.

Use of AI Tools

N/A

Testing Instructions

  1. Check out this PR branch and run npm i && npm run build.
  2. Add a valid AI connector.
  3. Turn on excerpt generation.
  4. Create a post.
  5. Find the Add an excerpt… button in the post status sidebar and click it to open the popover.
  6. Click the Generate excerpt button in the popover.
  7. Ensure the text updates to Generating....
  8. Once the excerpt is generated, make sure the button updates to Re-generate excerpt.
  9. Click it again and ensure the button text updates to Generating....

Testing Instructions for Keyboard

Screenshots or screencast

Screen.Recording.2026-04-09.at.10.51.25.AM.mov
Open WordPress Playground Preview

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

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: iamdharmesh <dharm1025@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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.75%. Comparing base (cf3f12a) to head (1cb9c5f).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #389   +/-   ##
==========================================
  Coverage      65.75%   65.75%           
  Complexity       763      763           
==========================================
  Files             53       53           
  Lines           3863     3863           
==========================================
  Hits            2540     2540           
  Misses          1323     1323           
Flag Coverage Δ
unit 65.75% <ø> (ø)

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 jeffpaul added this to the 0.8.0 milestone Apr 9, 2026
@jeffpaul jeffpaul requested review from dkotter and jeffpaul April 9, 2026 14:15
const buttonLabel = hasExcerpt
? __( 'Re-generate excerpt', 'ai' )
: __( 'Generate excerpt', 'ai' );
let buttonLabel: string = __( 'Generate excerpt', 'ai' );
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should probably apply these same changes to the inline button:

const buttonLabel = hasExcerpt
? __( 'Re-generate excerpt', 'ai' )
: __( 'Generate excerpt', 'ai' );

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.

Add loading states to Excerpt Generation

3 participants