Page MenuHomePhabricator

Enhance mention notifications with DiscussionTools (link directly to the comment and highlight it)
Closed, ResolvedPublic

Description

On desktop or mobile...

  1. Click the notifications icon ("🔔")
  2. Select an @ mention from within the "Alerts" drawer [i.]

Current behavior

  1. The page is scrolled to the section your comment appeared in
    • Trouble is, on pages/sections with lots of comments, it can be difficult to identify the precise comment you were mentioned in [ii.]

Desired behavior

  1. The page is scrolled such that the comment you were mentioned in is visible in the viewport and you can easily locate the precise comment you were mentioned in.
    • Flow solves this by presenting a vertical blue bar to highlight the comment you were mentioned in. [iii]
    • It would also be nice if this happened regardless of the tool/interface used to draft it.

Open questions

  • 1. If we generate our own notifications, how do we avoid duplicate notifications being sent by two systems: DiscussionTools and Echo's DiscussionParser which looks every diff?
  • 2. How might we technically be able to support this functionality regardless of the the tool/interface used to draft the comment-triggering notification.

i. Alerts "drawer"
Screen Shot 2020-05-18 at 5.01.08 PM.png (874×1 px, 156 KB)
ii. Section scroll
Screen Shot 2020-05-18 at 5.01.21 PM.png (2×1 px, 749 KB)
iii. Flow's approach
Screen Shot 2020-05-18 at 5.10.53 PM.png (772×1 px, 334 KB)

Related Objects

Event Timeline

Notes
Adding some notes from the conversation @Esanders and I had today about this.

  • It is possible to achieve the behavior this task is describing [i]; however, to achieve this behavior for comments posted with and without DiscussionTools, additional logic would need to be added to create/identify the boundaries of comments posted not posted using DiscussionTool feautres.
    • This "additional logic" is likely now easier to implement now that we we've moved the comment parser code to the server; see: T252252.
  • A question remains: "How do we avoid duplicate notifications being sent between two systems (Echo and this to-be written DiscussionTools system)?" [ii.]

i. When someone clicks on a notification, they will be taken to the precise place on the page where that comment-triggering-content exists and that comment-triggering-content could be highlighted/visually accentuated to make it easy for people to notice/identify.
ii. This has been added to the task description under the "Open questions" heading.

ppelberg updated the task description. (Show Details)
Esanders renamed this task from Directly relate a mention in the "Alert" drawer to the mention on the page itself to Take the users to the exact location of the comment when clicking on a mention notification.May 27 2020, 12:58 PM
Esanders added a project: Notifications.
Esanders updated the task description. (Show Details)

Another issue that occurs when there is only partial adoption of DiscussionTools is that if a user who doesn't have DT enabled gets a notification, it may not be possible for us to scroll them to the correct part of the page, as finding the comment requires DT.

As we move from just adding reply links to adding more features like notifications, we need to think about what it means for an individual user to disable discussion tools. Should it even be possible to disable the notification parts of DT, or should the disable just apply to the reply widget? (probably the latter)

As we move from just adding reply links to adding more features like notifications, we need to think about what it means for an individual user to disable discussion tools. Should it even be possible to disable the notification parts of DT, or should the disable just apply to the reply widget? (probably the latter).

Great spot, Ed; here's a ticket for us to take up this question: T265319 (I need to fill in some more details).

This has already been mostly done with the patch on T265268 ("page is scrolled such that the comment you were mentioned in is visible"), and T281471 implements the remaining part ("you can easily locate the precise comment you were mentioned in").

matmarex renamed this task from Take the users to the exact location of the comment when clicking on a mention notification to Enhance mention notifications with DiscussionTools (display a snippet, link directly to the comment and highlight it).Jun 2 2021, 9:05 PM
In T253082#7130581, @matmarex renamed this task from Take the users to the exact location of the comment when clicking on a mention notification to Enhance mention notifications with DiscussionTools (display a snippet, link directly to the comment and highlight it).

The snippet is already there, see the below screenshot. I can imagine that it could be improved in some edge cases, but then that should be stated in the task title, not adding.

Screenshot_2021-06-02 Figyelőlistám – MediaWiki.png (119×488 px, 22 KB)

matmarex renamed this task from Enhance mention notifications with DiscussionTools (display a snippet, link directly to the comment and highlight it) to Enhance mention notifications with DiscussionTools (link directly to the comment and highlight it).Jun 2 2021, 10:18 PM

Thanks, you're right of course, I copied the title from T281590 without thinking.

Change 683930 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Enhance Echo user talk edit and mention notifs

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

Change 705771 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Add test cases for interactions with events generated by base Echo

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

Change 705771 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Test cases for interactions with events generated by base Echo

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

Change 683930 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Enhance Echo user talk edit and mention notifications

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