Page MenuHomePhabricator

Build Watchlist add/remove workflow from article
Closed, ResolvedPublic

Description

👨‍🎨 Check out the latest designs for this task on Zeplin.


1) Watchlist article experience

1.2.3.4.5.6.
watchlist-02-article.png (1×720 px, 403 KB)
watchlist-03-article-snackbar.png (1×720 px, 603 KB)
watchlist-04-expiry-bottom-sheet.png (1×720 px, 470 KB)
watchlist-05-expiry-confirmation.png (1×720 px, 602 KB)
watchlist-06-remove-from-watchlist.png (1×720 px, 605 KB)
watchlist-06-remove-from-watchlist.png (1×720 px, 604 KB)

Flow:

  1. User selects Add to Watchlist in the overflow menu
    • When the item has been added before the icon changes to a filled, respectively half filled star (impermanent). Copy ready. Remove from Watchlist and triggers the snackbar in step 6.
  2. User sees a confirmation snackbar with an additional option to change the duration of the watched item (Watchlist Expiry).
    • Copy: %itemName and its talk page have been added to your watchlist permanently.
  3. User sees a toast to select the duration
  4. User sees a confirmation snackbar
    • Copy: %itemName and its talk page have been added to your watchlist %durationPeriod.
    • Options (consistent with Desktop Wikipedia):
      • Permanent
      • 1 week
      • 1 month
      • 3 months
      • 6 months
  5. User removes item from the Watchlist.

Event Timeline

LGoto triaged this task as Medium priority.Dec 7 2020, 5:03 PM

Hi @ifried, I am currently working on implementing the Watchlist Expiry feature on the Android app, but I cannot find an API that can get the expiry status for a certain article, just like what the desktop version does, the "star" becomes filled or half-filled.

Do you know someone on your team who has the answer? Thanks!

Hi @cooltey, here is some documentation about how to submit a watch action to the API: https://www.mediawiki.org/wiki/API:Watch, and here is some documentation about how to get the expiry for articles: https://www.mediawiki.org/wiki/API:Watchlist. Please let me know if this helps or if you have any further questions.

@HMonroy Thanks! I'm making the following query:

https://en.wikipedia.org/w/api.php?format=json&formatversion=2&action=query&list=watchlist&wlprop=title|expiry

However, it returns expiry=false for all articles, even though I know that some of the articles on my watchlist have expiry enabled. Is this expected, or is there some other parameter we should use?

@Dbrant you are correct. I tested the same endpoint and it's not retrieving the expiry as expected. I dug around and found T263796, which is addressing this issue. I think it's being released this week. Is this correct @DannyS712? I tried verifying it in my local environment but my wiki instance is currently broken.

@Dbrant you are correct. I tested the same endpoint and it's not retrieving the expiry as expected. I dug around and found T263796, which is addressing this issue. I think it's being released this week. Is this correct @DannyS712? I tried verifying it in my local environment but my wiki instance is currently broken.

Sorry, just saw this - yes, this should be the case

@HMonroy Thanks! I'm making the following query:

https://en.wikipedia.org/w/api.php?format=json&formatversion=2&action=query&list=watchlist&wlprop=title|expiry

However, it returns expiry=false for all articles, even though I know that some of the articles on my watchlist have expiry enabled. Is this expected, or is there some other parameter we should use?

Yeah, originally I messed up, it should be working with the latest code (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/643158/)

Hi ifried, I am currently working on implementing the Watchlist Expiry feature on the Android app, but I cannot find an API that can get the expiry status for a certain article, just like what the desktop version does, the "star" becomes filled or half-filled.

Do you know someone on your team who has the answer? Thanks!

@Dbrant's example query at T269446#6680504 is basically what is used at Special:Watchlist (it lists pages on your watchlist that were recently changed). If you wanted to get the watch status of a given page, I think API:Info is the proper API for this. However, it does not yet give you the expiry, rather just a true/false of whether the page is watched. I wanted to let you know we're looking into fixing that, see T268834: Watchlist Expiry: prop=info&inprop=watched should show some indication of expiry. It probably won't get deployed until the new year though, due to the usual code freeze in late December.

@Dbrant's example query at T269446#6680504 is basically what is used at Special:Watchlist (it lists pages on your watchlist that were recently changed). If you wanted to get the watch status of a given page, I think API:Info is the proper API for this. However, it does not yet give you the expiry, rather just a true/false of whether the page is watched. I wanted to let you know we're looking into fixing that, see T268834: Watchlist Expiry: prop=info&inprop=watched should show some indication of expiry. It probably won't get deployed until the new year though, due to the usual code freeze in late December.

Thanks for the heads up! I'm glad that's on its way, and we can certainly wait until it's deployed.

Moving this back to the DNP column until I have access to the APK. Please put it back to Design signoff when that’s the case, thx @cooltey.

Visually, this looks good to me! Just to confirm @cooltey → from a functional perspective it doesn’t work completely yet, right? Based on the previous comments in the task.

In T269446#6699044, @schoenbaechler wrote:

Visually, this looks good to me! Just to confirm @cooltey → from a functional perspective it doesn’t work completely yet, right? Based on the previous comments in the task.

The API will only return the status of the watched status of an article, and we're still waiting to receive the expiry value from the API to be able to update the overflow menu icon. (filled or half-filled star).

I would say the work is completed and just needs a follow-up after the API work is done.

Sounds good @cooltey → moving it to QA signoff