Page MenuHomePhabricator

[Share Highlights] Improve the article's lead image
Closed, ResolvedPublic3 Estimated Story Points

Description

The current thumb extractor returns the first image that appears on the page, which may not be the lead one.

Acceptance criteria

Note: We will need Elena to help QA

Event Timeline

HSwan-WMF set the point value for this task to 3.

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

[mediawiki/extensions/ReaderExperiments@master] Share Highlights: retrieve lead image from PageImages API

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

Notes for QA

  1. Navigate to a Wikipedia article that has a lead image and enable Minerva skin
  2. Select text → share button appears → tap it → share dialog opens
  3. Verify the lead image appears in the quote card (9:16 aspect ratio)
  4. Check DevTools Network tab: API call to ?action=query&prop=pageimages is made
  5. Test an article with no images: quote card shows 1:1 aspect ratio, no image shown
  6. Test small image fallback: open an article whose lead image is less than 500px (minimum number not yet decided) → no image shown in quote card

Notes for QA

  1. Navigate to a Wikipedia article that has a lead image and enable Minerva skin

?useskin=minerva&useformat=mobile&shareHighlight=1 should be appended to the URL.

Change #1269080 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Share Highlight: retrieve lead image from PageImages API

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

Thank you, @lwatson and @mfossati for the QA instructions!

Testing on enwiki beta - the following issues have been found. It seems that those issues might be specific to the beta cluster environment. I encountered the following beta cluster limitations when testing

  • beta cluster doesn't have an absolute match for all prod templates, e.g. imported articles often display Lua script errors or red links in the templates
  • Images on enwiki beta may be different versions of images comparing to production. I checked for such the articles on beta cluster with unmodified leading images.

TEST RESULTS (based on Notes for QA in https://phabricator.wikimedia.org/T421133#11802706)

Navigate to a Wikipedia article that has a lead image and enable Minerva skinUsing: ?useskin=minerva&useformat=mobile&shareHighlight=1
✅ Select text → share button appears → tap it → share dialog opensno issues https://en.wikipedia.beta.wmcloud.org/wiki/Canada_lynx?useskin=minerva&useformat=mobile&shareHighlight=1useskin=minerva&useformat=mobile&shareHighlight=1
Screenshot 2026-04-13 at 8.39.41 PM.png (914×439 px, 248 KB)
✅ Verify the lead image appears in the quote card (9:16 aspect ratio)From the above highlighting:
Screenshot 2026-04-13 at 8.41.02 PM.png (930×424 px, 355 KB)
✅ Check DevTools Network tab: API call to ?action=query&prop=pageimages is madeGET https://en.wikipedia.beta.wmcloud.org/w/api.php?action=query&format=json&prop=pageimages&titles=Canada_lynx&pithumbsize=960[...]
✅ Test an article with no images: quote card shows 1:1 aspect ratio, no image shownhttps://en.wikipedia.beta.wmcloud.org/wiki/Favilla_Guitars?useskin=minerva&useformat=mobile&shareHighlight=1
Screenshot 2026-04-13 at 9.06.19 PM.png (959×465 px, 73 KB)
✅ Test small image fallback: open an article whose lead image is less than 500px (minimum number not yet decided) → no image shown in quote cardhttps://en.wikipedia.beta.wmcloud.org/wiki/Leopard_cat?useskin=minerva&useformat=mobile&shareHighlight=1
Screenshot 2026-04-13 at 9.09.20 PM.png (965×440 px, 186 KB)

Testing notes to consider before Sign-off: beta cluster has quite a bit of "noise" that I mentioned in my comment above. Even confirming "happy paths" was somewhat challenging. I filed T423304: [QA task] shareHighlight testing where I listed the issues that I observed while testing shareHighlight.