Page MenuHomePhabricator

Standardise a control for switching diff types from side by side to inline/visual
Open, LowPublic

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
OpenNone
ResolvedPetrb
OpenNone
OpenNone
DeclinedNone
OpenBUG REPORTNone
OpenNone
OpenNone

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 added a subscriber: Pchelolo.

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