Fix[Alt Generation]: Generate button becomes unresponsive after using Next/Previous in media modal#631
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #631 +/- ##
==========================================
Coverage 74.45% 74.45%
Complexity 1740 1740
==========================================
Files 85 85
Lines 7521 7521
==========================================
Hits 5600 5600
Misses 1921 1921
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @kohcsi. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
fb6f249 to
8ddad80
Compare
jeffpaul
left a comment
There was a problem hiding this comment.
Works as expected via Playground testing, thanks!
… Next/Previous in media modal (#631) Fixed - Alt Text Generation button becomes unresponsive after using Next/Previous in the media modal. Unlinked contributors: kohcsi. Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>
|
@kohcsi if you're able to confirm your WordPress.org username (and ideally link it with your GitHub account), then I can ensure its properly credited in the AI plugin release (and associated AI Contributor badge)... thanks! |
What?
Closes #627
Fixes the Alt Text Generation button becoming unresponsive after using Previous/Next inside the media modal.
Why?
The media modal replaces or refreshes the attachment details UI during navigation. The existing initialization only handled the initial modal state, so the Generate/Regenerate button could lose its event binding after moving to another attachment.
How?
Bind to the media edit frame’s refresh event after the edit attachment modal is first opened. This re-initializes the alt text controls when the modal refreshes for Previous/Next navigation, while ensuring the refresh handler is registered only once to avoid duplicate generation requests.
Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Initial code skeleton; final implementation was reviewed and edited by me.
Testing Instructions
Screencasts
Before
before.mov
After
after.mov
Changelog Entry