Created attachment 162961 [details] The extreme scenario where someone put linebreaks in their display name, severely breaking the layout SUMMARY In a room preview, if the last author's display name has emojis or, in extreme cases, line breaks, then their display name would take more space vertically. The room preview does not seem to account for this, so if the display name's space is stretched, then it will also stretch the room icon on the left. STEPS TO REPRODUCE 1. Be in a room where someone has a display name that either contains an emoji or line breaks. 2. Let them send the latest message. OBSERVED RESULT It stretches the entire space for that room's preview. Notably it stretches the room avatar. EXPECTED RESULT The space taken by each room is constant. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch ARM (Asahi Linux) KDE Plasma Version: 5.27.9 KDE Frameworks Version: 5.111.0 Qt Version: 5.15.11 ADDITIONAL INFORMATION
Created attachment 162962 [details] The usual scenario where one has emojis in display name
do you know which character exactly is used as a linebreak here? for the usual candidates, this is already filtered out, so it's probably something more exotic, maybe unicode
Extracted from membership state events: "Access forbidden!\n\nYou don't have permission to access the requested directory. There is either no index document or the directory is read-protected.\n\nIf you think this is a server error, please contact the webmaster.\nError 403\nlocalhost\nApache” So it’s literally \n > On Nov 11, 2023, at 18:55, Tobias Fella <bugzilla_noreply@kde.org> wrote: > > https://bugs.kde.org/show_bug.cgi?id=476731 > > Tobias Fella <fella@posteo.de> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|REPORTED |NEEDSINFO > Resolution|--- |WAITINGFORINFO > > --- Comment #2 from Tobias Fella <fella@posteo.de> --- > do you know which character exactly is used as a linebreak here? for the usual > candidates, this is already filtered out, so it's probably something more > exotic, maybe unicode > > -- > You are receiving this mail because: > You reported the bug.
OK so this is super weird I put the string you copied in as a test and as expected the newlines are successfully stripped from the topic so I have no idea why this is happening. Since you seem to know how to get to the underlying event data are you able to copy me the entire JSON for the m.room.name and m.room.topic events for this room?
It’s a user display name, not a room topic/name.
(In reply to Austin Huang from comment #5) > It’s a user display name, not a room topic/name. Oh then that makes sense we don't sanitise those. But it looks like we need to and yes that would cause the issue seen.
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/1438
But I also mentioned that putting some unicode characters also affect the height of the last author field in room previews. Element seems to just cut off the extra height for this. I don’t know if it’s my issue (sorry I’m new to Linux lol) of not installing a font, but fixing the height of the field could be considered.
Git commit 61ad8927325c8c994145c8611e7c26a8c4207f95 by James Graham. Committed on 12/11/2023 at 19:46. Pushed by nvrwhere into branch 'master'. Handle multiple line names Add function to get the display name for an author on a single line as nothing stops there being linebreaks. M +29 -0 autotests/data/test-eventhandler-sync.json M +19 -0 autotests/eventhandlertest.cpp M +22 -0 src/eventhandler.cpp M +11 -0 src/eventhandler.h M +1 -1 src/neochatroom.cpp https://invent.kde.org/network/neochat/-/commit/61ad8927325c8c994145c8611e7c26a8c4207f95
(In reply to Austin Huang from comment #8) > But I also mentioned that putting some unicode characters also affect the > height of the last author field in room previews. Element seems to just cut > off the extra height for this. I don’t know if it’s my issue (sorry I’m new > to Linux lol) of not installing a font, but fixing the height of the field > could be considered. Do you have any examples of the other unicode characters as we just need to sanitize them as well?
Yes; see attachment 162962 [details], comment 1.
This is fixed, correct? The last bug you mentioned should really be a separate ticket.
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone!
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.