Page MenuHomePhabricator

Subscribe the reviewer to any talk page discussions started due to their inputs
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where): The PageCuration toolbar creates discussions on the article's and the creator's talk pages, if feedback is left by the reviewer. The reviewer is not currently subscribed to these discussions and doesn't know if there is a reply to any of these. Automatically subscribing the reviewer to these discussion/s seems useful.

The discussiontoolsedit API can be used for this, replacing the normal edit api to add a new topic to a user/article talk page.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

Benefits (why should this be implemented?): Page creators will not feel ignored when they reply to any concerns that are pointed out by a reviewer.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Good idea. Technical note: probably need to code this so that 3 conditions are met before trying to subscribe the user:

Looks like there's an API for this mentioned above. Maybe we can just use that.

kostajh subscribed.

There's a similar use case in GrowthExperiments, with mentorship discussions (T272146: Automatically ping newcomers when their question has been answered). The DiscussionTools subscribe API is marked as internal, so we'd want to get some clarification about whether it is OK to use it. (I've added the DiscussionTools tag so we can discuss with Editing-team engineers.)

Technical note: probably need to code this so that 3 conditions are met before trying to subscribe the user:

I think the first condition can be implicitly assumed if the second is met – topic subscriptions should not be enabled if they don’t work.

We technically support this via the DiscussionToolsAutoTopicSubEditor config. It's set to discussiontoolsapi by default, which restricts it to only doing auto-subscription for edits made through the API, but if it's set to any then it'll auto-subscribe to anything that triggers our new-comment detection.

(In fact, if we ever want to make that config change, it'd be good to avoid having other people manually creating subscriptions via the API, since that'll be a bit of a confusing doubling-up factor.)

We technically support this via the DiscussionToolsAutoTopicSubEditor config. It's set to discussiontoolsapi by default, which restricts it to only doing auto-subscription for edits made through the API, but if it's set to any then it'll auto-subscribe to anything that triggers our new-comment detection.

It looks like if the discussiontoolsapi (where available) is used to post a new talk page topic, the user should automatically be subscribed to that topic. We should do that when the discussiontools APIs stop being marked as 'Internal' T329474: Figure out why discussiontoolssubscribe API is marked as internal.

The internal-only tag for discussiontoolsedit api was removed. This ticket is now unstalled.

Suggestions from Chlod regarding a way in JS to figure out if a particular extension has been installed:

could check if DT's JS module (ext.discussionTools.init) is "registered" with mw.loader.getState("ext.discussionTools.init"); it'll be null if DT isn't present
there's also other ext.discussionTools.* modules that you can test for
this might be worth checking on the backend side instead, though, and fed into mw.config, considering that there's an additional requirement: topic subscription is enabled, both on-wiki and for the user

I recently wrote a patch to do this in the AFC helper script (enwiki gadget). It's pretty easy. The key thing is, in the action API, to change from using the edit action to the discussiontoolsedit action, and to set the parameters to something like this:

request = {
	action: 'discussiontoolsedit',
	paction: 'addtopic',
	page: pagename,
	sectiontitle: '',
	wikitext: options.contents.trim(),
	summary: options.summary + AFCH.consts.summaryAd,
	autosubscribe: 'yes'
};

We should give some thought to if we want to put this behind a preference or not, and if that preference should default to off or on. I chose to do a preference and default it to off in the AFC helper script gadget, but they don't like major changes to their software. We might be able to be a little more experimental in PageTriage.

Does PageTriage have a preferences screen? Might need to add one at some point.

We should give some thought to if we want to put this behind a preference or not, and if that preference should default to off or on.

Or we can let the user's preference for auto-subscription (Special:Preferences#mw-prefsection-editing->Automatically subscribe to topics) stand.

Does PageTriage have a preferences screen? Might need to add one at some point.

Nope, but there is a ticket T321535: Create a user preferences page/dialog for Page Triage

Quirks of the discussiontoolsedit API:

  • will not follow redirects
  • - will double sign if you create a new page in the format {{Template}} == Heading == {{Template}}