Page MenuHomePhabricator

Add formatted page/file size
Closed, ResolvedPublic


The designs for the Page & Categories and Other tabs require page and file size, respectively, for results. We have access to those sizes in bytes but the methods for formatting these results and adding language-specific units currently exist on the backend (see the Language::formatSize). We either need to reimplement this functionality on the client side so we can process what we're getting back from the API, or we need to preprocess results to include the human-readable size string.

Pages & Categories tab:

image.png (703×1 px, 255 KB)

Other tab:

image.png (835×1 px, 427 KB)

Event Timeline

IIRC, this was blocked on not having the word count and page size available from the search response, i.e. the blocked is T270381

Change 659098 had a related patch set uploaded (by Anne Tomasevich; owner: Anne Tomasevich):
[mediawiki/extensions/WikibaseMediaInfo@master] Add formatted sizes and wordcount to results, and format lots of numbers

Change 659098 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Add formatted sizes and wordcount to results, and format lots of numbers

Etonkovidova subscribed.

Checked on commons wmf.30 - the word count/page size information is displayed.
Note: The "Members" word in the label text is not capitalized.

Screen Shot 2021-02-11 at 2.58.05 PM.png (641×835 px, 64 KB)

The UI with the info looks much less jarring, compare:

Screen Shot 2021-01-25 at 4.08.30 PM.png (582×1 px, 77 KB)
Screen Shot 2021-02-11 at 3.24.36 PM.png (556×932 px, 68 KB)

I filed two follow up tasks