Page MenuHomePhabricator

Standardise a control for switching diff types from side by side to inline/visual
Closed, ResolvedPublic

Description

User Story

  • As a visitor to the wikis, when I compare two versions of a page: I want to be able to switch between inline and two-column wikitext diff, so that I can understand what changed.
  • As a viewer of any Wikitext Diff diff on Desktop, I don't want to see diff-type switching if the engine doesn't support Inline Wikitext Diff

A new inline diff mode is available for diffs alongside the traditional side by side mode - this is the traditional mobile diff view. It should be made available on desktop.

URL: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Spain&type=revision&diff=400071&oldid=397846&diff-type=inline

Screen Shot 2019-12-12 at 12.07.56 PM.png (928×2 px, 197 KB)

A visualdiff mode/control is also provided by VisualEditor

I think this is the code:
https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor/+/1d3386b8ac703e27893821dc6dfc285b73cf0bb4/includes/VisualEditorHooks.php#147

Proposal: We move this control into core and allow extensions to extend it.
By default the control would contain inline and side-by-side

I didn't know about visual diff recently so I had proposed a simple drop down for the control at the bottom of the diff

Screen Shot 2019-12-12 at 12.14.52 PM.png (1×2 px, 131 KB)

Screen Shot 2019-12-12 at 12.14.39 PM.png (226×398 px, 13 KB)

Acceptance criteria

  • When inlinediff or visualdiff mode is not available the control should not show.

Open questions

  • Designers: Is the ButtonWidget appropriate here or should a dropdown be used (think of mobile screens)?
  • Designers: If we are using ButtonWidger what should the inline icon be?
  • Designers: Where to place the control on the diff?
  • Is diffmode the right parameter or should diff-type be used?
  • Designers if diffmode is not available and the user requests inline mode should there be some sort of feedback that it's not available?

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenFeatureNone
OpenBUG REPORTNone
OpenNone
StalledNone
OpenFeatureNone
DuplicateNone
ResolvedNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
ResolvedNone
ResolvedNone
OpenFeatureNone
OpenNone
ResolvedHalfak
OpenNone
OpenNone
OpenFeatureNone
StalledNone
OpenNone
OpenNone
OpenNone
ResolvedPetrb
OpenNone
OpenNone
Resolvedtstarling
OpenNone
DeclinedNone
ResolvedBUG REPORTJdlrobson
ResolvedNone
ResolvedJdlrobson

Event Timeline

Change 548936 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Allow end users to switch between available diffs

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

Designers: Is the ButtonWidget appropriate here

The current widget is a ButtonSelectWidget. Usually when we've had issues with these on mobile we've converted them to DropdownWidgets. If we do use a dropdown I don't think a submit button is necessary.

NB we also use this control in the save dialog

image.png (310×922 px, 45 KB)

Is there any reason not to fold the code in VisualEditor into core and hook into it from VisualEditor?

@Jdlrobson what was your intent in tagging TechCom on this? Was the tag just inherited?

Is there any reason not to fold the code in VisualEditor into core and hook into it from VisualEditor?

Presumably you could have diff modes even without VE installed.

Pchelolo subscribed.

It seems like there's anything to review by CPT yet. Untagging us, please tag back if code review is needed.

Change 548936 abandoned by Jdlrobson:
[mediawiki/core@master] Allow end users to switch between available diffs

Reason:
Not much bandwidth for this right now, but happy to provide code review for efforts pushing us in that direction.

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

Jdlrobson changed the task status from Open to Stalled.Sep 28 2023, 9:27 PM

We seem to have an inline diff control now:
https://en.wikipedia.org/w/index.php?title=NERVA&diff=1177674303&useskin=minerva

Will reach out to find which task I can merge this into.

Screenshot 2023-09-28 at 2.26.32 PM.png (66×116 px, 2 KB)

@TheresNoTime @MusikAnimal @HMonroy pinging you as I noticed you worked on this as part of the wishlist (T336716) ?

How difficult would it be to make https://en.wikipedia.org/w/index.php?title=NERVA&diff=1177674303&useskin=minerva default to inline diff and diffonly mode ?

e.g. on Minerva skin, the default would be the equivalent of this page:
https://en.wikipedia.org/w/index.php?title=NERVA&diff=1177674303&useskin=minerva&difftype=inline&diffonly=1

We seem to have an inline diff control now:

Yes, this was part of the Better-Diffs-2023 project that has more or less wrapped up (we've a few minor bugs still to fix). This task can probably be resolved, unless you want to add the toggle to mobile too? We went out of our way to avoid any changes to Special:MobileDiff, but did not give any special attention to the Minerva skin outside MobileFrontend.

How difficult would it be to make https://en.wikipedia.org/w/index.php?title=NERVA&diff=1177674303&useskin=minerva default to inline diff and diffonly mode ?

e.g. on Minerva skin, the default would be the equivalent of this page:
https://en.wikipedia.org/w/index.php?title=NERVA&diff=1177674303&useskin=minerva&diff-type=inline&diffonly=1

Totally doable and likely easy, but outside the scope of Better-Diffs-2023. Our team is happy to help with code review, though :)

Side note -- the URL query parameter is diff-type and not difftype (fixed in my quote of your comment). Yes, the dash is weird, but it existed long before the Better Diffs project.

Jdlrobson claimed this task.

This ticket looks done. I've setup some follow up tickets:
T347780, T117279, T347779