Page MenuHomePhabricator

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

Description

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 project: VisualEditor. · View Herald TranscriptApr 24 2017, 6:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF triaged this task as Medium priority.Apr 25 2017, 7:08 PM
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:

Scroll down and back up:

Scroll down and back up again:

Scroll down and back up a third time:

(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.)

Mooeypoo added a comment.EditedMay 10 2017, 3:43 AM

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: https://gerrit.wikimedia.org/r/#/c/346645/

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....

Yeah that's the culprit

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

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

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

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

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptMay 19 2017, 5:56 PM