Page MenuHomePhabricator

[Spike] Image Browsing: Determine carousel architecture
Closed, ResolvedPublic5 Estimated Story PointsSpike

Description

Evaluate where the carousel code should live and how data flows between components. Produce a recommendation that the team can act on for the carousel port task.

This task should be completed before other carousel subtasks are picked up.

Questions to answer

Where should the code live?

  • MinervaNeue is the leading candidate (skin-level presentation, mobile-only). Could it alternatively live as its own module in MMV? What are the tradeoffs?
  • What code from the prototype needs to be ported? (thumbExtractor.js, excludedImageSelectors.js, carousel UI component, etc.)
  • We don't want this in MobileFrontend

How do thumbnails get from MMV to the carousel?

  • Should MMV's bootstrap fire a client-side hook with discovered, non-excluded thumbnails that Minerva consumes?
  • What should the shape of that hook be? (image URLs, file titles, alt text, dimensions?)
  • Can we guarantee MMV's discovery runs before Minerva needs the data?

Server-side container injection

  • What server-side check is sufficient for Minerva to confidently inject a placeholder? (e.g. raw image count in page HTML, basic noviewer filtering, or something simpler?)
  • How do we handle the edge case where the server reserves space but client-side filtering discovers fewer than 3 qualifying images?
  • Is there a risk of the empty placeholder being visible for too long on slow connections? If so, how do we mitigate (skeleton UI, animation, graceful collapse)?

Feature gating

  • What feature flag mechanism should we use for incremental rollout? URL parameter, MediaWiki config variable, or both?
  • Should this be the same flag as the beta viewer (T417675), or independent?

Display rules

  • Only articles with 3+ qualifying images. Does the server-side check or the client-side logic enforce this threshold?
  • How should the carousel connect to the beta viewer? Confirm that navigating to #/media/File:... on tap is the right approach.

Deliverable

A brief written recommendation (can be a comment on this task or a short document) covering the above questions, with enough detail for the port task to proceed.

Event Timeline

egardner renamed this task from Image Browsing: Determine carousel architecture to [Spike] Image Browsing: Determine carousel architecture.
egardner triaged this task as High priority.
egardner changed the subtype of this task from "Task" to "Spike".
egardner moved this task from Incoming/Inbox to Needs Refinement on the Reader Growth Team board.
egardner set the point value for this task to 5.Feb 25 2026, 5:39 PM
egardner moved this task from Needs Refinement to Ready on the Reader Growth Team board.
lwatson changed the task status from Open to In Progress.Mar 9 2026, 3:14 PM
lwatson added a project: Spike.
lwatson updated the task description. (Show Details)

Recommendation

Port the carousel code to Minerva using a hook-based approach.

  • Cleaner separation of concerns: MultimediaViewer (MMV) handles thumbnail discovery, exclusion logic, and detail view, while the skin maintains control over the presentation. Narrowing the scope to Minerva skin ensures the carousel only loads when Minerva loads. This reduces the risks of regressions and bugs in other skins and for desktop users.
  • Hook-based approach: MMV fires mmv.thumbnail.discovered hook and then the skin listens for it. The carousel appears once the skin receives the discovered thumbnails. This provides the flexibility to add a carousel to Minerva and Vector, and allows skins to manage their own presentation.

Summary

Thumbnails flow from MMV bootstrap via a new mmv.thumbnail.discovered hook. The server injects a placeholder unconditionally for Main namespace (NS_MAIN), Minerva, and the feature flag, with graceful client-side collapse. Feature gating uses a single $wgMinervaCarousel config variable. Carousel taps navigate to MMV's existing #/media/File:Filename hash route.

Technical implementation

  • In Minerva skin:
    • Add a new carousel module called skins.minerva.imageCarousel
    • Register the new carousel module and config variable ($wgMinervaCarousel) in skin.json
    • Inject placeholder/skeleton UI in SkinMinerva.php
    • Add carousel container in skin.mustache.
  • Port Carousel.vue and CarouselItem.vue from ReaderExperiments to Minerva.
  • Add and document the new mmv.thumbnail.discovered hook in MMV (patch)
  • Port excludedImageSelectors.js (additional exclusions beyond isAllowedThumb()) from ReaderExperiments to MMV. This extends MMV's exclusion logic.
  • Set up Vue 3 dependency in Minerva.

Delivery estimation

  • 2 sprints for code review, design review, accessibility audit, and QA

Other

Next steps

  • Coordinate with Reader Experience Team
  • Record final decision

Revised Recommendation

Port the carousel code to MultimediaViewer, considering that we are blocked on other potential options.

Other options:

  • Reader Experience addressed concerns about this feature in Minerva, including: maintenance concerns; risk of impacting other wiki projects like WikiVoyage that deploy Minerva.
  • Reader Growth does not want this feature in MobileFrontend, and is planning to retire the mobile media viewer in MobileFrontend.
  • Setting up a new repository is a lengthy process.

Implementation

With the beta viewer (T417675) establishing mobile-only patterns in MMV, the carousel fits naturally as a second mobile module alongside mmv.ui.beta. All image-related code lives in one extension: discovery (mmv.bootstrap), carousel (new mmv.carousel), and detail view (mmv.ui.beta).

Server-side rendered: PHP renders the carousel in HTML (markup generated by PHP or mustache template). This way we minimize layout shifts and improve user experience, especially on slow connections. Note: Client side (mmv.bootstrap) serves the thumbnails, but we need them sooner (before JavaScript runs).

Extend the beta viewer pattern to load the bootstrap on mobile when the beta viewer or carousel is enabled.

A JavaScript click interceptor handles clicks on carousel images and navigates them to the MMV hash route.

Delivery estimation

2 sprints for code review, design review, accessibility audit, and QA

Other

Next steps