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,16 +192,18 @@ 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
if (!mediaInfo.senderName.isNullOrEmpty()) {
Text( Text(
text = mediaInfo.senderId?.value.orEmpty(), text = mediaInfo.senderId?.value.orEmpty(),
color = ElementTheme.colors.textSecondary, color = ElementTheme.colors.textSecondary,
@ -212,6 +214,7 @@ private fun SenderRow(
} }
} }
} }
}
@Composable @Composable
private fun Section( private fun Section(