Page MenuHomePhabricator

Image Browsing: Create the UI for "images from other wikis"
Closed, ResolvedPublic5 Estimated Story Points

Assigned To
Authored By
egardner
Aug 26 2025, 7:23 PM
Referenced Files
F66716455: Screenshot 2025-10-01 at 11.40.28.png
Oct 1 2025, 9:42 AM
F66715346: screenshot 101.mov.gif
Oct 1 2025, 2:03 AM
Restricted File
Oct 1 2025, 12:50 AM
Restricted File
Oct 1 2025, 12:50 AM
F66714661: screenshot 72.mov.gif
Sep 30 2025, 9:55 PM
F66714659: screenshot 71.mov.gif
Sep 30 2025, 9:55 PM
F66714651: screenshot 217.png
Sep 30 2025, 9:55 PM
F66711661: screenshot 69.mov.gif
Sep 30 2025, 9:55 PM

Description

Background

User story

  • As a visual learner, I want to be able to view images relevant to the topic I'm reading about, regardless of which wiki I'm on

Requirements

  • Images must appear only from the article on other Wikipedias or from the wikidata item corresponding to the article
  • Images from other Wikipedias will be shown before images from Wikidata
  • Content should only appear in the user's language
  • Images will be lazy loaded when the user scrolls to the bottom of the page
  • Content like this must be clearly marked as coming from outside the current wiki:
    • If image is used in one place: From xyz.wikipedia.org
    • If image is used in multiple wikis: From xyz.wikipedia.org and XX other language editions of Wikipedia
    • If image is from Wikidata or one non-wikipedia source: From Wikidata
  • Loading state for the other wikis feature

Design

Acceptance criteria

  • Complete all requirements above with the design provided
  • Provide a way to test this for design & product review

Communication criteria - does this need an announcement or discussion?

  • The treatment here will be discussed in first on-wiki community conversations

BDD

Feature: Media from other projects in Image Browsing

  Scenario: Loading images from other wikis
    Given the “Media from other projects” header is visible and at least 50% in view
    When the MediaSearch API request is pending
    Then a loading indicator is displayed
    And the indicator disappears once the results return

  Scenario: Empty state
    Given the article has no images from other wikis
    When the overlay is opened
    Then the “Media from other projects” section is not displayed

  Scenario: Image captions
    Given an image from another wiki has a caption
    When it is displayed
    Then the caption is shown in plain text
    And if no caption exists, nothing is displayed

  Scenario: Wiki project labels
    Given an image comes from another project
    When it is displayed
    Then the project label is shown using the rules for Wikipedia and Wikidata

  Scenario: Interaction
    Given I click an image from another wiki
    When it opens in DetailView
    Then the DetailView auto-scrolls into view
    And I can navigate through these images with URL routing
    And clicking the “Back to article” button returns me to the article page

Test Steps

Test Case 1: Loading state

  1. Open the image overlay for any article.
  2. Scroll until the “Media from other projects” header is 50% in view.
  3. Throttle network in DevTools to slow down API.
  4. AC1: A loading indicator appears while the API request is in progress.
  5. AC2: The loading indicator disappears once images render.

Test Case 2: Empty state

  1. Open the image overlay for an article without images in other wikis.
  2. AC3: The “Media from other projects” section does not appear at all.

Test Case 3: Captions

  1. Open the image overlay for an article with images from other projects.
  2. Inspect the cards.
  3. AC4: Captions are shown when available.
  4. AC5: If no caption exists, nothing is displayed (no placeholder text).

Test Case 4: Project labels

  1. Inspect source labels for images.
  2. AC6: If one source, label = “From {project}.wikipedia.org”.
  3. AC7: If multiple sources, label = “From {project}.wikipedia.org and X other language editions of Wikipedia”.
  4. AC8: If from Wikidata, label = “From Wikidata”.

Test Case 5: Interaction & navigation

  1. Click an image in the “Media from other projects” section.
  2. AC9: The image opens in DetailView.
  3. AC10: DetailView auto-scrolls into view.
  4. AC11: Navigation between images works with URL routing.
  5. Scroll to bottom and click “Back to article”.
  6. AC12: User is returned to the article page.

QA Results - Patchdemo

Notes

  • Testing with patchdemo or local developer setup requires these repositories: ReaderExperiments, Minerva, MobileFrontend, MobileFrontendContentProvider, and WikimediaMessages.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Here are some questions:

