Visual indicator when a user can't see a mention

AI-generated summary

This discussion proposes adding a visual indicator in Discourse to alert users when a mentioned person cannot see or be notified of a mention — particularly useful in secure categories or private messages. Inspired by Facebook’s greyed-out mention with a “no entry” icon and hover tooltips, DeanMarkTaylor initiated the idea, noting its relevance for organizations with many secure categories. codinghorror and others agreed, suggesting helpful popups like: “You mentioned @user but they won’t be notified because they can’t see this PM/category. Would you like to add them?” cpradio implemented a working version, fixing a broken group mention notification along the way, and submitted a PR 4550. The implementation now uses clear statements instead of questions (e.g., “You will need to invite them to this PM”). Feedback highlighted that the modal appears too early — triggering on partial matches like “Paul” for “PaulOB” — with Mittineague and codinghorror suggesting delaying the warning until after a space is typed. sam agreed to implement this post-1.9 release. mcwumbly also suggested styling mentions differently, with hover/click revealing access status. The feature is broadly welcomed as a usability improvement for secure environments and PMs.

Currently when a user cannot “see” or receive a notification of a mention of their username
there could be a better visual indicator.

I would like to see some like how Facebook handles this…

Normally a mention on Facebook looks like this (a blue coloured link):

And a mention where the user can’t see the post is like this (grey with a grey “no entry” icon):

When you hover over the username a “user card” appears with the following addition:

So a more complete screen grab looks like this:

And the “user card”:

12 Likes

This would be a good change but mostly useful in PMs? I guess if you had a lot of secure categories as well.

2 Likes

Secure categories was where I was thinking mostly.

I work with a not-for-profit where more content is in secure categories than not.

Additionally a larger portion of the user base has access to the secure categories than not, it becomes important for them to know if other users can see the content when interacting.

7 Likes

Making this happen in the composer preview window would be huge! I’ve been asked before (and had to ask myself the first time) what happens if you @mention a user in a PM or secure category. Showing clearly that they will not be notified in any way is great.

4 Likes

I am curious, how difficult do you feel this change would be @sam?

2 Likes

It’s not too hard but you don’t want to tell people they are muted

3 Likes

The muted case I am not worried about, just the general “this person won’t be notified”.

One thing I have done myself a fair bit is be in a PM and say something like hey @user can you have a look at this? and they never get notified because, duh, they are not on the PM. It would be nice to have a popup that says:

You mentioned @user but they won’t be notified because they are unable to see this personal message. Would you like to add them to this PM?

And similarly:

You mentioned @user but they won’t be notified because they do not have access to this category. Would you like to add them to a group that has access to this category?

6 Likes

This isn’t for being muted, this would be Guardian.new(mentioned).can_see?(post)

With changes, because you would need a reason code

5 Likes

I’m going to be working on this feature soon-ish :slight_smile:

11 Likes

I have a very rough version of this working now. I still need to clean it up and add a few tests, but it is getting close. Should have time again later this week to finish this off.

7 Likes

FYI, while implementing this feature, I discovered the Group Mention Notification wasn’t working anymore.

Initially, there was supposed to be a notification when mentioning a group that would tell you, you are about to warn X number of people.

I’ve corrected this functionality with my changes.

Screenshots below

Group Notification

User Mention (when they can’t see the discussion)

User Mention in a PM

Edited:
Added PM example

14 Likes

Those questions, are they intended to be rhetorical, or will there a link/button to click to answer “yes” to the question?

If not, I would like to suggestion copy changes:

Change “Would you like to add them to a group that has access to this category?” to “You will need to add them to a group that has access to this category.” (a statement)
and change “Would you like to add them to this PM?” to “You will need to invite them to this PM.” (again, a statement)


Regardless, nice job! This will be really nice when chatting in PMs, especially as it makes it clear to new staff that they can mention a user without worrying about them seeing the PM.

7 Likes

Questions turned into Statements :slight_smile: and PR submitted

https://github.com/discourse/discourse/pull/4550

11 Likes

very happy about this improvement - thanks @cpradio! :rocket:

1 Like

I still feel this would be a nice refinement for secure categories.

It would be nice if:

  • The @mention dialog prioritized users that are actually “mentionable” in a topic.

  • It had a visual indicator showing that a user is not going to get the mention

3 Likes

This still notifies too early, though, I get tons of false positives. We need to delay the warning substantially over where it fires now.

1 Like

I have experienced the modal as a minor annoyance.

At SitePoint we have restricted Staff categories. One of the Staff members that might be mentioned has the name “PaulOB”. There are also non-Staff members with the names “PauL” and “Paulo”

I can simply ignore the modal that covers the preview pane, but if I close the “paul does not have access” to see the preview I get another for Paulo.

I consider it only a minor annoyance, but if the modal could not happen until a space character after the mention I think it would be better.

4 Likes

Yes this, if it is a low risk change we should get this in @sam the way it is now is pretty bad.

Can do that first thing after 1.9 release, not fiddling with front end this close to release.

4 Likes

What if the style of the @mention were just a bit different, and hovering or clicking on it in the preview would tell you?

1 Like