Skip to content

Link Editorial Updates success notice to visual revisions - #861

Merged
dkotter merged 6 commits into
WordPress:developfrom
zeus2611:feature/issue-507-visual-revisions
Jul 24, 2026
Merged

Link Editorial Updates success notice to visual revisions#861
dkotter merged 6 commits into
WordPress:developfrom
zeus2611:feature/issue-507-visual-revisions

Conversation

@zeus2611

@zeus2611 zeus2611 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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.php screen.

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?

  • Added openVisualRevisions(), which opens the Document Settings sidebar (if collapsed) and clicks Core's own rendered "Revisions" button (PrivatePostLastRevision in @wordpress/editor) to enter the visual revisions view.
  • This isn't reachable via a public store action — setCurrentRevisionId is 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-playwright package does the same thing for the Settings sidebar toggle.
  • Added getRevisionReviewAction() to branch between the visual path and the classic revision.php fallback, gated on the editor's disableVisualRevisions setting (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

  1. Enable the Editorial Updates experiment.
  2. Create/open a post, add a paragraph block, attach a pending Editorial Note to it.
  3. Click Apply Editorial Updates in the Document sidebar.
  4. After refinement completes, click Review in Revisions on the success snackbar.
  5. Expected: the visual revisions diff opens in-editor (no page navigation).
  6. To test the fallback: in the browser console, run wp.data.dispatch('core/editor').updateEditorSettings({ disableVisualRevisions: true }), then repeat steps 3–4. Expected: navigates to wp-admin/revision.php?revision=<id>.

Screenshots or screencast

Before After
Screenshot 2026-07-13 at 7 58 50 PM Screenshot 2026-07-13 at 7 57 33 PM

Changelog Entry

Changed - Editorial Updates now links to the WP 7.0 visual revisions
screen when reviewing AI-refined content, falling back to the classic
revisions screen when visual revisions are unavailable.

Open WordPress Playground Preview

@zeus2611
zeus2611 requested a review from a team July 13, 2026 15:00
@github-actions

github-actions Bot commented Jul 13, 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.

Unlinked Accounts

The 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.

Unlinked contributors: kiranmagic7.

Co-authored-by: zeus2611 <n1schay@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

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

@jeffpaul jeffpaul added this to the 1.2.0 milestone Jul 13, 2026
@jeffpaul jeffpaul mentioned this pull request Jul 13, 2026
28 tasks
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.
Comment thread src/experiments/editorial-updates/hooks/useEditorialUpdates.ts Outdated
Comment thread src/experiments/editorial-updates/hooks/useEditorialUpdates.ts Outdated
Comment thread src/experiments/editorial-updates/hooks/useEditorialUpdates.ts
Comment thread src/experiments/editorial-updates/hooks/useEditorialUpdates.ts Outdated
Comment thread tests/e2e/specs/experiments/editorial-updates.spec.js Outdated
@dkotter dkotter modified the milestones: 1.2.0, 1.3.0 Jul 14, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.18%. Comparing base (7d11901) to head (b844085).

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           
Flag Coverage Δ
unit 80.18% <ø> (ø)

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 merged commit 02f2742 into WordPress:develop Jul 24, 2026
24 checks passed
@zeus2611
zeus2611 deleted the feature/issue-507-visual-revisions branch July 27, 2026 16:35
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.

Iterate on Editorial Updates end flow to Visual Revisions

3 participants

Sponsor
SponsoredKunjungi sekarang
Promo