Page MenuHomePhabricator

Make list param optional in ApiReadingListsCreateEntry and if omitted, save to the default list
Closed, ResolvedPublic2 Estimated Story Points

Description

When a user views a page and has reading lists enabled (with the "Save page" bookmark button), we should not query the database to get the default reading list id.

Instead the api endpoint (ApiReadingListsCreateEntry) could be updated to make the list id optional, and the default action is to save the page to the default list.

In the future, if we allow the user to use the "save pages" button to save to a non-default list, then the list id could be in user preferences.

Event Timeline

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

[mediawiki/extensions/ReadingLists@master] Make list param optional in ApiReadingListsCreateEntry

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

aude renamed this task from Make list id optional in ApiReadingListsCreateEntry and if omitted, save to the default list to Make list param optional in ApiReadingListsCreateEntry and if omitted, save to the default list.Feb 20 2026, 2:59 PM
aude claimed this task.
aude set the point value for this task to 2.Feb 20 2026, 6:47 PM
aude moved this task from Needs refinement to Ready for sprint on the Reader Experience Team board.
SToyofuku-WMF subscribed.

Also reviewing this one - in theory I should be following my own guidance of clearing out code review column before starting something new 🙃

Change #1240999 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Make list param optional in ApiReadingListsCreateEntry

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

Etonkovidova subscribed.

Checked on testwiki wmf.18: command=createentry successfully adds an article to a default reading list (no List ID is required) https://test.wikipedia.org/w/api.php?action=readinglists&format=json&command=createentry&token=123test.wikipedia.org&title=Mavetuna1

{

"createentry": {
    "id": "99074441",
    "entry": {
        "id": 99074441,
        "listId": 5574935,
        "project": "https://test.wikipedia.org",
        "title": "Mavetuna1",
        "created": "2026-03-06T16:35:59Z",
        "updated": "2026-03-06T16:35:59Z",
        "duplicate": false
    },
    "result": "Success"
}

}

Jdlrobson-WMF claimed this task.