Page MenuHomePhabricator

Watchlist Expiry: Support for Static Watch Page (action=watch) [medium]
Closed, ResolvedPublic

Description

As a Watchlist Expiry user, I want to be able to temporarily watch items via action=watch, so that I can access the same feature offered to users who have JS enabled or directly watched via the article/edit page.

Background: There are many ways that someone may watch a page via action=watch. These include: a) if the user has JS disabled, b) if the user right clicked on the 'watch star' and chose to watch in a separate tab or window, and c) if the user wants to share a watch link with someone else. For these reasons, we should also accommodate temporary watching via action=watch. This is the first iteration of the implementation of the UI, so it may later change form. However, we want to start experimenting with its implementation. As we do this work, it is important to remember that we want to add watchlist expiry functionality while not adding extra steps or complexity for users who want to continue watching indefinitely. For this reason, we are keeping the 'Yes' button and adding a drop-down that has the indefinite watch period set as the default.

Acceptance Criteria:

  • Update the current action=watch page to accommodate temporarily watchlist as follows:
    • Change "Add this page to your watchlist?" to "Add this page to your watchlist:"
    • Add a drop-down after "watchlist:" that includes:
      • Permanently (as default)
      • 1 week
      • 1 month
      • 3 months
      • 6 months
  • Rename the button from Yes to Watch
    • The look and functionality of the button remains unchanged
  • Pages should be watched according to time period selection from drop-down
  • If a page has already been watched, the behavior should be:
    • Label at top should state: "Update watchlist"
    • Label above drop-down should state: "Watchlisted for:"
    • Drop-down should have days left as pre-selected option at top
    • The selection should be written as follows: "X days left" (for example, "10 days left" or "20 days left").

Visual Example
Link: https://en.wikipedia.org/w/index.php?title=Neferefre&action=watch

If page not yet watched:

No JS.png (198×672 px, 17 KB)

If page already watched:
Note: The language in the mockups is not quite accurate; see the 'acceptance criteria' for language requirements:

No JS (Watchlisted).png (198×672 px, 11 KB)
No JS (Watchlisted) - open.png (198×672 px, 12 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
ifried updated the task description. (Show Details)
ARamirez_WMF renamed this task from Watchlist Expiry: Support for Static Watch Page (action=watch) to Watchlist Expiry: Support for Static Watch Page (action=watch) [medium].Feb 19 2020, 12:29 AM
ARamirez_WMF moved this task from Needs Discussion to Up Next (June 3-21) on the Community-Tech board.

The backend part of this would incidentally be done with T245078: Watchlist expiry API: Add a expiry parameter when adding an item to the watchlist [medium]. The API ends up calling WatchAction::doWatch().

I'm thinking there needs to be a follow up patch to T245213: Update core watchlist code to support expiries that adds more support for expiries to the codebase, including all hooks (which is what is used here). It can be done as part of the same ticket, it's only a separate patch to ease code review. Then, this task can just be about the frontend, while T245078 is about accepting expiries in the API (so pretty much just changing ApiWatch and adding tests). Does that make sense?

Change 579139 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/core@master] WIP

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

If I'm already watching a page temporarily, and I go to ?action=watch, what should be displayed as the expiry? It can't re-calculate what was originally selected in the dropdown list (because we don't store when an item was added to the watchlist). Currently, there's no indication on action=watch that a page is already being watched. Should it show the existing expiry if there is one?

Change 579460 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/core@master] Unify handling of options messages

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

@Prtksxna We discussed what the behavior should be in the user has already watched the page. There are a few things we can do to let them know that the page is already watched:

  • They will see the half star at the top
  • The drop-down should be auto-populated with the days left, which should be selected by default. Do you have any suggestions for how it should be phrased in the drop-down? Perhaps "2 days remaining" or something to that effect?
  • We can change the language on the page. For example,

"Update page in watchlist
Update watchlist period to: [dropdown placed here]"
[yes button]

What do you think?

@Samwilson We have received feedback from volunteers on the project talk page about the time ranges. They found that '2 days' was unnecessary, but they liked all of the other time ranges that we are including. So, here's my question: Is it too late to remove '2 days' from the acceptance criteria (i..e, should I create a new ticket)? Or can I update the acceptance criteria to remove '2 days'?

Also, is it too late to change the term 'indefinitely' to 'permanently'? This was also a suggestion we received in our talk page discussions with volunteers.

Thanks!

No, that's easy to change. I'm updating the other stuff too.

