Page MenuHomePhabricator

Minerva doesn't support outputting custom data attributes
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Visit beta cluster and enable reading list feature
  • Switch to mobile site
  • Click the bookmark button

What happens?:
A JS error

What should have happened instead?:
No JS error.

Minerva doesn't output the data attributes provided in the ReadingList hook.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Requirement

Minerva skin must support outputting custom data-* attributes provided via the ReadingList hook to ensure the reading list feature functions without JavaScript errors.

BDD

Feature: Minerva outputs custom data attributes from ReadingList hook

Scenario: Bookmark icon renders with expected data attributes on Minerva
  Given the ReadingList beta feature is enabled
  And I am using the Minerva skin on the mobile site
  When I navigate to any article
  Then the bookmark icon should include custom `data-*` attributes from the ReadingList hook
  And no JavaScript error should be thrown in the console

Test Steps

Test Case 1: Custom data attributes appear on bookmark icon

  1. Create or use an existing account
  2. Enable the Reading List beta feature in preferences
  3. Switch to the Minerva (mobile) skin
  4. Navigate to any article, e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Paris
  5. Open browser dev tools and inspect the bookmark icon element
  6. AC1: Confirm that it contains the expected data-* attributes provided by the ReadingList hook (data-mw-list-id, and data-mw-entry-id if saved)
  7. AC2: Confirm that no JavaScript error related to reading lists appears in the console

QA Results - Beta

ACStatusDetails
1T394560#10873432
2T394560#10873432

QA Results - Prod

ACStatusDetails
1T394560#10905520
2T394560#10905520

Event Timeline

Change #1147073 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Fixes: Minerva doesn't support outputting custom data attributes

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

Jdlrobson-WMF changed the task status from Open to In Progress.May 19 2025, 5:40 PM
Jdlrobson-WMF claimed this task.
Jdlrobson-WMF moved this task from Incoming to Q4 on the Web-Team board.
Jdlrobson-WMF set the point value for this task to 2.May 19 2025, 9:46 PM
Jdlrobson-WMF moved this task from Q4 to Sprint Backlog on the Web-Team board.
Jdlrobson-WMF changed the task status from In Progress to Open.May 20 2025, 6:22 PM

This is now ready for review.

SToyofuku-WMF subscribed.

Will assign to myself, but move back to ready as I'm currently working on T393508 which is higher priority (as Justin leaves halfway through the sprint and would be signing it off)

Anyone else is welcome to take this from me! Claiming as I am the requested reviewer on the patch

Jdlrobson-WMF lowered the priority of this task from High to Medium.May 23 2025, 11:11 PM

Change #1151206 had a related patch set uploaded (by Dillon; author: Dillon):

[mediawiki/extensions/ReadingLists@master] bookmark: Refactor handling of click events

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

Working on reviewing this today with Dillon

Change #1151206 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] bookmark: Refactor handling of click events

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

Jdlrobson-WMF lowered the priority of this task from Medium to Low.
Jdlrobson-WMF added a subscriber: KSarabia-WMF.

Looks like this is working on beta cluster but passing to Edward to confirm.

Jdlrobson-WMF added a subscriber: Edtadros.

There was a bit of a mix up. Will sync with team.

Jdlrobson-WMF raised the priority of this task from Low to Medium.May 29 2025, 5:42 PM

Change #1147073 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Fixes: Minerva doesn't support outputting custom data attributes

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

Jdlrobson-WMF lowered the priority of this task from Medium to Low.

Edward: now over to you. It's enough for this one to verify that data attributes are present on the bookmark icon on Minerva / mobile skin.

Test Result - Beta

Status: ❓Need More Info
Environment: beta
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Steps

Test Case 1: Custom data attributes appear on bookmark icon

  1. Create or use an existing account
  2. Enable the Reading List beta feature in preferences
  3. Switch to the Minerva (mobile) skin
  4. Navigate to any article, e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Paris
  5. Open browser dev tools and inspect the bookmark icon element
  6. AC1: Confirm that it contains the expected data-* attributes provided by the ReadingList hook (e.g., data-list-id, data-title, etc.)

Please confirm the data elements are the ones you are expecting

screenshot 376.png (1×1 px, 451 KB)

  1. AC2: Confirm that no JavaScript error related to reading lists appears in the console

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

❓ AC1: Confirm that it contains the expected data-* attributes provided by the ReadingList hook (e.g., data-list-id, data-title, etc.)

Yep these are the correct data attributes! Thanks @Edtadros !

Test Result - Prod

Status: ✅ PASS
Environment: testwiki
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Steps

Test Case 1: Custom data attributes appear on bookmark icon

  1. Create or use an existing account
  2. Enable the Reading List beta feature in preferences
  3. Switch to the Minerva (mobile) skin
  4. Navigate to any article, e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Paris
  5. Open browser dev tools and inspect the bookmark icon element
  6. AC1: Confirm that it contains the expected data-* attributes provided by the ReadingList hook (e.g., data-list-id, data-title, etc.)

screenshot 25.png (1×1 px, 337 KB)

  1. AC2: Confirm that no JavaScript error related to reading lists appears in the console

screenshot 26.png (1×1 px, 222 KB)