Page MenuHomePhabricator

Prevent "reply" link from showing in certain sections
Closed, ResolvedPublic

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 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

Related Objects

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

The opposite of this (force the reply tool to appear, even if it's in the "wrong" namespace) has also been requested.

The opposite of this (force the reply tool to appear, even if it's in the "wrong" namespace) has also been requested.

That request is talking about the "subscribe" feature being available under headings other than <h2>, not the reply tool. The reply tool can be enabled in the "wrong" namespace by using the __NEWSECTIONLINK__ magic word.

Support. I have a template used on talk pages that has a date in it (~~~~~) and it is receiving a [ reply ] button. Having some way to suppress this would be useful. Even if it is as simple as adding a class somewhere.

https://en.wikipedia.org/w/index.php?title=Template:NPP_backlog&oldid=1102444284

For now, this is also achievable through CSS/TemplateStyles: https://ru.wikipedia.org/?diff=125047246&oldid=119611147 (I plan to remove the CSS in question if something more generic comes up, but I think it does the job well enough for now)

Novem_Linguae renamed this task from Prevent reply link from showing in certain sections to Prevent "reply" link from showing in certain sections.Sep 17 2022, 8:43 PM

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

[mediawiki/extensions/DiscussionTools@master] Support suppressing comment detection in pages or sections

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

For now, this is also achievable through CSS/TemplateStyles: https://ru.wikipedia.org/?diff=125047246&oldid=119611147 (I plan to remove the CSS in question if something more generic comes up, but I think it does the job well enough for now)

Note this only works when the talk page is wrapped in an archiving <div>. On en.wiki where an entire page is moved to an archive with just a header but no wrapper, we would need the magic word approach.

Change 738221 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Support hiding reply links in archived pages or sections

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

Change 903247 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Support suppressing comment detection in pages or sections

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

I documented all of the new features (and some pre-existing features) at https://www.mediawiki.org/wiki/Help:DiscussionTools/Magic_words_and_markup. Review and improvements appreciated!

They will be available on Wikimedia wikis this week with the weekly train deployment, and were already announced in Tech News (https://meta.wikimedia.org/wiki/Tech/News/2023/14).

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

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