Page MenuHomePhabricator

Do not show "self" in username suggestion list
Closed, ResolvedPublic

Description

This task is about adjusting the behavior of DiscussionTool's username suggestion list such that "your username" does not appear when you type @. Details in ===Behavior below.

Thank you to @Ladsgroup for identifying and reporting this issue. More context: https://www.mediawiki.org/wiki/Topic:Vxi0ig116xkw0ngp

Behavior

  1. On a wiki where you are able to use the Reply Tool, navigate to a page that contains a conversation that you've participated in. E.g. https://fr.wikipedia.org/wiki/Discussion_Projet:Outils_de_discussion
  2. Click a [ reply ] link in a section that you've already commented in. //E.g. https://fr.wikipedia.org/wiki/Discussion_Projet:Outils_de_discussion#Test_by_code//
  3. Enter the tool's visual mode (if you're not already there)
  4. Type @
  5. Notice the username suggestion list appears

Actual

  1. ❗️Notice the username suggestion list is populated with the usernames of people who have published comments in the section you are replying in, INCLUDING your own username [i]

Expected

  1. ✅ Notice the username suggestion list is populated with the usernames of people who have published comments in the section you are replying in, EXCLUDING your own username

NB: If you start searching for a user by typing letters after @ then your own username will be included in those search results.

Done

  • "Expected" behavior is implemented

Screen Shot 2020-11-10 at 12.09.34 PM.png (2×1 px, 707 KB)

Event Timeline

Esanders added a subscriber: Esanders.

I've looked at a few other tools that do @-mentioning, and they all allow you to mention yourself:

  • Phabriactor
  • Twitter
  • Facebook
  • GitHub
  • Flow

I agree that mentioning yourself is probably not often useful, but it also doesn't seem that problematic either, and there may be some edge case where it is useful.

We may also want to consider these cases separately:

  1. This list that is shown when you initially type '@' with no search filter (currently everyone in the "thread")
  2. Search results including API results when you start typing

The tools above which use an initial list (1) seem to include yourself, but that doesn't necessarily mean it's the right thing to do. Whatever we do we should probably keep the option to mention yourself via (2) for edge cases.

We may also want to consider these cases separately:

  1. This list that is shown when you initially type '@' with no search filter (currently everyone in the "thread")
  2. Search results including API results when you start typing

The tools above which use an initial list (1) seem to include yourself, but that doesn't necessarily mean it's the right thing to do. Whatever we do we should probably keep the option to mention yourself via (2) for edge cases.

Agreed. Let's suppress "your" username from appearing in (1) [i] and keep case (2) in tact such that your username will appear in the username suggestion list when you start typing.

I've updated the task description to reflect the above.

Meta: I'm now coming to see how the word "never" in the description [ii] [inaccurately] suggested I meant suppressing your username from appearing within the username suggestion list in all cases.


i. "This list that is shown when you initially type '@' with no search filter (currently everyone in the "thread")."
ii. "...is leading to adjusting the behavior of DiscussionTool's username suggestion list such that "your username" never appears within it."

Change 641273 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] Don't include the logged in user in local suggestions

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

Change 641273 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Don't include the logged in user in local suggestions

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