Page MenuHomePhabricator

Scrolling in the gallery search box causes image thumbnails to change size
Closed, ResolvedPublic1 Estimated Story Points


Steps to reproduce:

  1. Insert > Gallery
  2. Search for something that will produce more than a screenful of results (e.g., "Sandbox")
  3. Count the number of thumbnails showing.
  4. Scroll down at least one full screen.
  5. Scroll all the way back to the top.
  6. Count the number of thumbnails showing now.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to Blocked on the VisualEditor board.

I'm having trouble replicating this, even when I search for "Sandbox". It could be that it's an odd case and the results have changed since... Is it still happening?

Starting point:

Screen Shot 2017-04-24 at 11.29.13 AM.png (745×1 px, 925 KB)

Scroll down and back up:

Screen Shot 2017-04-24 at 11.29.19 AM.png (744×1 px, 759 KB)

Scroll down and back up again:

Screen Shot 2017-04-24 at 11.29.34 AM.png (745×1 px, 730 KB)

Scroll down and back up a third time:

Screen Shot 2017-04-24 at 11.29.38 AM.png (745×1 px, 369 KB)

(Note that the images shown in the gallery tool's search box are not necessarily CC-BY-SA, which is the Phabricator license. They should all be from Commons and available under a similarly free [or more free] license.)

Oy, it looks like the row-height calculation repeats itself unnecessarily on rows that are already built, and then "adjusts" the size unnecessarily - which makes the images bigger, and requires (ironically) more adjustment to fill in the row.

It might be that we call the rebuilding rows too much. I'll try to take a look, but if anyone wants to take this on, please do - I am a bit swamped with RCFilters at the moment.

@Mooeypoo No worries, I'll look into it - thanks for the pointers.

I have a sneaking suspicion that it has to do with this:

I think I removed a skip condition from line 363 that causes this. I'm not near a computer, but I'm hoping that helps. I think that condition should probably come back....

Change 354129 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] MediaSearchWidget: Only resize new results

Change 354129 merged by jenkins-bot:
[mediawiki/core@master] MediaSearchWidget: Only resize new results