Merge pull request #5968 from element-hq/feature/bma/a11y/letterAvatar

Ensure that avatars always have a content description.
This commit is contained in:
Benoit Marty
2026-01-05 10:21:49 +01:00
committed by GitHub
10 changed files with 11 additions and 11 deletions

View File

@@ -91,7 +91,7 @@ class ContributesNodeProcessor(
.addAnnotation(Binds::class)
.addAnnotation(IntoMap::class)
.addAnnotation(
AnnotationSpec.Companion.builder(ClassName.bestGuess(nodeKeyFqName.asString())).addMember(
AnnotationSpec.builder(ClassName.bestGuess(nodeKeyFqName.asString())).addMember(
CLASS_PLACEHOLDER,
ClassName.bestGuess(ksClass.qualifiedName!!.asString())
).build()

View File

@@ -49,7 +49,7 @@ fun GroupHeaderView(
modifier: Modifier = Modifier
) {
// Ignore isHighlighted for now, we need a design decision on it.
val backgroundColor = Color.Companion.Transparent
val backgroundColor = Color.Transparent
val shape = RoundedCornerShape(CORNER_RADIUS)
Box(

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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(

View File

@@ -34,7 +34,7 @@ fun SelectedIndicatorAtom(
Icon(
modifier = modifier.toggleable(
value = true,
role = Role.Companion.Checkbox,
role = Role.Checkbox,
enabled = enabled,
onValueChange = {},
),

View File

@@ -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)

View File

@@ -36,7 +36,7 @@ internal fun ImageAvatar(
SubcomposeAsyncImage(
model = avatarData,
contentDescription = contentDescription,
contentScale = ContentScale.Companion.Crop,
contentScale = ContentScale.Crop,
modifier = modifier
.size(size)
.clip(avatarShape)

View File

@@ -50,6 +50,6 @@ object ElementNavigationBarItemDefaults {
selectedTextColor = ElementTheme.colors.textPrimary,
unselectedIconColor = ElementTheme.colors.iconTertiary,
unselectedTextColor = ElementTheme.colors.textDisabled,
selectedIndicatorColor = Color.Companion.Transparent,
selectedIndicatorColor = Color.Transparent,
)
}

View File

@@ -27,7 +27,7 @@ class TestParentNode<Child : Node>(
private val childNodeFactory: (buildContext: BuildContext, plugins: List<Plugin>) -> Child,
) : DependencyInjectionGraphOwner,
Node(
buildContext = BuildContext.Companion.root(savedStateMap = null),
buildContext = BuildContext.root(savedStateMap = null),
plugins = emptyList(),
view = EmptyNodeView,
) {