Also (if it's to be added) where in the list should existing expiry go? e.g.

watch days.png (350×340 px, 15 KB)

@Prtksxna I think I've done all I can do here without your input.

@Prtksxna I think I've done all I can do here without your input.

Sorry @Samwilson! I missed replying to this ticket.


Currently, there's no indication on action=watch that a page is already being watched.

Yeah, that is a bit weird. I think the form should change if the page is already in the watchlist. Is that possible? Just changing the labels would be enough:

No JS (Watchlisted).png (198×672 px, 11 KB)
No JS (Watchlisted) - open.png (198×672 px, 12 KB)

I am a bit confused about the language for the dropdown though. Some ideas:

  • 183 days
  • 183 more days
  • 183 days left
  • 183 days (current)

This would also depend on what we choose as the label, Watched: or Watched for: .

Should it show the existing expiry if there is one?

Yeah, calculating the current time remaining is better than showing what they had initially selected any way. I don't think they'd remember when they added it either, and knowing when it'll get removed is more helpful.

@Prtksxna and I discussed this together. We agree that it should be '183 days left' (as an example), which we can then show to volunteers and see if they have any suggestions around the language (but it's good for now as beta/early stage language. Also, we both agree that the time remaining is a more useful piece of information than the originally selected time. I'll update the Acceptance Criteria with this information. Thanks!

ifried updated the task description. (Show Details)
ifried updated the task description. (Show Details)
ifried updated the task description. (Show Details)

Should there be a different label for existing permanent watchlisting? It might read a bit strangely with "Watchlisted for Permanently":

watchlisted-for-permanently.png (296×452 px, 11 KB)

If there are no more updates to the language used here, this is ready for review.
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/579139

(I mean, I think we said this morning that there are more updates, but just noting this here that I'm done with this for now; will get on with T248494.)

@Prtksxna and I have discussed how to make the text more open to various languages & grammatical structures. We have come up with the following:

  • Label: The label for the drop-down should be changed to say "Watchlist time period:"
  • Language in drop-down: We would like to keep the format of "X days left" when the page has already been watched, and we'll ask users to translate "X days left."

@Samwilson Let me know if the label update (as shared in previous comment) should be a new ticket. Thanks!

@ifried thanks! And no that's fine to add to this patch; I've updated it and it's now ready for review.

Change 579460 merged by jenkins-bot:
[mediawiki/core@master] Unify handling of options messages

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

Change 579139 merged by jenkins-bot:
[mediawiki/core@master] Add expiry select field to action=watch

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

I just tried this out on the beta cluster (cool!) and filed T249866: Watchlist Expiry: Static Watch Page (action=watch) confirmation should note length [medium] regarding something I noticed. Hope that was okay

dom_walden subscribed.
  • Update the current action=watch page to accommodate temporarily watchlist as follows:
    • Change "Add this page to your watchlist?" to "Add this page to your watchlist:"

Says: "Add to watchlist"

action_watch.png (448×777 px, 21 KB)

  • Add a drop-down after "watchlist:" that includes:

Looks like:

action_watch_select.png (512×761 px, 25 KB)

  • Rename the button from Yes to Watch

Yep.

  • Pages should be watched according to time period selection from drop-down

Yep.

I have verified this by checking the value in the watchlist_expiry table.

You can update the expiry date and it gets changed in the database.

If I choose to watch permanently, it deletes the appropriate row in the watchlist_expiry table.

  • If a page has already been watched, the behavior should be:
    • Label at top should state: "Update watchlist"

Yep.

  • Label above drop-down should state: "Watchlisted for:"

Says: "Watchlist time period:"

  • Drop-down should have days left as pre-selected option at top
  • The selection should be written as follows: "X days left" (for example, "10 days left" or "20 days left").

Yep.

It often rounds down the number of days. So, for example, if you have less than 24 hours left on the expiry, it will say "0 days left".

Briefly retested with $wgWatchlistExpiry = false, to check that the action=watch looks and behaves the same as before.

We have also reorganised the code for other expiration dropdowns when protecting a page, blocking a user or changing a user's rights.

So, for regression, I retested the expiration select form on action=protect, Special:Block and Special:UserRights on testwiki (MediaWiki 1.35.0-wmf.27 (rMW33764fc2d5df) 12:34, 9 April 2020).

Checking the HTML is correct and the options in the select dropdown match what is in en.json (or whatever language of the wiki) or whatever the wiki has set in, for example, https://test.wikipedia.org/wiki/MediaWiki:Ipboptions.

Also briefly tested submitting forms to check that the expiration is correctly set in the DB.

Also briefly tested it on a non-English wiki, to check translations show. It is based on the language of the wiki, not the user.

ifried moved this task from Product sign-off to Done on the Community-Tech (Kanban-2019-20-Q4) board.

I have tested and it is working as expected (see screenshot example below). For this reason, I'm marking this as Done.

Screen Shot 2020-05-27 at 4.34.01 PM.png (440×1 px, 45 KB)