Skip to content

Fix canceled meta description suggestion state#653

Merged
dkotter merged 2 commits into
WordPress:developfrom
ekamran:shifteq/fix-meta-description-cancelled-suggestion
Jun 4, 2026
Merged

Fix canceled meta description suggestion state#653
dkotter merged 2 commits into
WordPress:developfrom
ekamran:shifteq/fix-meta-description-cancelled-suggestion

Conversation

@ekamran

@ekamran ekamran commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What?

Fix the Meta Description modal so a canceled regenerated suggestion does not appear when reopening the modal through “Edit description”.

Why?

When a post already had a saved meta description, regenerating a new suggestion and canceling it left that suggestion in component state.

After that, reopening “Edit description” could show the canceled suggestion in the textarea instead of the saved meta description shown in the sidebar.

How?

The panel now tracks whether the modal is opened for editing the saved description or for generating a suggestion.

Suggestions are only passed into the modal while it is in generate mode, and stale suggestion state is cleared when leaving the modal.

Testing Instructions

Automated checks run locally:

npm run lint:js -- src/experiments/meta-description/components/useMetaDescription.ts src/experiments/meta-description/components/MetaDescriptionPanel.tsx tests/e2e/specs/experiments/meta-description.spec.js
npm run typecheck
npm run build
WP_BASE_URL=http://localhost:8888 npm run test:e2e -- tests/e2e/specs/experiments/meta-description.spec.js

Manual verification:

  1. Open a post with a saved meta description.
  2. Click “Regenerate meta description”.
  3. Wait for the generated suggestion.
  4. Click “Cancel”.
  5. Click “Edit description”.
  6. Confirm the modal textarea shows the saved meta description, not the canceled suggestion.

Screenshots/Screencast

Before:

BEFORE

After:

AFTER

Use of AI Tools

AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Repository review, reproduction planning, implementation guidance, test updates, and local verification. I reviewed the changes, tested the behavior locally, and take responsibility for the final submission.

Open WordPress Playground Preview

@github-actions

github-actions Bot commented Jun 3, 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: ekamran <ekamran@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

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

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.57%. Comparing base (64e8032) to head (534bcca).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #653   +/-   ##
==========================================
  Coverage      74.57%   74.57%           
  Complexity      1754     1754           
==========================================
  Files             85       85           
  Lines           7548     7548           
==========================================
  Hits            5629     5629           
  Misses          1919     1919           
Flag Coverage Δ
unit 74.57% <ø> (ø)

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 added this to the 1.1.0 milestone Jun 4, 2026
Comment thread src/experiments/meta-description/components/MetaDescriptionPanel.tsx Outdated
@dkotter dkotter merged commit 4f27b52 into WordPress:develop Jun 4, 2026
25 of 26 checks passed
@ekamran ekamran deleted the shifteq/fix-meta-description-cancelled-suggestion branch June 7, 2026 17:50
jorgefilipecosta pushed a commit that referenced this pull request Jun 15, 2026
Fixed - Clear out the meta description suggestion when the modal closes

Co-authored-by: ekamran <ekamran@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
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.

2 participants