Page MenuHomePhabricator

Image Browsing carousel loading state / FOUC avoidance
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
bvibber
Sep 23 2025, 4:39 PM
Referenced Files
Restricted File
Fri, Oct 24, 12:04 PM
F66796374: Carousel_loading_Safari_iOS_16.png
Thu, Oct 23, 7:42 PM
F66775192: boiling-small.mp4
Tue, Oct 21, 6:44 PM
F66775187: boiling-before-small.mp4
Tue, Oct 21, 6:44 PM
F66775185: nyc-small.mp4
Tue, Oct 21, 6:44 PM
F66775183: nyc-before-small.mp4
Tue, Oct 21, 6:44 PM
F65955742: Screenshot 2025-09-03 at 4.01.14 PM.png
Sep 23 2025, 4:39 PM
File Not Attached

Description

Broken out from T402973:

Background

We want to introduce loading indicator/placeholder UI to the carousel state when it's shown

User story

As a user with a slow connection, I want to know when the feature is loading without the page shifting around

Requirements

Introduce loading indicator UI:

  • Carousel entry point (ideally we also do this in a way that the content doesn't "jump" after the carousel appears – may need a small amount of server-side CSS to achieve this in a seamless way)

Design

  • Carousel entry point

Screenshot 2025-09-03 at 4.01.14 PM.png (1×1 px, 156 KB)

Acceptance criteria

  • Build out loading indicators according to the designs above
    • test on the merged patch:
      • confirm that space is reserved and fills in nicely on pages with enough images
      • confirm that space is reserved, then the rectangle "rolls up" out of the way quickly on pages without enough images
      • in browser with JavaScript disabled, confirm that the space is initially collapsed and stays that way

Notes

Patch should appear in 1.45.0-wmf.25 next week; if we need it in a hurry we may need to do backports.

For the Carousel loading state, we might need something that is CSS-only, since this deals with part of the page that is immediately visible to the user even before JS initializes.

Because we need to know whether the 3-image minimum will be reached to create a placeholder, we may need to calculate this on the PHP side as well. (This stretch goal was not implemented, we create the placeholder unconditionally and have it 'retract' as soon as it's able to calculate that there aren't enough images. This was considered less disruptive than having the content shift down due to a surprise opening, and didn't require reimplementing the exclusion checks in PHP.)

Event Timeline

Change #1190331 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/ReaderExperiments@master] WIP loading state for carousel placeholder

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

ovasileva moved this task from Incoming/Inbox to Needs Refinement on the Reader Growth Team board.
HSwan-WMF set the point value for this task to 3.Sep 24 2025, 4:37 PM

Change #1196968 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ReaderExperiments@master] Cleaner load experience

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

Change #1196969 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ReaderExperiments@master] Further optimize thumbnail requests

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

Test wiki created on Patch demo by Mmullie (WMF) using patch(es) linked to this task:
https://14b24a64a7.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by Mmullie (WMF) using patch(es) linked to this task:
https://4b51da7a04.catalyst.wmcloud.org/w/

Change #1190331 abandoned by Bvibber:

[mediawiki/extensions/ReaderExperiments@master] WIP loading state for carousel placeholder

Reason:

abandoning old proof of concept in favor of current work in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ReaderExperiments/+/1196968

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

some quick tests in Chrome with mobile view, with caching disabled and network throttled to "slow 4G":

"New York City" (with carousel) before change:

"New York City" (with carousel) after change:

"Boiling" (no carousel) before change:

"Boiling" (no carousel) after change:

Change #1196968 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Cleaner load experience

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

Change #1196969 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Further optimize thumbnail requests

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

Change #1198024 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ReaderExperiments@master] Only reserve carousel height for JS users

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

Change #1198024 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Only reserve carousel height for JS users

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

Change #1198388 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: override UA button styles for consistency

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

Minor fix to make the loading icon color consistent across browsers.

Safari iOS 16:

Carousel_loading_Safari_iOS_16.png (520×726 px, 20 KB)

{F66926183}

QA update: I tested this locally and on beta, and can verify the behavior described in the code review findings https://phabricator.wikimedia.org/T405382#11295530

  • Confirm smooth transition between loading state and actual carousel (no flash or awkward jump)
  • Test on throttled network speeds (slow 3G, fast 3G, slow 4G) to ensure the loading state appears long enough to be visible
  • Test with caching disabled versus enabled to catch first visit versus return visit behavior
  • Test on mobile devices where FOUC is often more noticeable

Minor fix to make the loading icon color consistent across browsers.

Safari iOS 16:

Carousel_loading_Safari_iOS_16.png (520×726 px, 20 KB)

Confirmed patch resolves issue on iOS 16 Simulator, and that the same CSS tweak fixes the VTOC and other-wikis image loaders when they don't have a background/contrasting color available to use. Went ahead and amended the patch to fix all three wrapper style variants.

Change #1198388 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: override UA button styles for consistency

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