Image Text

  • It sounds like figcaption, alt-text, and/or wikidata API text will be used. Is there an order of precedence?
  • what happens of none are available in the users language?

Images

  • Is there a possiblity of duplicate images?
  • Is there ever a situation where no images will be available? Is the user shown anything in that case?
Jdlrobson-WMF set the point value for this task to 5.Sep 2 2025, 4:36 PM
Jdlrobson-WMF added subscribers: mfossati, Jdlrobson-WMF.
  • We will use infinite scroll. No tabs and no extra click.
  • @egardner has requested that we update the description with the updating designs and requirements. @JScherer-WMF will do this.
  • @mfossati points out we do not have the backend yet so this should make use of a dummy URL for now (consider making the URL configurable to support easily swapping this out later). @mfossati will create that ticket.
  • Note the source will be a wiki project that will need to be mapped to a domain which will add to the complexity of the UI.

For desktop view:

For desktop view:

@lwatson I'll get confirmation for these things on Monday, but I think that these images from other wikis will look and behave like normal VTOC items as much as possible (we will need to define a new interface in types.d.ts however, since the data from the API will have different properties than what we extract from the article page). I think a gap at the end of the "normal" VTOC items, before "images from other wikis" section begins, is acceptable but I will double-check.

lwatson changed the task status from Open to In Progress.Sep 16 2025, 7:53 PM
lwatson claimed this task.

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

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: add initial UI for images from other wiki projects

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

@lwatson FYI in T403613#11196775 I've made the decision to use the MediaSearch API. The next step is to perform data cleaning and explanation building on the client-side.
I'll figure out how to minimize merge conflicts with this ticket.

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/e3c4df350c/w/

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

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: use readable language names for external wikis

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

Change #1190626 abandoned by LWatson:

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: use readable language names for external wikis

Reason:

Show the Wikipedia hostname for simplicity

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

ovasileva updated the task description. (Show Details)

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

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: add loading state for other wiki images

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

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

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: sort other wiki projects so Wikipedia is first

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

This patchdemo includes the other wiki projects' UI and their loading state.

Note that the patchdemo and local dev setup require the following repositories: ReaderExperiments, Minerva, MobileFrontend, MobileFrontendContentProvider, and WikimediaMessages. cc: @Edtadros @egardner

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/d02e09a188/w/

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/373f9ea696/w/

Notes for QA @Edtadros

Empty state

  • WHEN no images from other wiki projects exist for the current article
    • THEN do not display the "Media from other projects" section at all

Loading State

  • WHEN user scrolls to the bottom of the Visual Table of Contents (VTOC) and the "Media from other projects" header is partially (50%) in view
    • THEN the API call is triggered (lazy loading)
    • AND loading indicator is displayed while the API request is in progress

Section Header

  • Header text: "Media from other projects"
  • Location: Appears between main VTOC images and “Back to article” button
  • Styling: Consistent with main VTOC header styling

Back Button

  • Location: Bottom of the image overlay
  • Label: "Back to article"
  • Functionality: Returns user to the article page
  • Icon: Left-pointing arrow adjacent to text label

Image Interaction

  • Clickable: All images from other wikis are clickable
  • DetailView display: Clicked image opens in DetailView
  • Auto-scroll: DetailView automatically scrolls into view after selection
  • Navigation: Images can be navigated using URL routing

Image Captions

  • A descriptive label in plain text is visible if available
  • Empty state: If no caption is available, display nothing

Wiki Project Labels

  • Every image must show its source project. Note that Wikipedia and Wikidata projects are only included for now.
  • Wikipedia images appear before Wikidata images.
  • Display format:
    • Single source: "From de.wikipedia.org"
    • Multiple sources: "From de.wikipedia.org and 4 other language editions of Wikipedia"
    • Non-Wikipedia: "From Wikidata"

The "back to article" button looks different locally versus on patchdemo/catalyst. I'll need to address the button's width and spacing between other elements on mobile and desktop when using the Minerva skin. The wider button width works fine on mobile devices, but needs adjustment for desktop to match Figma.

Local - desktop viewpatchdemo/catalyst - desktop view
local_desktop_back_to_article_button.png (664×2 px, 692 KB)
patchdemo_desktop_back_to_article_button.png (614×2 px, 649 KB)

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/6f731238d9/w/

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://5b771b638e.catalyst.wmcloud.org/w/

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/08aa7b2091/w/

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://72d724a00e.catalyst.wmcloud.org/w/

Change #1189507 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: add images from other wiki projects

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

Change #1190366 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: add loading state for other wiki images

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

