Page MenuHomePhabricator

Show number of changed chars in the diff view
Open, MediumPublic

Description

Problem: The version history displays the number of changed characters for each change (more characters in green, less in red). When comparing two versions in the diff view, however, this number is not displayed. As an editor, I would find this number particularly useful in cases where only paragraph marks (and the like) were added, which are actually only a few characters, but make the change look much bigger.

Survey: 2017

Original wish (German): https://de.wikipedia.org/wiki/Wikipedia:Umfragen/Technische_Wünsche_2017/Wartung#Anzahl_geänderter_Zeichen_auch_im_Versionsdirektvergleich_.28.22Versionsunterschied.22.29_angeben

This ticket is tagged as Need-volunteer to be tackled during the Wikimania Hackathon 2017.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Question: The diff view from history is a different use case to the diff view for "show changes". It is also different from a diff generated from two page version numbers which are not necessarily of the same page. Will this patch need to distinguish these cases? If the numerical value is stored in the database, then the history version may be simple, for adjacent versions. For non-adjacent versions it will still need calculating.

To be consistent with the history view, the number should be displayed before the edit summary of the right hand edit. This may be misleading in that it appears to assign the change to the last edit.

The description of the bug is wrong. The number is the change in the number of characters, not the number of characters that have changed, fortunately this is a much simpler metric to calculate!

thiemowmde triaged this task as Medium priority.Aug 9 2017, 4:24 PM
thiemowmde subscribed.

For consistency I would always show this number. This is my personal opinion.

You are right that there is a precalculated number in the database. But I think this should not be used. I suggest to look for the total size of both revisions, and do the calculation in your code.

We will be wanting to insert something like

<span dir="ltr" class="mw-plusminus-pos" title="foo bytes after change of this size">(delta)</span>

Where foo is the number of bytes and delta is the signed change.

And add total page size, not just the change in size. I've long found it frustrating that this information is visible in the history list but not in the diffs; many of us page through diffs rather than scrolling up and down in the history list (or after doing so, rather).