Page MenuHomePhabricator

Improve API for removing item from a specific list
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

Currently when you click the bookmark icon when filled it removes items from ALL LISTs. Going forward we want to have more granularity here - to be able to remove from just the default list for example.

The existing API is a bit cumbersome for this simple action. You must first traverse all items in a given list to find the entry ID of the item you want to remove and then call deletentry in API - particularly if the list is long e.g. have 100 items and needs multiple API requests to find.

This blocks work on T438390: Support unsave flow via configpopover which I discovered while tinkering with this patch:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ReadingLists/+/1353505

User story

As a developer I want a cheap and easy way to remove an item from a list.

Design requirements

Add design requirements or link to design files.


Requirements

  • Given a title and project I should be able to remove it from a single list ID in one API request.

Acceptance criteria for done

  • Add clear acceptance criteria. Separate out items to implement and items to QA if needed.

QA strategy

  • Risky change? List whether this change has an increased potential to cause bug, regressions, or controversy.
  • QA by: Who should QA this task?
  • QA in: Which environment? Patchdemo, beta, production...
  • Test steps: Add if needed.

Communication criteria

Add if this needs an announcement or discussion.

Rollback plan

Describe the rollback plan in production for this task if something goes wrong.

This task was created by Version 1.2.0 of the Reader Experience team task template using phabulous.

Event Timeline

Hi, I'd like to work on the 'remove item from specific list' improvement. I'm thinking of adding an optional parameter to target a single list by ID, while keeping existing behavior unchanged. Does this align with your expectations? And meanwhile, let's set up the dev environment and identify the current delete flow and tests before writing any code.

@Nithudev_: Your previous comment looks like AI slop ("let's set up the dev environment [...] before writing any code"?). Please do not post such nonsense here, as it is not a good use of time of other humans. Thank you for your understanding.

@Nithudev_: Your previous comment looks like AI slop ("let's set up the dev environment [...] before writing any code"?). Please do not post such nonsense here, as it is not a good use of time of other humans. Thank you for your understanding.

Please forgive me as I am new here; I will not waste others' time.

It is already possible to find which lists that a page is saved to:

https://en.wikipedia.org/w/api.php?action=query&format=json&meta=readinglists&formatversion=2&rlproject=enwiki&rltitle=Cat

This has the list id and the name of the list, but not the entry id. We could add support for an optional list_id param to the deleteentry API.

{
    "batchcomplete": true,
    "query": {
        "readinglists": [
            {
                "id": 1234567,
                "name": "default",
                "default": true,
                "description": "",
                "created": "2026-08-06T20:13:55Z",
                "updated": "2026-08-06T20:13:55Z",
                "size": 68
            },
            {
                "id": 9874324,
                "name": "Recent Pages - Mar 23 at 7:50 AM",
                "default": false,
                "description": "",
                "created": "2026-03-23T11:50:40Z",
                "updated": "2026-08-06T20:22:01Z",
                "size": 49
            }
        ],
        "readinglists-synctimestamp": "2026-10-13T14:55:53Z"
    }
}

This has the list id and the name of the list, but not the entry id. We could add support for an optional list_id param to the deleteentry API.

Correct and yes I think this is the best (most intuitive) way to do this.

Change #1355167 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/ReadingLists@master] Add optional list param to deleteentry action API

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

Change #1355167 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Add optional list param to deleteentry action API

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