Page MenuHomePhabricator

Constrain DT's username suggestion list results to people who have edited before
Closed, ResolvedPublic

Description

This task involves the work with constraining what usernames are shown with Discussiontools's username suggestion list (T232601).

Story

As someone who is wanting to get the attention of another person, whose username I know and who has not yet commented in the discussion I am drafting a comment within/starting, I want to be able to quickly insert a ping, so that I can get back to drafting the comment I was in the middle of writing.

Requirements

  • Constrain the results that appear within Discussiontools's username suggestion list (T232601) such that only the following appears within it:
    • The usernames of people who have published at least 1 edit on the current wiki
    • The specific characters someone has typed after @.

Open questions

  • 1. Is the auwitheditsonly list global (read: it contains the usernames of all accounts, across all Wikimedia wikis)? Is the list local (read: it contains the usernames of all accounts, from within the particular Wikimedia wiki the list is being "called" on)? Something else?

Minimum Test Case

  1. Visit a page where the Reply and New Discussion Tools are available. E.g. https://en.wikipedia.beta.wmflabs.org/wiki/Talk:Cats .
  2. Open the Reply or New Discussion Tool
  3. Type @ + A
  4. Select 3 usernames that appear within the username suggestion list (T232601) that have NOT previously published a comment on the talk page you are viewing
  5. Verify that each of the usernames you selected in "Step 4." has published at least 1 edit

Done

  • ===Requirements are implemented
  • Answers to the ===Open questions are documented
  • Review mediawiki.org and Phabricator for issues related to this change prior to marking this ticket as resolved.

Background + Approaches

Background
On WMF wikis there are thousands of users, so the username auto-complete is not particularly useful, especially when only a few letters have been typed. Most accounts are inactive on that particular wiki, or blocked spam accounts.

Approaches
I suggest we filter out more accounts from the results as allowed by the API. This will not prevent you from mentioning these users, it will just not suggest them if they are not already on the page (usernames already on the page are always searched).

  • auwitheditsonly - Only lists users who have made edits (to any namespace)
  • auactiveusers - Only list users active in the last 30 days [1]
  • Only start searching once more letters have been typed. Currently we start searching the API even if only one letter is typed.
    • Note: Some thought is required about the workflow here. It will not be true on all IMEs that as the user starts typing '@username', the characters '@us...' are immediately available to us. Sometimes the IME will only actually start inserting text into the document when the user has completed their word. At the very least, we may need an alternative affordance so that users of such IMEs have a way to activate the search. Via @dchan

  1. need to check how "active" is defined

Event Timeline

Looking at auactiveusers it appears to be not very reliable, or completely broken as "Matma Rex" is not listed, despite him definitely being active on en.wiki in the last 30 days:

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=allusers&formatversion=2&aufrom=Matma%20Rex&auactiveusers=1

Filed as T294778

Only start searching once more letters have been typed. Currently we start searching the API even if only one letter is typed.

I think this would be sensible for all WMF wikis, but we may want to keep the lower character search prefix for 3rd parties, which means creating a new config (sigh).

ppelberg renamed this task from Consider showing fewer suggestions in username autocomplete to Constrain DT's username suggestion list results to people who have edited before.Dec 22 2021, 7:14 PM
ppelberg subscribed.

Meta
As an outcome of today's team meeting, I've added the sections below to the task description. This is now ready to be worked on.

New task description section

  • ===Requirements
  • ===Open questions
  • === Done

I've confirmed experimentally that auwitheditsonly only checks edits on the local wiki. I think this still makes sense as a feature - you are unlikely to want to mention someone who has never edited on a specific wiki.

I've confirmed experimentally that auwitheditsonly only checks edits on the local wiki.

Understood.

I think this still makes sense as a feature - you are unlikely to want to mention someone who has never edited on a specific wiki.

+1. To verify this constraint isn't unhelpfully limiting, I've added a step within the ===Done section to remind us to review mediawiki.org and Phabricator for issues related to this change prior to marking this ticket as resolved.

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

[mediawiki/extensions/DiscussionTools@master] Filter username suggestions to accounts with edits

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

ppelberg updated the task description. (Show Details)

Change 749596 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Filter username suggestions to accounts with edits

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

ppelberg claimed this task.