Skip to content

Fix/visual revisions autosave diff 80455 - #80669

Draft
pranvinit wants to merge 3 commits into
WordPress:trunkfrom
pranvinit:fix/visual-revisions-autosave-diff-80455
Draft

Fix/visual revisions autosave diff 80455#80669
pranvinit wants to merge 3 commits into
WordPress:trunkfrom
pranvinit:fix/visual-revisions-autosave-diff-80455

Conversation

@pranvinit

Copy link
Copy Markdown
Contributor

What?

Closes 80455

Fixes Visual Revisions incorrectly highlighting unchanged blocks as additions when viewing an autosave.

Why?

Autosaves without an older revision were compared against empty content, causing every block to appear newly added.

How?

Autosaves are now compared against the currently saved post. The existing E2E test now verifies that only newly added content receives addition highlighting.

Testing Instructions

  1. Publish a post containing a paragraph.
  2. Add a second paragraph without changing the original.
  3. Run wp.data.dispatch( 'core/editor' ).autosave() in the browser console.
  4. Reload and click View the autosave.
  5. Confirm only the new paragraph is highlighted as added.
  6. Restore the autosave and confirm the notice disappears.

Testing Instructions for Keyboard

Follow the instructions above using Tab, Shift+Tab, Enter, and standard editor keyboard controls. Confirm the Visual Revisions controls remain keyboard accessible.

Screenshots or screencast

Not applicable.

Use of AI Tools

OpenAI Codex was used to investigate the issue, implement the fix, and draft tests and documentation. The changes were reviewed and validated by the contributor.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant