Page MenuHomePhabricator

Inline Diff: Insert/delete introduce line breaks
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

What is the problem?

In the inline diff view, inserts/deletes appear on separate lines (if they are more than a single word?).

This leads to output that can look different to the original article and might lead users to think extra newlines have been added.

Original articleInline diffTwo column diff
original_line_breaks.png (210ร—636 px, 45 KB)
inline_line_breaks.png (145ร—1 px, 46 KB)
two_column_line_breaks.png (354ร—1 px, 103 KB)

In the above example, https://en.wikipedia.org/w/index.php?title=Calais_Conference_%28December_1915%29&diff=prev&oldid=1118137858&diffmode=source&diff-type=inline shows Kitchener on a separate line in the inline diff. This is not the case in the article.

I note that if I remove display: inline-block; from the css it at least partially solves this issue (see below screenshot). It also partially solves the bug in T327642. I am not sure if this is a good solution, though.

css_change_line_breaks.png (140ร—1 px, 57 KB)

Steps to reproduce problem

Above examples come from https://en.wikipedia.org/w/index.php?title=Calais_Conference_%28December_1915%29&diff=prev&oldid=1118137858&diffmode=source&diff-type=inline.

Many inline diffs show a similar problem.

Environment

Browser: Firefox 91.
Wiki(s): https://en.wikipedia.org MediaWiki 1.40.0-wmf.19 (3ee932e) 02:18, 17 January 2023. (I don't know which version of wikidiff2 is being used.)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJan 23 2023, 11:01 AM
HMonroy renamed this task from Insert/delete introduce line breaks in inline diff to Inline Diff: Insert/delete introduce line breaks.Feb 15 2023, 7:08 PM
dmaza set the point value for this task to 3.Jun 15 2023, 5:46 PM

Change 937990 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] diff: make ins and del elements inline instead of inline-block

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

MusikAnimal subscribed.

note that if I remove display: inline-block; from the css it at least partially solves this issue

Seems like a fine solution. I'm not sure why this was ever made to be inline-block. After removing that and adding white-space: break-spaces (for T327642), things look good to me.

Change 937990 merged by jenkins-bot:

[mediawiki/core@master] diff: make ins and del elements inline instead of inline-block

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

@MusikAnimal In the inline diff view, inserts/deletes now do not appear on a separate line as seen in the screenshot. The ticket will be moved to Done, thanks for your work!

Skins: Vector, 2022, 2010, Minerva, Monobook, Timeless
Local: http://localhost:8080/w/index.php?title=Calais_Conference_%28December_1915%29&diff=588&oldid=587&diffmode=source&diff-type=inline
MediaWiki- 1.41.0-alphaย (6853d8b) 14:45, 17 July 2023
wikidiff2- 1.14.1

Inline

T327645_BetterDiffs_InlineInsert_LineBreaksInline.png (1ร—3 px, 627 KB)

2 Column Diff

T327645_BetterDiffs_InlineInsert_LineBreaksDiff.png (1ร—3 px, 583 KB)

Change 940995 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] diff: add padding to ins and del to avoid whitespace between lines

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

Change 940995 merged by jenkins-bot:

[mediawiki/core@master] diff: add padding to ins and del to avoid whitespace between lines

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

@HMonroy No issues with the padding and whitespace between lines after the latest patch. The ticket will be moved back to Done again, thanks for your work!

OS: macOS 13.4, Windows 11
Browsers: Safari 16.4, Chrome 115, Firefox 115, Edge 114
Skins: Vector, 2022, 2010, Minerva, Monobook, Timeless

Test Links:
2 Column Diff: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Calais_Conference_%28December_1915%29&diff=595738&oldid=595737
Desktop: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Calais_Conference_%28December_1915%29&diff=595738&oldid=595737&diffmode=source&diff-type=inline
Mobile: https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:MobileDiff/595738&diff-type=inline&diffmode=source

2 Column DiffDesktop: InlineMobile: Inline
T327645_BetterDiffs_Inline_2Column.png (1ร—2 px, 496 KB)
T327645_BetterDiffs_Inline_Desktop.png (1ร—2 px, 509 KB)
T327645_BetterDiffs_Inline_Mobile.png (1ร—2 px, 357 KB)