Page MenuHomePhabricator

When two references switch positions their numbering is shown incorrectly in the preview.
Closed, ResolvedPublic8 Estimated Story Points

Description

Copy/paste from https://www.mediawiki.org/w/index.php?title=Topic:Tnc1xizxa9e3tuow&action=history :

When two references switch positions their numbering is shown incorrectly in the preview.

Steps to reproduce:

Go to an article with an reference, e.g.Extension:Scribunto (1) and enter edit mode
Cut (e.g. copy) reference 1 from its location, and paste it on the location of reference 2
Cut (e.g. copy) reference 2 from its location, and paste it on the location of reference 1,
Follow the rest of the steps in the first post
Expected

The preview shows reference "[1]" for the first reference, and reference "[2]" for the second

Actual output

The preview shows reference "[2]" for the first reference, and reference "[1]" for the second

Notes:This is pretty confusing with two references, so imagine with 5 or more references being moved around. It might also be useful to add some sort of note in the sidebar and perhaps include a hover that displays the content of the references.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR6: Visual diffs on the VisualEditor board.

We will address this but:

The numbering of references diffs is always going to be confusing. To show moves clearly one can make the case for using the ref's position in the old doc, so [1][2][3] -> [3][2][1] is self-explanatory. But now what about new references? We have no choice but to use their position in the new doc, but if references have also been deleted you could end up with the new index looking out of place, e.g. <del>[1][2]</del> ............. [3][4][5] <ins>[4]</ins> [6]. Conversely if you use numbering from new doc position you can end up with changes to references the user didn't touch.

Deskana assigned this task to Tchanders.
Deskana changed the point value for this task from 1 to 8.
Deskana subscribed.

Closing per the above.