UX: Add special case for user search when in a topic (PR #14669)

When the user is in a topic, quick search offers the option to search that topic or the whole site. This PR adds a special case for this context when invoking the @ keyword. If there is only one result returned by the user search, the quick search widget will display two options: search this topic for the matching user OR search globally for the matching user.

GitHub

It’s a bit odd to use forEach when we just checked that there’s exactly one item, but it’s not a big deal either :wink:

Yes, good catch, fixed.

This pull request has been mentioned on Discourse Meta. There might be relevant details there: