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 >=1 to //any// Wikimedia wiki
-- The specific characters someone has typed after {key @}.
=== 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?
-- //@Esanders to investigate this.//
=== 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 {key @} + {key 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