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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/modules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

request.watchlist = options.watchlist;
}

// Depending on mode, set appendtext=text or prependtext=text,
// which overrides the default text option
if ( options.mode ) {
Expand Down