Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watchlist preference, never add recentPage to the watchlist #300

Merged
merged 7 commits into from
Apr 16, 2024

Conversation

zanhecht
Copy link
Contributor

@zanhecht zanhecht commented Nov 7, 2023

There is no value to recentPage (Wikipedia:Articles for creation/recent) being added to the watchlist each time a draft is approved. In general it clutters up the watchlist, and reviewers who wish this page to be on their watchlist will have added it manually. This PR also adds a "Do not add pages to watchlist" preference which resolves #298

resolve array-bracket-spacing and space-in-parens
If the hidden (for now) noWatch preference is set, the watchlist parameter of the edit and move API calls will be set to 'nochange' (unless it is an edit request and the options.watchlist parameter is set to a valid value)
Add checkbox for "Do not add pages to watchlist"
@zanhecht zanhecht changed the title Don't add recentPage to the watchlist Add watchlist preference, never add recentPage to the watchlist Nov 8, 2023
Copy link
Contributor

@sohomdatta1 sohomdatta1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with the way the changes are being implemented here. The two cases here should not show up at all if the user does not check the "Add all pages I edit to my watchlist" checkbox in preferences.

Additionally, this patch does not solve #298 since this does modify the parameters to the movePage() function which is what is causing the article and associated talk page to be watchlisted (due to the on by default "Add pages and files I move to my watchlist" option in preferences)

@@ -651,6 +651,10 @@
request.minor = 'true';
}

if ( ['nochange', 'unwatch', 'watch'].includes(options.watchlist) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this preference being used here ? This in most cases does not trigger watchlisting unless the user explicitly watchlists all edits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because many users do opt to "Add pages and files I edit to my watchlist" since the mediawiki preferences don't have the granularity to specify things "only add all talk pages I edit" or "don't add tool edits". I'll admit that this line is more complicated than it necessarily needs to be at this point (this could be a boolean option between nochange and preferences), but I tend to prefer adding more flexibility to my code to allow easier expansion in the future.

src/modules/submissions.js Show resolved Hide resolved
@zanhecht
Copy link
Contributor Author

I'm a bit confused by your objections. Lots of users opt to have all pages that they edit added to their watchlist, but it's entirely feasible that they don't want automated edits from tools like this included, which is why the API allows overriding the preference. This doubly applies to bot-only pages like the /recent page, which I can't imagine anyone wanting to be watchlisted every time.

I'm also missing why this does not close #298, as #298 is explicitly about not adding pages to the watchlist despite what is set in Special:Preferences.

@sohomdatta1
Copy link
Contributor

I'm a bit confused by your objections. Lots of users opt to have all pages that they edit added to their watchlist, but it's entirely feasible that they don't want automated edits from tools like this included, which is why the API allows overriding the preference. This doubly applies to bot-only pages like the /recent page, which I can't imagine anyone wanting to be watchlisted every time.

My personal assumption would be that NPPers and AFC reviewers generally do not have this enabled since they go through multiple pages via the PageCuration toolbar/twinkle/AFCH etc. This seems like a really niche usecase to me.

However, I guess we could disable watchlisting anything and everything by default, though I am not a fan of the idea. (We should ideally use watchlist expiry here and watchlist a edited draft for x amount of days instead of just blanket not watchlisting everything).

I'm also missing why this does not close #298, as #298 is explicitly about not adding pages to the watchlist despite what is set in Special:Preferences.

As I mentioned, #298 revolves around accepting a draft which would require that the draft be moved to mainspace (which is a different API from the normal edit API that you are modifying here).

@sohomdatta1
Copy link
Contributor

I'm also missing why this does not close #298, as #298 is explicitly about not adding pages to the watchlist despite what is set in Special:Preferences.

As I mentioned, #298 revolves around accepting a draft which would require that the draft be moved to mainspace (which is a different API from the normal edit API that you are modifying here).

Actually scratch that, it looks like I missed some parts of the code while reviewing this appears to solve the issue :)

@NovemLinguae
Copy link
Member

I'm able to reproduce the original bug on testwiki using the steps to reproduce in #298. But my Special:Preferences "Add pages and files I move to my watchlist" preference is unticked, and a search of the codebase for the word "watch" has zero hits, so I am a bit confused as to what code or workflow is actually adding these pages to the watchlist and causing the bug. Any thoughts on that @zanhecht or @sohomdatta1 ?

@NovemLinguae
Copy link
Member

OK, I finally wrapped my head around this one. Looks good. Tested, works. Thanks for the patch!

@NovemLinguae NovemLinguae merged commit d79ffdf into wikimedia-gadgets:master Apr 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an AFCH preference to turn off auto watchlisting
3 participants