Fix canceled meta description suggestion state#653
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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>
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:
Manual verification:
Screenshots/Screencast
Before:
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.