Page MenuHomePhabricator

[ReadingLists] Move bookmark action button to toolbar
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

In T390762 we enabled adding an article to the default reading list. This task will define the work required to move the "Bookmark" menu item from the Tools -> Actions menu into the toolbar next to the watchstar icon.

User story

As a user, I'd like to easily add an article to my default reading list.

Requirements

  • A bookmark icon exists next to the watchstar icon
  • Clicking the bookmark icon will add the article to a users default reading list.
  • If the article is already added to the default reading list, clicking the bookmark icon will remove it.

BDD

Feature: Optimized reading list bookmark behavior

Scenario: No API request on page load
  Given the reading list beta feature is enabled
  When I open the network tab and visit any article
  Then a bookmark icon appears next to the watchstar on both Minerva and Vector skins
  And no reading list API request occurs on page load

Test Steps

Test Case 1: Verify no reading list API request on page load

Precondition: Make sure you have enabled the Reading List beta feature in user preferences.

  1. Log in with an existing user account.
  2. Open the browser DevTools and switch to the Network tab.
  3. Navigate to any article page (e.g., /wiki/Dog) on the beta cluster.
  4. AC1: Confirm a bookmark icon appears next to the watchstar in both Minerva and Vector skins.
  5. AC2: Confirm no API requests related to reading lists are triggered automatically on page load.

Precondition: Create a new user account and enable the Reading List beta feature.

  1. Navigate to any article page (e.g., /wiki/Cat).
  2. AC3: Confirm no API requests related to reading lists are triggered on page load.
  3. Click the bookmark icon next to the watchstar.
  4. AC4: Confirm the article is added to a newly created default reading list (no errors).
  5. Refresh the page.
  6. AC5: Confirm the bookmark icon remains filled, indicating the article is successfully saved.

Design

image.png (350×698 px, 26 KB)
image.png (329×612 px, 27 KB)
button when article has been added to default reading listButton when article has not been added to default reading list

Event Timeline

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

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

[mediawiki/extensions/ReadingLists@master] bookmark: Move action button to toolbar

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

Hoping to get a new patch up by the end of the day.

Currently in process of reorganizing ResourceLoader.

Change #1143673 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] bookmark: Move action button to toolbar

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

Edward. FYI: Known issue is that your testing should fail in mobile until T394560: Minerva doesn't support outputting custom data attributes is fixed. You can move to sign off once you've confirmed things are working in desktop and broken in mobile.

Edtadros subscribed.

Test Steps

Status: ❌ FAIL
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify no reading list API request on page load

Precondition: Make sure you have enabled the Reading List beta feature in user preferences.

  1. Log in with an existing user account.
  2. Open the browser DevTools and switch to the Network tab.
  3. Navigate to any article page (e.g., /wiki/Dog) on the beta cluster.
  4. ✅ AC1: Confirm a bookmark icon appears next to the watchstar in both Minerva and Vector skins.
  5. ✅ AC2: Confirm no API requests related to reading lists are triggered automatically on page load.
VectorMinerva
screenshot 319.png (1×1 px, 298 KB)
screenshot 320.png (1×1 px, 280 KB)
no api calls, I guess this is done?

Precondition: Create a new user account and enable the Reading List beta feature.

  1. Navigate to any article page (e.g., /wiki/Cat).
  2. ✅ AC3: Confirm no API requests related to reading lists are triggered on page load.
VectorMinerva
screenshot 321.png (1×1 px, 300 KB)
screenshot 324.png (1×1 px, 279 KB)
  1. Click the bookmark icon next to the watchstar.
  2. ✅ AC4: Confirm the article is added to a newly created default reading list (no errors).
VectorMinerva
screenshot 322.png (1×1 px, 154 KB)
screenshot 325.png (1×1 px, 117 KB)
  1. Refresh the page.
  2. ❌ AC5: Confirm the bookmark icon remains filled, indicating the article is successfully saved.
VectorMinerva
screenshot 323.png (1×1 px, 279 KB)
screenshot 326.png (1×1 px, 266 KB)
link still takes you to the Desktop page

There is an issue with the reading list label

Screenshot 2025-05-19 at 10.17.04 AM.png (314×182 px, 21 KB)

After that we can pass to Edward.

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

[mediawiki/extensions/ReadingLists@master] Fix Reading Lists user link translation

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

Change #1147866 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Fix Reading Lists user link translation

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

AC5 ( T393608#10835903) will be fixed as part of T394736.

Great work on this @Dillon !

Jdlrobson-WMF updated the task description. (Show Details)
Jdlrobson-WMF updated the task description. (Show Details)

Resolving given this is working as required on https://mylists.wmcloud.org/
Follow up work in { T394736}

Test Steps

Status: ❌ FAIL
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify no reading list API request on page load

Precondition: Make sure you have enabled the Reading List beta feature in user preferences.

  1. Log in with an existing user account.
  2. Open the browser DevTools and switch to the Network tab.
  3. Navigate to any article page (e.g., /wiki/Dog) on the beta cluster.
  4. ✅ AC1: Confirm a bookmark icon appears in both Minerva and Vector skins.
  5. ✅ AC2: Confirm no API requests related to reading lists are triggered automatically on page load.
VectorMinerva
No api calls
screenshot 363.png (1×1 px, 437 KB)
No api calls
screenshot 364.png (1×1 px, 305 KB)

Precondition: Create a new user account and enable the Reading List beta feature.

  1. Navigate to any article page (e.g., /wiki/Cat).
  2. ⬜ AC3: Confirm no API requests related to reading lists are triggered on page load.

Prod testing is read only so skipping this so no new user needs to be created.

  1. Click the bookmark icon next to the watchstar.
  2. ❌ AC4: Confirm the article is added to a newly created default reading list (no errors).
VectorMinerva
This works fine
screenshot 97.mov.gif (1×1 px, 482 KB)
This shows an error in the console and the page isn't saved.
screenshot 96.mov.gif (1×1 px, 723 KB)
screenshot 365.png (745×1 px, 102 KB)

Error:

 index.js:123 Uncaught (in promise) readinglists-db-error-already-set-up
eval	@	index.js:123
  1. Refresh the page.
  2. ✅ AC5: Confirm the bookmark icon remains filled, indicating the article is successfully saved.
VectorMinerva
screenshot 98.mov.gif (1×1 px, 624 KB)
screenshot 99.mov.gif (1×1 px, 568 KB)

❌ AC4: Confirm the article is added to a newly created default reading list (no errors).

Thanks Edward! This is expected. Will be fixed by T394560: Minerva doesn't support outputting custom data attributes.