Page MenuHomePhabricator

Allow users to set their default watchlist item expiry time
Closed, ResolvedPublic5 Estimated Story PointsFeature

Description

Background

Expiring-Watchlist-Items brought the ability to temporarily watch pages and files, instead of only having the option to watch indefinitely.

Repeatedly since that feature was deployed in 2020, users have asked for the ability to set default watchlist expiries, in particular for watching in general (via watch star) and when performing rollback.

Acceptance criteria

  • Special:Preferences (under "Watchlist") should have a "Default time period" dropdown for:
    • Manually watching (Default time period to watch a page that I manually add to my watchlist)
    • Add pages and files I edit to my watchlist
    • Add pages I create and files I upload to my watchlist
    • Add pages where I have performed a rollback to my watchlist
  • The preferred expiry should be pre-selected when:
    • Using the watch star (aka manually watching)
    • Editing a page (either wikitext or VisualEditor)
    • Using the action=watch page
  • If a page is already watched, we use the existing expiry and not the preference, even if the preference is longer.
  • Actions made through the Action API should also follow the same rules when the watchlist parameter is set with either preferences (default) or watch
    • If the watchlistexpiry parameter is used, that takes precedence over the preferred expiry
  • All of the above is true only if $wgWatchlistExpiry is also true.

Details

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Indentation seems better (at least for now!).

@MusikAnimal Do you know if we will still want to keep this in "Needs Attention"?

@KSiebert @MusikAnimal I'd still really appreciate a look from CommTech - it really should not take an experienced MediaWiki developer more than a couple of hours, and will help tick off another Community Wishlist item.

My apologies for this taking so long… as I recall, it was more or less finished before I started to question some things architecturally, and then I simply ran out of time. I may be able to squeeze this into the Wikimedia Wishathon next week, or at least find someone to adopt it :) Someone asked about this missing feature over at WP:VPT on enwiki a few weeks back, so I feel motivated.

Sorry, I missed this at the time, can you advice someone on the team how to do it, as you are busy.

MusikAnimal renamed this task from Allow configurable default expiry time etc. to Allow configurable default expiry time.Dec 13 2023, 6:23 PM
MusikAnimal updated the task description. (Show Details)

From the sound of it, none of us here seem to have strong feelings, so I hope it's alright to stick to essentially:

  • if user is watching the page for the first time, defer to the preference
  • if user is already watching the page, respect the existing expiry – always

While sure, most wouldn't complain about watching for too long when all they had was "indefinite" before watchlist expiry came about. However, it just feels safe to me at least for this first iteration to refrain from any sort of auto-changes. There's little harm in shipping this as-is, and we can collect feedback and change the logic accordingly (PS18 for reference).

Outstanding issues as of the time of writing:

  • Watching via watch star doesn't use preferred expiry
    • This one is pretty tricky. In JS, we can get the preferred expiry but it is returned as a value acceptable only by strtotime(), which doesn't exist in JS. So we need to somehow run the user-preferred expiry through ExpiryDef::normalizeExpiry()
  • Action API doesn't respect user preferences
  • The patch doesn't add expiry preferences for file uploads, moving pages/files, and deleting pages/files. I'm going to save that for a follow-up patch, if there's demand for it.

I'm working on the above and hope to finish it this week (for MediaWiki CodeJam Dec 2023).

Will the changes cover calls by apps like AutoWikiBrowser, like when I set it to "Use MW preferences" for determining if a page I change is watched?

Also, I realize this isn't likely the best place to request this, but could we get a 3 day (72 hour) option for watches? A week seems too long for watches after casual edits.

Will the changes cover calls by apps like AutoWikiBrowser, like when I set it to "Use MW preferences" for determining if a page I change is watched?

AWB and other clients use the Action API, so unless something other than preferences (default) or watch is passed in the API call, or it passes in an explicit value for watchlistexpiry, it will go by the user preference.

Also, I realize this isn't likely the best place to request this, but could we get a 3 day (72 hour) option for watches? A week seems too long for watches after casual edits.

Seems reasonable, but does need a separate task/discussion. Note your wiki as a community can change the options now by editing MediaWiki:Watchlist-expiry-options (enwiki example).

Update: I was able to fix the watchstar sort of, but that code still needs to be cleaned up.

The bigger issues is adding support into the API. I'd rather not just "hack" it in there, so some refactoring will need to be done first. I'm going to do that as a separate patch.

TL;DR: I won't finish this this week as I had hoped. I very much underestimated the amount of work that there was left. But at any rate, I'm still committed and will be chipping away at this task until it's done! :)

Jdforrester-WMF renamed this task from Allow configurable default expiry time to Allow users to set their default watchlist item expiry time.Apr 27 2024, 9:27 PM
Kgraessle set the point value for this task to 5.May 13 2025, 3:21 PM
Kgraessle moved this task from To be estimated to Estimated on the Moderator-Tools-Team board.
DMburugu raised the priority of this task from Low to Medium.May 13 2025, 4:12 PM
Kgraessle moved this task from In Progress to Ready on the Moderator-Tools-Team (Kanban) board.
Kgraessle subscribed.
Scardenasmolinar changed the task status from Open to In Progress.May 20 2025, 2:49 PM
Scardenasmolinar claimed this task.
Scardenasmolinar moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

I'm thrilled to see this get was picked up again! Ironically I'm participating in an internal Wikimedia Wishathon right now and I had considered picking this task, since it was a "leftover" from previous Wishathons.

Anyway, please feel free to contribute directly to r789321. I don't care about attribution to me but I'd prefer if @TTO is set as the patch "author" (go to Edit at the top-right and you can change the "Author" on the left). I just want volunteer contributions to remain in the git history :)

I'll happily assist with code review. I should see any activity on my Gerrit dashboard, but please add/ping me if you don't hear from me.

I've now rebased r789321 and all tests passing, so it should be easier to pick up now. Revisiting again, I don't recall what problems I had with it. I think overall it looks fine… but I'm likely forgetting something! Some fresh eyes on it would surely be good.

Anyways, have at it. It would be amazing to finally resolve this – almost exactly 3 years after TTO uploaded PS1 :)

Change #789321 merged by jenkins-bot:

[mediawiki/core@master] watchlist: Allow configurable default watchlist expiry

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

What are folks' thoughts on whether this is worth an entry in Tech/News (User-notice)? IMO it might be, as a feature enhancement that many editors might be interested in using, but interested about what other people think here :)

Absolutely TechNews-worthy! :)

I have added an entry in the upcoming issue. I have also updated the documentation at Help:Watchlist expiry on mediawiki.org. Please feel free to edit either.

I’ve set the default duration for manual watchlisting to indefinite, and the default duration for edited page watchlisting to one month. When editing a page that was already watchlisted indefinitely, the duration was shortened to one month. The behavior I want is that longer duration is prioritized, not later action’s. (I’ve make the same post on mw:Help talk:Watchlist expiry)

I’ve set the default duration for manual watchlisting to indefinite, and the default duration for edited page watchlisting to one month. When editing a page that was already watchlisted indefinitely, the duration was shortened to one month. The behavior I want is that longer duration is prioritized, not later action’s. (I’ve make the same post on mw:Help talk:Watchlist expiry)

It occurs by DiscussionTools or mobile edit.

jsn.sherman moved this task from QA to Done on the Moderator-Tools-Team (Kanban) board.
jsn.sherman subscribed.

I think the correct solution is probably to set the dropdown value to the current expiry when the page is already on your watchlist. I'm creating a separate task for this issue (T397226: Preserve existing watchlist expiry on page edit) and marking this task as resolved.