Page MenuHomePhabricator

History action should use Language::formatSize to display page size instead of long raw byte count
Open, LowPublicFeature

Description

I see the text of this user interface is simply "(bytes)".. It seems to have no parameter for those that do not want that display. Will the wiki-core automatically adjust if I change this to say "(kilobytes)"? Otherwise, it would be nice if I could change it to this (Assuming $1 is the non-raw number of bytes): ({{#ifexpr:{{format:$1|R}}/1024^2<1|{{#ifexpr:{{format:$1|R}}/1024<1|$1 bytes|{{#expr:{{format:$1|R}}/1024round1}} kB}}|{{#expr:{{format:$1|R}}/1024^2round2}} MB}}).


Version: 1.19.3
Severity: enhancement

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:14 AM
bzimport set Reference to bz35907.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been confirmed by popular vote. ***

MediaWiki has the functionality to format computing sizes upto and including yottabytes, though I've got a feeling that you won't be having pages that size for a while ;)

There is reasons to have bytes (rather than a rounded number which can allow for large changes of number of bytes, but not show anything as it's less than 1 kilobyte etc.

No, changing the message will just make the output lie

It could be done internally much nicer than trying to use parser functions to do it

That doesn't make sense to me. Looking through the history of a page, it would make more sense to me to see (1.21GB) than (1,293,745,247 bytes). Outputs have always rounded, that is not a lie. You say there are "reasons to have bytes (rather than a rounded number which can allow for large changes of number of bytes, but not show anything as it's less than 1 kilobyte etc." As far as I know, MediaWiki:Pagesize is simply an output the end-user sees, and it isn't used for any computational purposes.

In other words, it would probably be possible to change the format of revision size without changing the format of the diff size.
However, there would still be a (little?) loss of information in that the user would have to make additions to compare the size of non-adjacent revisions to know if they have exactly the same size.
The "1,293,745,247 bytes" example is a bit far-fetched.

I agree, it may not be intended as a feature but I find it quite useful from time to time to make a reasonable assumption based on the byte size.

When there is a chaos in the history (vandalism mixed, reverts, vandalism, reverts etc.), the full byte count is pretty reliable to quickly verify that the last revert's content do in fact equal the last "stable" version (as opposed to the last revert only undoing the last edit, which, if it happens often enough, can be fooled if little bits are forgotten about).

Having said that, one can just as easily select the two revs and generate a difference-view. That's more accurate anyway. So I wouldn't mind loosing this "feature", in return for shorter and more readable size measures on the history page.

I'd much rather see a history like:

  • 10 B
  • 34.5 KB
  • 1.5 MB

than:

  • 10 B
  • 35,328 B
  • 1,573,000 B

(remember, 1 KB === 1024 B)

Change 192854 had a related patch set uploaded (by AYUSH GARG):
HistoryAction: to display formatted page size rather raw byte count

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

Change 192854 abandoned by Thiemo Kreuz (WMDE):
[mediawiki/core@master] HistoryAction: to display formatted page size rather raw byte count

Reason:
The patch is 6 years old and obviously unfinished. It can't be applied as it is. I suggest to start with a new patch.

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

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM
Aklapper removed a subscriber: wikibugs-l-list.