-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Limit number of characters on display names #5739
Comments
Yeah I encountered this issue as well. To make Riot useable a username ought to be limited to some reasonable amount of characters, and maybe even abbreviated in cases such as this. |
One possibility is to add CSS that prevents the displayname from wrapping, along with "text-overflow: ellipsis". Also, pills will need the same treatment. |
This should certainly be fixed :D The only questions are:
36213 characters is unhelpfully obviously too long; it doesn't help us to set a sensible limit at all I'd suggest that:
But what should the limit be?
Personally I'd vote for Matrix supporting Picasso and for Riot to truncate (with ellipsis and full text on hover) whenever a display name goes over a line break (always making room for disambiguation-mxid-in-parenthesis for the inevitable case when some idiot copies another idiot's massive name). And Adolf W671m, Senior is out of luck and will have to implement his own realtime messaging protocol. |
Aaaand I forgot about pills. They should probably be more restrictive again - noodling around in firebug it seems that anything longer than ~35 characters looks dreadful. |
The display in the timeline heading can be addressed by adding something along these lines: .mx_MatrixChat_useCompactLayout .mx_EventTile .mx_SenderProfile {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} This limits the display name to one line, and adds a "..." at the end of the line if it is too long. Note: this probably does not fix the length of membership events (e.g. "X joined", or "X changed their displayname...") nor pills |
a.mx_UserPill {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 20em;
vertical-align: text-bottom;
} will address the issue for pills, and span.mx_MEmoteBody_sender {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inline-block;
max-width: calc(100% - 2em);
vertical-align: bottom;
} will address the issue for emotes. (the calc in the max-width is to take into account the preceding "* ") Maybe someone who understands CSS better than I can figure out why one wants There doesn't seem to be an easy way to fix membership events, since the usernames are not enclosed in any tags. |
Description
A kid today changed his nickname on Riot.im to a 36,213 characters long nickname, spamming everyone on IRC and Riot.im
Steps to reproduce
Expected behavior
Ok, just for fun I will... Keep in mind that the amount of screenshots would had been immense, so I just post a few and a file with a copy paste of the username.
This bug probably affects all devices, although is probably easier to make it happen on a desktop because of the easy use of copy+paste.
spam.txt
The text was updated successfully, but these errors were encountered: