Skip to content

Editor: Merge adjacent revision inline diffs - #80579

Open
shail-mehta wants to merge 8 commits into
trunkfrom
fix/merge-revision-inline-diffs
Open

Editor: Merge adjacent revision inline diffs#80579
shail-mehta wants to merge 8 commits into
trunkfrom
fix/merge-revision-inline-diffs

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What?

Part of #77530.

Merges adjacent word-level inline revision diffs into fewer <del> / <ins> elements so consecutive edits are grouped instead of marked one word at a time.

Why?

Editor: The editor inconsistently marks up groups of words vs. individual words. E.g., if you've edited several words in a row, it may group them all, group some of them, or have all of them individually in separate del or ins elements. I couldn't figure out why during my testing. However, when they are separate, they significantly increase verbosity for screen reader users.

How?

Add mergeTextDiffParts() in block-diff.js to merge adjacent removed/added tokens into a single removed part and a single added part.

Testing Instructions

  1. Create a post, and iterate it several times to create revisions.
  2. Open Visual History and enable Show changes.
  3. Inspect the paragraph HTML.

Use of AI Tools

  • Yes

@shail-mehta shail-mehta self-assigned this Jul 22, 2026
@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] History History, undo, redo, revisions, autosave. labels Jul 22, 2026
@github-actions github-actions Bot added the [Package] Editor /packages/editor label Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Size Change: +127 B (0%)

Total Size: 7.75 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 499 kB +127 B (+0.03%)

compressed-size-action

@shail-mehta
shail-mehta marked this pull request as ready for review July 22, 2026 16:37
@shail-mehta
shail-mehta marked this pull request as draft July 22, 2026 16:37
@github-actions

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shail-mehta <shailu25@git.wordpress.org>

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

@shail-mehta
shail-mehta marked this pull request as ready for review July 22, 2026 16:43
@shail-mehta
shail-mehta requested a review from joedolson July 22, 2026 16:43
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Flaky tests detected in 478e5ad.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30017608651
📝 Reported issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] History History, undo, redo, revisions, autosave. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant