Fix: Bug: Missing No-Provider UX Handling for Standalone Media Image Generation#575
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 #575 +/- ##
=============================================
- Coverage 71.41% 71.41% -0.01%
Complexity 1158 1158
=============================================
Files 67 67
Lines 5584 5586 +2
=============================================
+ Hits 3988 3989 +1
- Misses 1596 1597 +1
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:
|
…image actions fail
What?
Closes #572
Why?
generate()function inuseImageGenerationcallsensureProvider(), which dispatches a notice via the@wordpress/noticesstore. In the block editor, this store has a built-in renderer that displays the notice in the editor UI. However, on the standalone admin page there is no renderer for that store, so the notice is dispatched but never shown -the user sees no feedback when a provider is missing.How?
safeGenerate()wrapper inGenerateImageStandalonethat checksisProviderAvailable()before callinggenerate(). If no provider is configured, it sets the component-levelerrorstate, which renders an inline<Notice>component from@wordpress/componentsdirectly in the UI.useImageGenerationhook unchanged (no double-notice in block editor)media.ts), which also checksisProviderAvailable()directly for non-editor contextsUse of AI Tools
AI assistance: Yes
Tool(s): GitHub Copilot, Claude
Model(s): Claude Opus 4.6
Used for: Used for generating PR description and potential solution based on past PR and changes. Changes reviewed by me.
Testing Instructions
/wp-admin/upload.php?page=generate-imageScreenshots or screencast
Screen.Recording.2026-05-19.at.1.45.24.PM.mov
Changelog Entry