Visual diff (on history page) shows changes to reference numbers caused by inserting more references
Open, NormalPublic1 Story Points

Description

See https://de.wikipedia.org/w/index.php?title=Herstellerpr%C3%A4fix&diff=159494033&oldid=158095292&visualdiff=1 (also a nice testcase for changes inside moved blocks, by the way). This change introduced 2 new references. The diff shows changes to all following references, which should be ignored.

Schnark created this task.Jul 11 2017, 7:32 AM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJul 11 2017, 7:32 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Deskana added a subscriber: Deskana.

I don't know whether this correct or not, honestly.

On the one hand, the changes you made to the wikitext did change those reference numbers, and the visual diff is showing you that. On the other hand, you didn't actually touch those references in the wikitext, so it's somewhat confusing for it to point out those changes to you.

Does anyone have any thoughts?

Well, imagine a long article with many references, and you add or remove a reference near the top. Do you really want to see more or less the whole article in the diff, because everywhere the numbers changed? I doubt it. You'd have to scroll through the whole diff to see whether there are other, real changes and thus would reduce usability.

Well, imagine a long article with many references, and you add or remove a reference near the top. Do you really want to see more or less the whole article in the diff, because everywhere the numbers changed? I doubt it. You'd have to scroll through the whole diff to see whether there are other, real changes and thus would reduce usability.

True. However, if I were trying to move a reference, I would likely expect this kind of output. There are arguments for and against.

I wonder if @Prtksxna or @Pginer-WMF have thoughts on this?

Note: this bug is limited to the visual diff provided from the history page, and are not reproducible with the visual diffs shown in VisualEditor.

Deskana renamed this task from Visual diff shows changes to reference numbers caused by inserting more references to Visual diff (on history page) shows changes to reference numbers caused by inserting more references.Jul 17 2017, 12:20 PM

I wonder if @Prtksxna or @Pginer-WMF have thoughts on this?

In this case I think it makes sense to consider as the relevant change those references directly affected by the user contribution (i.e., the ones added or removed) and not the side-effects on the display that those may cause in other elements.

In general is not always easy to identify which is the meaningful change for the user, but I think it helps to ask ourselves how would we describe the change to another human. In this case, I won't mention that after adding a reference other references got their number updated. Similarly, in a numbered list of 100 items where you remove the first item, I'd expect the highlight to focus on the deleted item and not all items in the list.

In a certain way that is what is done when a word is removed in a paragraph, where only the affected word is highlighted as a change despite the rest changing their position inside the paragraph.

Maybe showing this only if the paragraph is touched in another way could work, but then [1][2] -> [1][2] null diffs when your only edit is to re-order references would be invisible. Eh.

Esanders added a comment.EditedJul 18 2017, 4:41 PM

Just to be clear, this behaviour should not be happening and should go away once T170269 is fixed. I think if we are to discuss changes to the reference diff display it should be starting from the feature which is currently correctly working in VE, otherwise things are going to get very confusing :)

Just to be clear, this behaviour should not be happening and should go away once T170269 is fixed.

Again, just to be clear:

This is correct?This is incorrect?
VisualEditorHistory

True. However, if I were trying to move a reference, I would likely expect this kind of output. There are arguments for and against.

I agree with @Pginer-WMF about not showing the side-effects changes caused by adding or removing referenced. I do however feel that moving references, like moving paragraphs (T169325) might need some special treatment.

There are three types of reference moving that I can come up with.

NameDescriptionWikitextVisual
Only moving, no reordingMoving the position of the reference in the text in a way that does not cause any reordering
Only reordering, no movingWell this is a bit of a lie, you cant reorder without moving. But its minimum moving.
Moving and reorderingMoving the reference across paragraphs and also causing reordering.

Before we think of improvements, @Esanders could you confirm that this is the correct output for all three, and that there are no known bugs here?

Thanks for the examples. The reference list itself does not currently detect moves which is the issue in all three of your examples (but no the bug as reported, so we should file that separately). The ref numbering in the document looks correct...

The reference list itself does not currently detect moves which is the issue in all three of your examples

There should be no change in the References list in the first example anyway?

(but no the bug as reported, so we should file that separately). The ref numbering in the document looks correct...

So, the issue to be filed is that when Moving and reordering the References list isn't being updated?

Example 1 is what I would expect.
In Example 2, two things could be changed (though I'm not sure that they actually should be changed):

  • Additionally, the text with the reference numbers could be shown, with the reference numbers highlighted and annotated as "changed". Currently you can see that references 1 and 2 have been changed, but it's missing the context. In this example where both references belong to the same sentence this doesn't matter, but if they belonged to different sentences it would be nice to see them in the diff, too.
  • Instead of showing that the two references were both completely changed, the diff could show that they were just exchanged. But given that this isn't done for normal ordered lists either (to test, exchange # Point and # Cube on your example page), I don't think this should have high priority.

In Example 3 it's debatable whether the list of references should be shown with a change, as it doesn't look the same before and after the edit, but in this case I think it makes things clearer by leaving it out. This might change when there are more changes to references, though.

So, the issue to be filed is that when Moving and reordering the References list isn't being updated?

Yeah, pinging @Tchanders

So, the issue to be filed is that when Moving and reordering the References list isn't being updated?

Yeah, pinging @Tchanders

T171587: When moving and reordering references the "References" list isn't being updated

Just to be clear, this behaviour should not be happening and should go away once T170269 is fixed.

Unfortunately this didn't happen... It would take a bit of work to stop showing these changes.

Change 371588 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/Cite@master] VisualDiff: Show less information about ref nodes

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

Deskana set the point value for this task to 1.Aug 23 2017, 3:45 PM
Deskana triaged this task as Normal priority.
Prtksxna added a comment.EditedSep 4 2017, 5:41 AM

Similar to the comment I left for T169325, instead of the red/green markers for showing moves, we could show blue markers that highlight/scroll the new position when clicked on.

Change 371588 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] VisualDiff: Show less information about ref nodes

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