Change #1191175 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: sort other wiki projects so Wikipedia is first

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

Test Result - Patchdemo

Status: ✅ PASS / ❓Need More Info
Environment: patchdemo (https://patchdemo.wmcloud.org/wikis/6f731238d9/ | https://72d724a00e.catalyst.wmcloud.org/ | https://6040935af3.catalyst.wmcloud.org )
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Loading state
using 6f731238d9

  1. Open the image overlay for any article.
  2. Scroll until the “Media from other projects” header is 50% in view.
  3. Throttle network in DevTools to slow down API.
  4. AC1: A loading indicator appears while the API request is in progress.
  5. AC2: The loading indicator disappears once images render.

screenshot 63.mov.gif (1×594 px, 1 MB)

Test Case 2: Empty state
using 6f731238d9

  1. Open the image overlay for an article without images in other wikis.
  2. AC3: The “Media from other projects” section does not appear at all.

screenshot 64.mov.gif (1×594 px, 1 MB)

Test Case 3: Captions
using 72d724a00e

  1. Open the image overlay for an article with images from other projects.
  2. Inspect the cards.
  3. AC4: Captions are shown when available.

I'm not entirely sure where captions come from. But I can't seem to get captions for images from other projects.

screenshot 70.mov.gif (1×594 px, 2 MB)

  1. AC5: If no caption exists, nothing is displayed (no placeholder text).

screenshot 69.mov.gif (1×594 px, 1 MB)

Test Case 4: Project labels

  1. Inspect source labels for images.
  2. AC6: If one source, label = “From {project}.wikipedia.org”.
  3. AC7: If multiple sources, label = “From {project}.wikipedia.org and X other language editions of Wikipedia”.
  4. AC8: If from Wikidata, label = “From Wikidata”.

Try as I might I could not find a page with From Wikidata. I'm not entirely sure if this is critical since the other From ones work and hopefully it's the same logic. But leaving this as a question as to wheter this is sufficient to pass or not.

screenshot 217.png (1×583 px, 222 KB)

Test Case 5: Interaction & navigation
using 6040935af3

  1. Click an image in the “Media from other projects” section.
  2. AC9: The image opens in DetailView.
  3. AC10: DetailView auto-scrolls into view.

screenshot 71.mov.gif (1×594 px, 2 MB)

  1. AC11: Navigation between images works with URL routing.

Not sure how to validate this.

  1. Scroll to bottom and click “Back to article”.
  2. AC12: User is returned to the article page.

screenshot 72.mov.gif (1×594 px, 443 KB)

Edtadros updated the task description. (Show Details)
Edtadros moved this task from QA to Signoff on the Reader Growth Team (Sprint 6) board.

The questions I have are either due to not finding the proper article, or in the case of AC4, not having a clear understanding of where captions come from.

The questions I have are either due to not finding the proper article, or in the case of AC4, not having a clear understanding of where captions come from.

@Edtadros I think your findings in terms of captions for external images are consistent with what I've seen. Many of these images will not have captions, only an indication of where they are used.

For an example of an external image with a caption, you can go to the article on Paris and scroll all the way down to the bottom – you should see an image with a caption called "Coat of arms of Paris" or something like that. That text comes from a Wikidata label (which most of these images lack). That should show up like a normal caption.

@Edtadros ditto to what Eric said. The external images don't always have a caption (AC4), and the image may not be sourced from Wikidata (AC8). There's a "From Wikidata" example in the Manhattan article.

Regarding "AC11: Navigation between images works with URL routing":

Note: The Chrome Dev Tools step might not be necessary.

URLChrome Dev Tools
{F66715159}{F66715162}

Test Result - Patchdemo

Status: ✅ PASS
Environment: patchdemo ( https://6040935af3.catalyst.wmcloud.org )
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: iPhone 17 Pro Max

  1. AC11: Navigation between images works with URL routing.

Thanks @lwatson , AC11 Passes.

screenshot 101.mov.gif (1×1 px, 1 MB)

Looking good! Leaving this here since we've resolved the API ticket, but I am seeing a few duplicates in testing. Curious if we've flagged this so far. Everything else looks good to me!

Screenshot 2025-10-01 at 11.40.28.png (1×990 px, 673 KB)

Test wiki on [[ | Patch demo ]] by LWatson-WMF using patch(es) linked to this task was deleted:

https://6040935af3.catalyst.wmcloud.org/w/

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://6040935af3.catalyst.wmcloud.org/w/