Link Editorial Updates success notice to visual revisions - #861
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @kiranmagic7. 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. |
Asset_Loader prefixes handles with 'ai_' (underscore), not 'ai-' (hyphen) — the test was querying a non-existent handle and silently passing against wp_scripts()->get_data() returning false.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #861 +/- ##
==========================================
Coverage 80.18% 80.18%
Complexity 2526 2526
==========================================
Files 106 106
Lines 10240 10240
==========================================
Hits 8211 8211
Misses 2029 2029
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:
|
What?
Closes #507
Updates the "Review in Revisions" action on the Editorial Updates success snackbar to open WordPress 7.0's in-editor visual revisions UI instead of always linking to the classic
revision.phpscreen.Why?
The AI plugin requires WP 7.0+, which ships with an improved in-editor visual revisions experience. The classic revisions screen is a worse review experience for folks applying AI-refined edits and should only be used as a fallback.
How?
openVisualRevisions(), which opens the Document Settings sidebar (if collapsed) and clicks Core's own rendered "Revisions" button (PrivatePostLastRevisionin@wordpress/editor) to enter the visual revisions view.setCurrentRevisionIdis a private action gated behind@wordpress/private-apis, whose opt-in allow-list is hardcoded to WP core module names and throws for any other caller. Simulating a real click on Core's own button is the supported workaround; WordPress's own@wordpress/e2e-test-utils-playwrightpackage does the same thing for the Settings sidebar toggle.getRevisionReviewAction()to branch between the visual path and the classicrevision.phpfallback, gated on the editor'sdisableVisualRevisionssetting (true when classic metaboxes are active on the post, per WP core).openVisualRevisions()itself also falls back to the classic URL if the button can't be found within a short polling window, so the action never silently no-ops.Use of AI Tools
AI assistance: Implementation was planned with assistance from Claude Code (Anthropic). All code was reviewed, tested, and validated.
Testing Instructions
wp.data.dispatch('core/editor').updateEditorSettings({ disableVisualRevisions: true }), then repeat steps 3–4. Expected: navigates towp-admin/revision.php?revision=<id>.Screenshots or screencast
Changelog Entry