Page MenuHomePhabricator

Prevent reply link from showing in certain sections
Open, Needs TriagePublic

Description

T249293 is about hiding reply links on the entire page, this task is about hiding reply links in specific sections.

There are two categories of things we want to hide reply links one:

  1. Things that are comments, but we don't want people to reply to any more (e.g. closed/archived discussion)
  2. Things are have signatures but aren't comments (e.g. vote/participation lists)

These should be dealt with slightly differently as in (1) we still want to comment parser to detect them, e.g. for permalinking or computing thread metadata (# of comments in a thread). In (2) we don't want the parser to recognise the comments at all.

Approaches

  • Define wrapper classes for (1) and (2) which result in reply links being suppressed / signatures being skipped.

Use cases

Event Timeline

I would suggest we use the mw- prefix for the classes, as this can be a standard used by any talk page extension/gadget (as opposed to an ext-discussiontools- prefix).
For example:

  • Type 1: mw-archivedtalk
  • Type 2: mw-notalk

Here is a visualisation of how these classes affect the page differently:

image.png (380×660 px, 50 KB)

In the case of mw-archivedtalk the Comment Parser still detects the comments, but the reply links are suppressed. (As in T249293, the behaviour of [(un)subscribe] links can be decided at a later date)
In the case of mw-notalk the "comments" become completely invisible to the parser. There is no subscribe link or notifications because the parser considered there to be no comments in that section.

One thing that could be confusing for users is if they write a comment inside one of these sections using the full page editor, especially if these classes were included via a template. They may be surprised to see that no one can use the reply tool to reply to their comment after saving.

Change 738221 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] [POC] Support classes for hiding reply links and suppressing comment detection

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

Test wiki created on Patch Demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/b286d11415/w/

In the case of mw-notalk the "comments" become completely invisible to the parser. There is no subscribe link or notifications because the parser considered there to be no comments in that section.

This would be very useful in a section that contained a mixture of discussion and voting:

== Topic  (h2) ==
My thoughts. ~~~~
: Reply. ~~~~

=== Vote section (h3) ===
# ~~~~
# ~~~~

At the moment, every vote is parsed as a comment, so someone who wanted to subscribe to "Topic (h2)" would get a notification every time someone voted. If the vote section was wrapped in mw-notalk that would solve this problem.

== Topic  (h2) ==
My thoughts. ~~~~
: Reply. ~~~~

=== Vote section (h3) ===
<div class="mw-notalk">
# ~~~~
# ~~~~
</div>

Demo: https://patchdemo.wmflabs.org/wikis/b286d11415/wiki/Talk:Main_Page#Mixed_discussion_&_vote