Page MenuHomePhabricator

[API] New Vector search should not load wastefully large thumbnails
Closed, ResolvedPublic

Description

  1. Go to https://en.wikipedia.org/wiki/?useskin=vector-2022
  2. Emulate a slow connection in your browser (e.g. in Chrome, open the inspector, go to the Network tab, and change the "No throttling" dropdown to "Slow 3G")
  3. Type text into the search bar
  4. Watch thumbnail images load very slowly

Most of the reason that the images load slowly is that the connection is slow, but I think we could do (slightly) better here by loading smaller images.

Right now, the thumbnails are 200px in the longest dimension, and they're displayed as 36x36 squares with background-size: cover;, which causes the short side to be scaled down to 36px (and non-square images to be cropped). It would be better if we could ask for thumbnails at the size we intend to use (36px in the shortest dimension). It looks like the MediaWiki-REST-API may not currently support that, though.

Event Timeline

Jdlrobson subscribed.

Vector blindly prints whatever images the API returns.

Jdlrobson renamed this task from New Vector search should not load wastefully large thumbnails to [API] New Vector search should not load wastefully large thumbnails.Jun 8 2022, 3:57 PM

See also: T322621: Use standard thumbsizes in modern vector search and T211661#8377883. Beside avoiding large thumbnails, it needs to load standard sizes to avoid cache fragmentation. Unfortunately I don't think we have a "really small" thumb size standard. People have converged on 40px in lots of places though. MediaWiki's small thumb sizes are 120px and 220px. This maybe a good time to decide on one and apply it everywhere (see T211661#8377883 for some examples of discrepancies in thumbsizes). And again, this is not related to design, you can load it with some size and show it differently.

I suggest going with 60px (and then 120px for 2x), that's what I'm going for portals search.

Change 857013 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] search: Use 60px for search thumbnails

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

Change 857013 merged by jenkins-bot:

[mediawiki/core@master] search: Use 60px for search thumbnails

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

TheDJ assigned this task to Ladsgroup.
TheDJ subscribed.

I think this can be closed ? Please reopen if not

FYI, there is a list of all the various image widths used by tools at: https://www.mediawiki.org/wiki/Common_thumbnail_sizes#Applications

And yes, it is quite the mess.