Hello,
There’s a feature in Discourse that limits the number of user mentions in messages, and limits it even more for “new” users (trust level 0).
If you don’t know what I mean, here is the implementation in the source code of Discourse:
That’s a fine feature, but as it happens, we’ve had a few users hit that limit by mistake and being confused. The thing is, they did not mean to mention a user. They just “forgot” (or didn’t know how) to format a snippet of code included in their message, and that snippet being Java code, it included annotations, which start with @
and get interpreted as user mentions.
An example of such code:
public class MyCode {
@NotNull
private String foo;
@NotNull
private String bar;
@NotNull
private String foobar;
}
The error message is simply this:
Sorry, new users can only mention 2 users in a post
You can imagine that a user who is unfamiliar with how to format code in markdown may also be unfamiliar with what a user mention is, and even if they’re familiar with it, they may not understand that what they meant as a Java annotation was interpreted as a user mention.
So… maybe the user experience of that feature can be improved?
We could talk of Discourse automatically detecting source code and suggesting to format it, or highlighting the parts of the message whose validation failed, but either of these solutions would probably require a lot of effort.
I was thinking of just expanding the error message to explain what a user mention is, and maybe give some advice?
So at least this:
Sorry, new users can only mention 2 users in a post.
User mentions are words prefixed with `@`, for example `@johnsmith`.
And maybe even this:
Sorry, new users can only mention 2 users in a post.
User mentions are words prefixed with `@`, for example `@johnsmith`.
If your post includes source code, make sure to surround it with backticks to avoid having parts of your code interpreted as user mentions; see <insert some links to documentation about formatting code on discourse>.
Thoughts, opinions? Should I send a pull request? I’m afraid I can only update the English and French locales, though.
For reference, some examples of confused users: