User mention search should prioritize users with access to the current category

AI-generated summary

In a UX-focused discussion titled ‘User mention search should prioritize users with access to the current category,’ Falco proposes that when using @username in a restricted category, the mention dropdown should prioritize users who have access to that category — and optionally, more active members. codinghorror counters that the list should instead prioritize users active in the current topic, then globally frequent posters — though he admits this logic may have regressed. He suspects a bug related to matching real names vs. usernames codinghorror, noting that typing @arpit shouldn’t omit @techAPJ while surfacing inactive users. Stephen questions whether global poster frequency should be time-bound to avoid outdated dominance. sam clarifies the current logic: 1) exact username match, 2) users in the current topic, 3) sorted by last seen — and agrees with Falco’s suggestion to add group access scoping. codinghorror disputes the last-seen logic, calling it implausible, and reiterates the real-name vs. username bug. He later questions whether expecting real-name matches to work well is realistic codinghorror, suggesting users should match usernames (e.g., techapj). sam explains the current SQL ordering favors username matches unconditionally, warning that changing it might create new issues. codinghorror remains skeptical of prioritizing real-name matches, asking why users can’t recall usernames. tophee defends real-name use, noting some usernames are hard to remember — highlighting a usability tension between technical logic and user behavior.

If I’m writing a post in a category where only some users have access, the mention search (@username) should list users with access to the category first.

I would go as far that it should prioritize more active members too, when a full match happens anywhere.

Eg:

Typing @arpit and none of the options contain @techAPJ, while showing users that doesn’t visit in years, have zero posts, etc.

8 Likes

This is a deeper problem since that list should be ordered by total post count, I would think @sam .. did we regress here?

As I recall the sort order was

  • prioritize people in the current topic

and that is good and proper.. but after that it should be

  • prioritize most frequent posters (globally)

I don’t think it needs to be so sophisticated as to factor in specific categories and permissions etc.

2 Likes

I suspect this might also be a bug based on matching on “real name” versus “username” @Falco

1 Like

Is there any time window on this? I would hate to see a prolific poster who leaves a community permanently dominate a search.

1 Like

The current priority is

  1. exact match
  2. in the topic
  3. order by last seen

Most frequent poster was never done.

I do agree with the OP though it would be nice if #3 here was “in list of groups that have access to this topic”

2 Likes

I don’t think this is right.. so you’re saying in this list..

all those “arpits” were “last seen” before our Arpit? I don’t think so, my friend.. that does not even pass the :nose: test.

I’m pretty sure it’s what I said it was

1 Like

Maybe the expectation that you can type real name and get decent results is just an unrealistic one? You have to at least match part of the username for this to work, e.g. techapj versus arpit

The scoping is done with this order if the site setting 'enable_name?` is enabled like it is here:

order(DB.sql_fragment("CASE WHEN username_lower LIKE ? THEN 0 ELSE 1 END ASC", @term_like))

So we get:

ORDER BY CASE WHEN username_lower LIKE 'arpit%' THEN 0 ELSE 1 END ASC, last_seen_at DESC LIMIT 19

This means username matches are unconditionally first.

We could change this I guess, but I worry that this will lead to a reverse problem.

4 Likes

I dunno @falco I have very mixed feelings about this.. you’re basically saying that real name matches should have high priority. Is there any reason you couldn’t remember it was techapj and not arpit?

3 Likes

I don’t know about Falco and techarp but I often have to resort to real names because, well, some usernames are just not that easy to remember…

1 Like