Page MenuHomePhabricator

New translation: Get mobile friendly image
Closed, ResolvedPublic

Assigned To
Authored By
Jpita
Jun 7 2021, 5:53 AM
Referenced Files
F58853000: 2025-03-17_10-10-49.mp4.gif
Mar 17 2025, 5:16 PM
F58852997: 2025-03-17_10-09-32.mp4.gif
Mar 17 2025, 5:16 PM
F58852994: 2025-03-17_09-58-50.png
Mar 17 2025, 5:16 PM
F58852992: 2025-03-17_09-58-11.png
Mar 17 2025, 5:16 PM
F58852989: 2025-03-17_09-55-54.png
Mar 17 2025, 5:16 PM
F58852987: 2025-03-17_09-57-14.png
Mar 17 2025, 5:16 PM
F34484719: image.png
Jun 7 2021, 5:53 AM

Description

When we are on mobile, we are getting the image in its full size.

image.png (722×864 px, 768 KB)

This specific image weighs 8MB and takes a few seconds to load depending on the internet connection speed.
We should get a smaller image depending on the device we are using.

NOTE: For QA: Please see T360589: De-fragment thumbnail sizes in mediawiki - the image sizes may differ due to bucketing.

Derived Requirement

Ensure that when accessing the New Translation feature on mobile, images are dynamically resized to an appropriate, smaller resolution based on the device being used, improving load times and performance.

Test Steps

Test Case 1: Verify image size varies by device resolution

  1. Open Wikipedia on different devices (or use DevTools to simulate various screen sizes).
  2. Navigate to the New Translation feature.
  3. Check the image resolution loaded in each case.
  4. ✅❓❌⬜ AC1: Ensure the image resolution dynamically adjusts based on the device screen size.

Test Case 2: Check image loading performance

  1. Open Wikipedia on a mobile device with a slow network (e.g., 3G).
  2. Navigate to the New Translation feature.
  3. Measure the time taken for the image to load.
  4. ✅❓❌⬜ AC2: Verify that the image loads quickly and does not significantly delay the page rendering.

QA Results - Test Wiki

ACStatusDetails
1T284422#10643009
2T284422#10643009

Event Timeline

@Pginer-WMF This would also be a nice-to-have improvement to reduce the bandwidth usage. Should we move it to the backlog for a future sprint?

@Pginer-WMF This would also be a nice-to-have improvement to reduce the bandwidth usage. Should we move it to the backlog for a future sprint?

Thanks for flagging this. Sounds good to me, Nik.

Change #1123584 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] Confirm translation: Use next breakpoint thumbnail instead of full image

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

Change #1123584 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Confirm translation: Use next breakpoint thumbnail instead of full image

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

Change #1124141 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20250303

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

Change #1124141 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20250303

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

Change #1125152 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] Confirm Translation: Fix "getImage" for articles without image

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

Change #1125152 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Confirm Translation: Fix "getImage" for articles without image

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

Change #1125201 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] Confirm Translation: Make custom thumbnail creation more robust

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

Change #1125201 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Confirm Translation: Make custom thumbnail creation more robust

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

Change #1126123 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250310

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

Change #1126123 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250310

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

Change #1126139 had a related patch set uploaded (by Sbisson; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@wmf/1.44.0-wmf.19] CX3 Build 1.0.0+20250310

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

Change #1126139 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@wmf/1.44.0-wmf.19] CX3 Build 1.0.0+20250310

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

Mentioned in SAL (#wikimedia-operations) [2025-03-10T20:20:43Z] <dancy@deploy2002> Started scap sync-world: Backport for [[gerrit:1126139|CX3 Build 1.0.0+20250310 (T284422 T387036)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-10T20:23:20Z] <dancy@deploy2002> sbisson, dancy: Backport for [[gerrit:1126139|CX3 Build 1.0.0+20250310 (T284422 T387036)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-10T20:31:30Z] <dancy@deploy2002> Finished scap sync-world: Backport for [[gerrit:1126139|CX3 Build 1.0.0+20250310 (T284422 T387036)]] (duration: 10m 46s)

@ngkountas Ensured the image resolution dynamically adjusts based on the device screen size. I will move this to sign-off. Thanks for all your work!

Test Result - TestWiki

Status: ✅ PASS
Environment: TestWiki
OS: macOS Sonoma 15.3.1
Browser: Chrome 134
Device: MBA
Emulated Device: NA

Test Artifact(s):
https://test.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&filter-id=sports&filter-type=topic&from=en&to=es&uselang=en&page=Asian%20Infrastructure%20Investment%20Bank#/sx
https://test.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&filter-id=sports&filter-type=topic&from=en&to=es&uselang=en&page=Asian%20Infrastructure%20Investment%20Bank#/sx

Test Steps

Test Case 1: Verify image size varies by device resolution

  1. Open Wikipedia on different devices (or use DevTools to simulate various screen sizes).
  2. Navigate to the New Translation feature.
  3. Check the image resolution loaded in each case.
  4. AC1: Ensure the image resolution dynamically adjusts based on the device screen size.
MobileTabletDesktopDesktop-Wide
2025-03-17_09-57-14.png (794×807 px, 112 KB)
2025-03-17_09-55-54.png (791×813 px, 215 KB)
2025-03-17_09-58-11.png (840×1 px, 246 KB)
2025-03-17_09-58-50.png (886×1 px, 469 KB)

Test Case 2: Check image loading performance

  1. Open Wikipedia on a mobile device with a slow network (e.g., 3G).
  2. Navigate to the New Translation feature.
  3. Measure the time taken for the image to load.
  4. AC2: Verify that the image loads quickly and does not significantly delay the page rendering.
DesktopMobile
2025-03-17_10-09-32.mp4.gif (1×2 px, 3 MB)
2025-03-17_10-10-49.mp4.gif (1×1 px, 1 MB)