Page MenuHomePhabricator

Visual diff inside 2017WTE section edit doesn't match visual diff from the history page (for changed reference)
Closed, ResolvedPublic

Description

Steps to understand:

  1. Edit an existing article, and change the contents of a <ref>.
  2. Before saving, check the visual diff. See:
    1. The ref number (the little blue clicky number) is highlighted.
    2. The new text displayed.
    3. The old text has vanished without a trace.
  3. Save/Publish your change.
  4. After saving, go to the history page and check the visual diff. See:
    1. The old text is displayed in red strikethrough.
    2. The new text is displayed in green (i.e., for insertion).

Expected:
It's the same edit. These diffs should match.

Reported by @AxelBoldt at https://www.mediawiki.org/wiki/Topic:Vpu1ggxm9pfkwbrj

Test instructions:

  1. Enable "New wikitext mode" beta feature
  2. Click on https://en.wikipedia.org/w/index.php?title=Alice_Dreger&veaction=editsource&section=2
  3. Open this revision of article using NWE.
  4. In the second paragraph, you'll see a <ref name="MSU"> containing a cite-web template. Change the template's title parameter from "Teacher-Scholar" to "TeacherXXXScholar".
  5. Now click on "Publish changes", then "Review your changes".
  6. Go to the Visual Diff section.

Observed Result:

It looks like this:

image.png (2×3 px, 1 MB)
image (1).png (2×3 px, 991 KB)

  • Unchanged references are marked as modified
  • The text of the changed reference is not marked
  • Something is wrong with the styles (the line breaks after each "↑" are unexpected)

Expected Result:

It should look like this:

image (2).png (2×3 px, 812 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Can you give a specific example?

Click on

https://en.wikipedia.org/w/index.php?title=Alice_Dreger&oldid=971360142&veaction=editsource&section=2

In the second paragraph, you'll see a <ref name="MSU"> containing a cite-web template. Change the template's title parameter from "Teacher-Scholar" to "TeacherXXXScholar". Now click on "Publish changes", then "Review your changes".

The displayed visual diff is completely wrong.

Do NOT publish your changes.

matmarex added a subscriber: matmarex.

Importantly, this occurs only for the visual diff in the new wikitext editor (not in visual editor). I can reproduce it there.

This is the edit I tried to make (wikitext diff):
image.png (2×3 px, 917 KB)

And the visual diff is indeed a mess:

  • Unchanged references are marked as modified
  • The text of the changed reference is not marked
  • Something is wrong with the styles (the line breaks after each "↑" are unexpected)

image.png (2×3 px, 1 MB) image.png (2×3 px, 991 KB)

Also, the issue only occurs when editing a section, not when editing the entire article – this diff looks right:

image.png (2×3 px, 812 KB)

This is likely caused by different restbase IDs between stored revisions, which is sort-of-know issue with the historical visual diff (and source mode visual diff, which uses the same approach).

@matmarex: This is how it looks right now.

Screen Shot 2021-02-16 at 7.20.50 PM.png (1×1 px, 333 KB)

It seems the following issues still exist:

  1. It seems that an unchanged reference is still marked as modified.
  2. The text of the changed reference is still not marked.
  3. The style of the references list still seems wrong, there are still the line breaks after each "↑" (Well, there are multiple references list, so for the first one it seems wrongly styled).
Esanders renamed this task from Visual diff inside the editor doesn't match visual diff from the history page (for changed reference) to Visual diff inside 2017WTE doesn't match visual diff from the history page (for changed reference).Feb 20 2021, 1:06 PM
Esanders renamed this task from Visual diff inside 2017WTE doesn't match visual diff from the history page (for changed reference) to Visual diff inside 2017WTE section edit doesn't match visual diff from the history page (for changed reference).Feb 20 2021, 1:09 PM

NB this only happens in 2017WTE section edit mode. Diff is fine in all other modes (2017WTE full page, historical diff, visual mode)

This comment was removed by Esanders.

Change 666118 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Fetch full document when diffing wikitext sections

https://gerrit.wikimedia.org/r/666118

Change 666118 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Fetch full document when diffing wikitext sections

https://gerrit.wikimedia.org/r/666118

ppelberg claimed this task.