Skip to content

Commit 1f04a04

Browse files
committed
msglist: Set message-sender-name color to match web
I overlooked this in zulip#686 because this text's color wasn't set at this site explicitly, and my process for that PR was to search case-insensitively for the term [color]. Instead of being set locally, this text's color was being set by the DefaultTextStyle that wraps the whole message list for the sake of coloring message content. That color doesn't match web, it turns out. (Or the old Figma, which uses true black.) Web colors this with var(--color-text-sender-name), but that variable is undefined for light theme, so it falls back to --color-text-default which is this color. At this commit, if I change the message list's DefaultTextStyle to set a conspicuous color, like orange, I only see a response from message content, and not from sender names or anything else. That's good, but I wonder if there's a less error-prone solution for coloring just the message content, without regressing on performance. I'll explore that later in this series.
1 parent c576cd0 commit 1f04a04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/widgets/message_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,10 +915,11 @@ class MessageWithPossibleSender extends StatelessWidget {
915915
const SizedBox(width: 8),
916916
Flexible(
917917
child: Text(message.senderFullName, // TODO get from user data
918-
style: const TextStyle(
918+
style: TextStyle(
919919
fontFamily: 'Source Sans 3',
920920
fontSize: 18,
921921
height: (22 / 18),
922+
color: const HSLColor.fromAHSL(1, 0, 0, 0.2).toColor(),
922923
).merge(weightVariableTextStyle(context, wght: 600)),
923924
overflow: TextOverflow.ellipsis)),
924925
if (sender?.isBot ?? false) ...[

0 commit comments

Comments
 (0)