Page MenuHomePhabricator

Add support for subsection subscriptions
Open, Needs TriagePublic

Description

As they are currently implemented, topic subscriptions (T263820) enable people to subscribe to all of the new activity that happens within a H2 level section.

This task is about enabling people to have more control over the new activity they are notified about by enabling them to subscribe to specific subsections. [i]

Open questions

  • If you subscribe to a section, should a new comment in a subsection of that section trigger a notification? If yes, this makes it impossible to get notified about comments only in the first chunk of the section (its content before the first subsection).
  • 2. What happens if you reply in a subsection (=== ===) with Reply Tool and "Subscribe to section" is checked, do you subscribe to the subsection or the parent section?
  • 3. In the same situation, what if you're subscribed to a section and want to unsubscribe? If you answered "subsection" to the previous question, you won't be able to do it from the comment form.
  • 4. And if you want to subscribe to the subsection instead, there would be a duplication which may seem unnecessary. Also, if you're subscribed both to a section and its subsection and then unsubscribe from a subsection, the user should get some alert that they still watch the subsection via the section. Probably the other way around too.

Thank you to @Jack_who_built_the_house who inspired us to file this task and shared the questions above in the comment they posted on mediawiki.org here: https://w.wiki/32qu.

Community wishlist 2023 request: https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/Notifications,_Watchlists_and_Talk_Pages/Enabling_subscribe_action_for_lower_headers_for_specific_pages_(prefix)


i. https://en.wikipedia.org/wiki/Help:Section#Subsections

Event Timeline

TfD sections are actually h4, but I agree that this would be very useful and much needed as subscribing to the h2 on these pages just isn't a valid option.

The daily logs for discussions on templates, files, categories, redirects and In the News, all have the individual discussions at H4, not H3 as stated by Novem_Linguae. It is the date heading that is at H3 and there is no H2 heading at all. The headings are like this because the daily logs (at least the ones still active) are transcluded on to the parent page under a H2 heading. Requests for page protection are at H3 as stated.

Deletion review daily logs do not have the individual discussion under headings at all. They are just bulleted. The number of individual discussions is very low - probably averaging less than one per day. There is not a big need to subscribe to individual discussions on that one so I suggest removing it from consideration here.

On the "open questions", if one subscribes to a H2 section, isn't it already the case that you will be notified of comments in a H3 section below it? I've never actually tested it, just assumend that's how it works. So of course if H3 subscriptions were introduced then daughter H4 comments should also be notified.

On the second question, if one replies to a H3 section with subscribe ticked, it would be nonsense to automatically subscribe to H2. That would entirely defeat the purpose of subsection subscription.

On the fourth question, give users some credit that they know what they are doing. We don't need more annoying pop-up alerts that we might be doing something wriong.

Anyone know the original reason for only putting [subscription] on H2 headings? Is there a technical reason for not putting them on H3, H4, etc? Or is it an easy patch?

  1. If you subscribe to a section, should a new comment in a subsection of that section trigger a notification? If yes, this makes it impossible to get notified about comments only in the first chunk of the section (its content before the first subsection).

I'd suggest yes. A section should always monitor its sub-sections.

  1. What happens if you reply in a subsection (=== ===) with Reply Tool and "Subscribe to section" is checked, do you subscribe to the subsection or the parent section?

I'd suggest subscribing to the child section, not the parent H2.

  1. In the same situation, what if you're subscribed to a section and want to unsubscribe? If you answered "subsection" to the previous question, you won't be able to do it from the comment form.

I don't understand this one. I'd suggest having an unsubscribe button in headers always unsubscribe just that section, and not unsubscribe any sections above or below it.

  1. And if you want to subscribe to the subsection instead, there would be a duplication which may seem unnecessary. Also, if you're subscribed both to a section and its subsection and then unsubscribe from a subsection, the user should get some alert that they still watch the subsection via the section. Probably the other way around too.

I'd suggest that overlapping subscriptions should be allowed, and that the user should not be alerted to this situation. Hypothetically if overlapping subscriptions are allowed, code should be modified somewhere to make sure that only one notification per page is generated even if one comment technically affects 2 or more sections.

Anyone know the original reason for only putting [subscription] on H2 headings? Is there a technical reason for not putting them on H3, H4, etc? Or is it an easy patch?

If there's a technical reason, T303541 would be a solution, otherwise let users subscribe to them.

I spent a couple hours on this today. Got DiscussionTools working in my localhost dev environment, took a peek at the discussiontools_subscription table in SQL, took a peek at the APIs, and updated some documentation.

My idea is to patch the following 3 things:

  • Show [subscribe]/[unsubscribe] for subheadings
    • The code that adds the [subscribe]/[unsubscribe] button is currently mixed in with the code that adds the topic container, so will need to be extracted out.
  • discussiontoolssubscribe API should accept subheadings
  • edit page hook should look for subheading subscriptions when deciding when to give notifications

I don't think any changes would be needed on the database side, or to Special:TopicSubscriptions.

My implementation idea is to have an H2 subscription monitor everything below it including subheadings. Then an H3 subscription would monitor everything below it including subheadings. etc. Overlapping subscriptions would be allowed. I think this would be simplest, and would not change any existing H2 subscription behavior that users are used to. If a user double subscribes and gets two notifications, at least for now in a MVP patch, they would get double notified.

To be continued...

Change 985372 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/extensions/DiscussionTools@master] Refactor CommentFormatter->addTopicContainer()

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

Change 985372 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Refactor CommentFormatter->addTopicContainer()

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