Improve rendering when sender does not have a display name.

This commit is contained in:
Benoit Marty 2026-04-22 14:57:18 +02:00
parent 7d31944a0a
commit 12c5cf2ab6

View file

@ -192,23 +192,26 @@ private fun SenderRow(
.weight(1f), .weight(1f),
) { ) {
// Name // Name
val bestName = mediaInfo.senderName ?: mediaInfo.senderId?.value.orEmpty()
val avatarColors = AvatarColorsProvider.provide(id) val avatarColors = AvatarColorsProvider.provide(id)
Text( Text(
modifier = Modifier.clipToBounds(), modifier = Modifier.clipToBounds(),
text = mediaInfo.senderName.orEmpty(), text = bestName,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
color = avatarColors.foreground, color = avatarColors.foreground,
style = ElementTheme.typography.fontBodyMdMedium, style = ElementTheme.typography.fontBodyMdMedium,
) )
// Id // Id
Text( if (!mediaInfo.senderName.isNullOrEmpty()) {
text = mediaInfo.senderId?.value.orEmpty(), Text(
color = ElementTheme.colors.textSecondary, text = mediaInfo.senderId?.value.orEmpty(),
maxLines = 1, color = ElementTheme.colors.textSecondary,
overflow = TextOverflow.Ellipsis, maxLines = 1,
style = ElementTheme.typography.fontBodyMdRegular, overflow = TextOverflow.Ellipsis,
) style = ElementTheme.typography.fontBodyMdRegular,
)
}
} }
} }
} }