Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent case sensitivity in chat username mentions #12918

Open
SabreCat opened this issue Jan 1, 2021 · 3 comments
Open

Inconsistent case sensitivity in chat username mentions #12918

SabreCat opened this issue Jan 1, 2021 · 3 comments

Comments

@SabreCat
Copy link
Member

SabreCat commented Jan 1, 2021

JohnJSal @JohnJSal (624e48a3-cbea-4bbe-ae44-ca9183f49626):

"I noticed just now that someone mentioned my name in a post, but got the capitalization wrong. However, the post still had the purple dot on it to show me that I was mentioned, even though the name itself was not clickable to my Profile.

I wasn't sure if this was normal, because I thought mentions of the display name did not show the purple dot. Maybe it worked for me because the display and user names are the same?

image

@shailenpatel1
Copy link

Can I work on this?

@paglias
Copy link
Contributor

paglias commented Jan 3, 2021

@shailenpatel1 unfortunately only issues marked as help wanted are available to be worked on

@Alys
Copy link
Contributor

Alys commented Jan 9, 2021

I believe the code responsible for the mention icon appearing for Usernames in the wrong case is this:

message.highlight = new RegExp(pattern, 'i').test(message.text);

It's a case-insensitive regex. It's been case-insensitive since the mention icon was created in 35bb592

There's pros and cons for having it remain case-INsensitive

  1. CON: Usernames are meant to be case-sensitive so strictly speaking this RexEx should be case-sensitive.
  2. CON: We do still have some instances where there are two players with the same Username just using different letter cases. (However those players are long-inactive, so you wouldn't expect mentions of them in chat now.)
  3. PRO: There are times when a player will type a Username manually instead of using the reply feature to enter a Username automatically, and sometimes they would get the case wrong. The player who they are trying to mention WOULD want to see the mention dot in that case.
  4. PRO: There are times when a player will type a Display Name with an @ symbol instead of typing a Username. If the targetted player's Display Name is the same as their own Username, then you WOULD want the mention dot to appear.
  5. CON: As in the previous point, but if the targetted player's Display Name is the same as someone else's Username, then you would NOT want the mention dot to appear.

Points 3 and 4 may be more common than point 5 so maybe it's best to leave the regex as case-insensitive? I'm on the fence about this though.

I think points 1 and 2 aren't important enough to outweigh any usability benefits from leaving it case-insensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants