From 5b6dfca5d33e0afb9415f62a4942bee7b019c37a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 2 Jan 2026 16:23:15 +0100 Subject: [PATCH] Ensure that room / space avatar always have a contentDescription. --- .../android/features/roomdetails/impl/RoomDetailsView.kt | 2 +- .../android/features/space/impl/settings/SpaceSettingsView.kt | 2 +- .../features/userprofile/shared/UserProfileHeaderSection.kt | 2 +- .../libraries/designsystem/components/avatar/DmAvatars.kt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index 046c64d906..05f26daedb 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -404,7 +404,7 @@ private fun RoomHeaderSection( }.toImmutableList(), isTombstoned = isTombstoned, ), - contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_room_avatar) }, + contentDescription = stringResource(CommonStrings.a11y_room_avatar), modifier = Modifier .clickable( enabled = avatarUrl != null, diff --git a/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt b/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt index 5a8aac4a30..63b83516ac 100644 --- a/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt +++ b/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt @@ -115,7 +115,7 @@ private fun SpaceInfoSection( Avatar( avatarData = AvatarData(roomId.value, name, avatarUrl, AvatarSize.SpaceListItem), avatarType = AvatarType.Space(), - contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_avatar) }, + contentDescription = stringResource(CommonStrings.a11y_avatar), ) Spacer(Modifier.width(16.dp)) Column { diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt index b27d1ad091..ac146a36a7 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt @@ -66,7 +66,7 @@ fun UserProfileHeaderSection( Avatar( avatarData = AvatarData(userId.value, userName, avatarUrl, AvatarSize.UserHeader), avatarType = AvatarType.User, - contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_user_avatar) }, + contentDescription = stringResource(CommonStrings.a11y_user_avatar), modifier = Modifier .clip(CircleShape) .clickable( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/DmAvatars.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/DmAvatars.kt index 1cd024542c..c5b870507b 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/DmAvatars.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/DmAvatars.kt @@ -59,7 +59,7 @@ fun DmAvatars( Avatar( avatarData = userAvatarData, avatarType = AvatarType.User, - contentDescription = userAvatarData.url?.let { stringResource(CommonStrings.a11y_your_avatar) }, + contentDescription = stringResource(CommonStrings.a11y_your_avatar), modifier = Modifier .align(Alignment.BottomStart) .graphicsLayer { @@ -94,7 +94,7 @@ fun DmAvatars( Avatar( avatarData = otherUserAvatarData, avatarType = AvatarType.User, - contentDescription = otherUserAvatarData.url?.let { stringResource(CommonStrings.a11y_other_user_avatar) }, + contentDescription = stringResource(CommonStrings.a11y_other_user_avatar), modifier = Modifier .align(Alignment.TopEnd) .clip(CircleShape)