Skip to content

Commit 0a9fd85

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: const HSLColor.fromAHSL(1, 0, 0, 0.15).toColor() 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 it would be better to scope the DefaultTextStyle to just the message content, to avoid errors like this in the future. I'll do that later in this series of commits.
1 parent 696391a commit 0a9fd85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/widgets/message_list.dart

+2-1
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)