Improve autofill suggestions for usernames
As a maintainer I use autofill a lot for usernames when issuing slash-commands or reviewing merge requests. I think it could use a bit of improvement in this regard.
Right now it appears to prioritize any username which contains the query, followed by any names that match the query.
There are a lot of users/members for whom their name is not contained within their user handle. When I don't have their user handle memorized, I tend to type @
and then start typing their first name, hoping that it will come up in auto-complete. Often it does, but often it will be far down the list.
For example, @wortschi was a recent assignee for a MR I was working on, and when I went to re-assign it to him, this is what came up in autocomplete:
Sometimes the result I'm looking for is further down the list (especially if the person has a common name).
We have data that we can use to make this process a little bit more intelligent.
Because I tend to type people's first name (not some random string that's a subset of their handle), and because 90% of the time I'm going to @
-mention someone who is already a participant in the discussion, I think we could make some improvements. What if we used the following priorities:
- Users who are "participants" in the issue
- Users who are members of the project
- Users who are members of the project namespace/group
And within those, we should prioritize users who's username or name starts with the query string before users who's username or name contains the query string.
If we really wanted to make this smart, we could also use localStorage
to track commonly auto-completed handles and sort them higher in certain instances.
Done:
- The members autocomplete API response puts the participants at the top of the list
- Prioritize users who's username or name starts with the query string, so typing
@natalia
and@nte
both show@ntepluhina
at the top of the autocomplete menu
To do:
- Prioritize users over groups