fix: improve role tag formatting and handle empty role cases in user status display

This commit is contained in:
HueByte
2026-02-24 21:44:43 +01:00
parent 62996f85e9
commit 5391d2cb1c
2 changed files with 10 additions and 4 deletions
+4
View File
@@ -39,6 +39,10 @@ public static partial class ChatColors
lastIndex = match.Index + match.Length;
}
// Add remaining text after the last mention (or all text if no mentions found)
if (lastIndex < text.Length)
segments.Add(new ChatSegment(text[lastIndex..], defaultColor));
// Second pass: highlight #channels in non-mention segments
var mentionSegments = segments;
segments = [];
+3 -1
View File
@@ -928,7 +928,9 @@ public sealed partial class MainWindow : Runnable
ServerRole.Mod => "\u2740", // ❀
_ => ""
};
var text = $"{statusIcon} {roleTag} {name}";
var text = roleTag.Length > 0
? $"{statusIcon} {roleTag} {name}"
: $"{statusIcon} {name}";
var nameColor = HexColorHelper.ParseHexColor(u.NicknameColor);
return (text, nameColor, u.Username);
}).ToList();