Page MenuHomePhabricator

Implement Save and Remove Functionality for Reading Lists
Closed, ResolvedPublic0 Estimated Story Points

Description

Background

Currently, reading lists are read-only, making them ineffective. To improve the feature, the intern will implement functionality to allow users to save and remove pages from their reading lists via the API Sandbox.

User story

As a user, I want to be able to save and remove pages from my reading list so that I can manage my reading experience effectively.

Requirements

  • Read the API documentation on Reading Lists:
  • Implement API calls to:
    • Save a page to a reading list.
    • Remove a page from a reading list.
  • Test and confirm that saved pages appear on /wiki/Special:ReadingLists/Username.
    • Ensure API requests return expected responses and handle errors gracefully.
    • Document the process and challenges faced.

Note that for now, while T385755 is being worked out, the temporary placement of this button should use the existing code, placing it in the More menu in minerva and the Tools menu in vector

Additionally, since the existing APIs are not designed to special case the default list, this functionality will need to query over all lists until it finds the default list when adding and deleting. The performance impacts of this can be ignored for now

BDD

Feature: Enable Save and Remove functionality for Reading Lists using the API Sandbox

  Scenario: Save a page to the default reading list using the API
    Given I use the API Sandbox to add a page to my reading list
    When I check Special:ReadingLists/Username
    Then the page should appear in the default reading list

  Scenario: Remove a page from the default reading list using the API
    Given I have a page saved in my reading list via the API
    When I use the API Sandbox to remove that page
    Then the page should no longer appear on Special:ReadingLists/Username

Test Steps

Test Case 1: Verify saving a page to the default reading list using the API

  1. Open the API Sandbox and configure a request to add a page to your reading list.
  2. Ensure the request is executed and the API returns a success response.
  3. Visit /wiki/Special:ReadingLists/YourUsername in an incognito window.
  4. AC1: Confirm that the saved page appears in the default reading list.

Test Case 2: Verify removing a page from the default reading list using the API

  1. Open the API Sandbox and configure a request to remove the previously saved page from your reading list. Adjust the parameters accordingly.
  2. Execute the request and ensure the API returns a success response.
  3. Visit /wiki/Special:ReadingLists/YourUsername in an incognito window.
  4. AC2: Confirm that the page is no longer listed in the default reading list.

Design

No UI design changes needed.

Acceptance criteria

  • Users can successfully save or remove pages to their default reading list via a control on all article pages when the beta feature is enabled
  • Once a page is added it appears on the "Saved" list in the reading list link from the user menu dropdown
  • When the beta feature for reading list is disabled, no bookmark link is shown
  • No PHP or API changes are made (since PHP code is generally maintained by the Content Transform team)
  • API responses are handled correctly, including errors
  • Vue.js or Codex should not be loaded on page load.

Communication criteria

No formal announcement needed.
Discuss findings or issues in the team Slack channel or during check-ins.

Rollback plan

If issues arise, revert changes and disable new API calls while troubleshooting.

QA Results - Beta

ACStatusDetails
1T386669#10702056
2T386669#10702056

QA Results - Prod

ACStatusDetails
1T386669#10750804
2T386669#10750804

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Bookmark button to add/remove entriesdhardy/readinglists!9dhardybookmark-actionmain
Implement delete button functionality.dhardy/readinglists!5dhardydelete-functionalitymain
Customize query in GitLab

Event Timeline

Jdlrobson-WMF raised the priority of this task from Medium to High.
Jdlrobson-WMF lowered the priority of this task from High to Medium.Mar 25 2025, 9:53 PM
Jdlrobson-WMF added subscribers: bwang, Jdlrobson-WMF.

Nice job! Now up on https://mylists.wmcloud.org/
Over to you Edward for testing!

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

[mediawiki/extensions/ReadingLists@master] Feature: add/remove page to saved list from article

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

Change #1132018 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Feature: add/remove page to saved list from article

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

Edtadros subscribed.

Test Steps

Status: ✅ PASS
Environment: Beta (mylists.wmcloud.org)
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify saving a page to the default reading list using the API

  1. Open the API Sandbox and configure a request to add a page to your reading list. Use a command like:
  2. Ensure the request is executed and the API returns a success response.
  3. Visit /wiki/Special:ReadingLists/YourUsername in an incognito window.
  4. ✅ AC1: Confirm that the saved page appears in the default reading list.

screenshot 234.png (1×1 px, 220 KB)

screenshot 235.png (858×1 px, 165 KB)

screenshot 236.png (759×1 px, 105 KB)

Added another page
screenshot 237.png (754×1 px, 94 KB)

Test Case 2: Verify removing a page from the default reading list using the API

  1. Open the API Sandbox and configure a request to remove the previously saved page from your reading list. Adjust the parameters accordingly.
  2. Execute the request and ensure the API returns a success response.
  3. Visit /wiki/Special:ReadingLists/YourUsername in an incognito window.
  4. ✅ AC2: Confirm that the page is no longer listed in the default reading list.

Deleted the First Page Added (Hatnote)

screenshot 238.png (727×1 px, 144 KB)

screenshot 239.png (670×1 px, 135 KB)

screenshot 51.mov.gif (762×1 px, 248 KB)

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

@Jdlrobson-WMF is this testable in Prod? I'm unable to view the Reading Lists page. I tried a few different accounts.

screenshot 250.png (492×1 px, 72 KB)

Nope, it's not turned on anywhere in prod from what I understand

Actually this particular one can be tested on @ https://www.mediawiki.org/wiki/Special:ReadingLists ! (Long story but this is here to help support testing apps workflows)

Oops, apologies for lying to you Edward

Test Steps

Status: ✅ PASS
Environment: mediawiki
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify saving a page to the default reading list using the API

  1. Open the API Sandbox and configure a request to add a page to your reading list. Use a command like:
  2. Ensure the request is executed and the API returns a success response.
  3. Visit /wiki/Special:ReadingLists/YourUsername in an incognito window.
  4. ✅ AC1: Confirm that the saved page appears in the default reading list.

screenshot 267.png (1×1 px, 209 KB)

screenshot 268.png (1×1 px, 183 KB)

screenshot 269.png (1×1 px, 105 KB)

Added another page
screenshot 270.png (1×1 px, 183 KB)

screenshot 271.png (1×1 px, 125 KB)

Test Case 2: Verify removing a page from the default reading list using the API

  1. Open the API Sandbox and configure a request to remove the previously saved page from your reading list. Adjust the parameters accordingly.
  2. Execute the request and ensure the API returns a success response.
  3. Visit /wiki/Special:ReadingLists/YourUsername in an incognito window.
  4. ✅ AC2: Confirm that the page is no longer listed in the default reading list.

Deleted the Second Page Added (Parsoid)

screenshot 273.png (1×1 px, 157 KB)

screenshot 274.png (1×1 px, 154 KB)

screenshot 59.mov.gif (1×1 px, 351 KB)