From 9704f5274c447315d463a1a0630d4c9393d55b5b Mon Sep 17 00:00:00 2001 From: Jakub Zerko Date: Wed, 6 May 2026 12:46:38 +0200 Subject: [PATCH 1/2] fix: talkBack labels for message avatars and rich text actions --- .../messages/item/MessageStatusIndicator.kt | 2 +- .../item/RegularMessageItemLeading.kt | 23 +++++++++++++++++-- app/src/main/res/values/strings.xml | 17 +++++++------- .../ui/common/avatar/UserProfileAvatar.kt | 9 ++++++++ 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageStatusIndicator.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageStatusIndicator.kt index 0d4d08001df..772bb6a5840 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageStatusIndicator.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageStatusIndicator.kt @@ -102,7 +102,7 @@ fun MessageStatusIndicator( modifier = modifier, painter = painterResource(id = R.drawable.ic_warning_circle), tint = errorTint, - contentDescription = stringResource(R.string.content_description_message_error_status), + contentDescription = null, ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/RegularMessageItemLeading.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/RegularMessageItemLeading.kt index 2fffebeb77f..2866b2955e7 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/RegularMessageItemLeading.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/RegularMessageItemLeading.kt @@ -19,11 +19,14 @@ package com.wire.android.ui.home.conversations.messages.item import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.compose.ui.res.stringResource +import com.wire.android.R import com.wire.android.model.Clickable import com.wire.android.model.UserAvatarData import com.wire.android.ui.common.avatar.UserProfileAvatar import com.wire.android.ui.common.avatar.UserProfileAvatarType.WithIndicators import com.wire.android.ui.home.conversations.model.MessageHeader +import com.wire.android.ui.common.R as commonR @Composable fun RegularMessageItemLeading( @@ -35,15 +38,31 @@ fun RegularMessageItemLeading( val isProfileRedirectEnabled = header.userId != null && !(header.isSenderDeleted || header.isSenderUnavailable) if (showAuthor) { - val avatarClickable = remember { - Clickable(enabled = isProfileRedirectEnabled) { + val openProfileDescription = stringResource( + id = R.string.content_description_open_user_profile_label + ) + val avatarClickable = remember(isProfileRedirectEnabled, header.userId, openProfileDescription, onOpenProfile) { + Clickable( + enabled = isProfileRedirectEnabled, + onClickDescription = openProfileDescription + ) { onOpenProfile(header.userId!!.toString()) } } + val avatarStatusDescription = userAvatarData.getAvailabilityStatusDescriptionId() + ?.let { stringResource(id = it) } + ?: stringResource(id = commonR.string.user_profile_status_none) + val avatarContentDescription = listOfNotNull( + stringResource(id = commonR.string.content_description_user_avatar), + header.username.asString(), + avatarStatusDescription, + openProfileDescription.takeIf { isProfileRedirectEnabled } + ).joinToString(", ") // because avatar takes start padding we don't need to add padding to message item UserProfileAvatar( avatarData = userAvatarData, clickable = avatarClickable, + contentDescription = avatarContentDescription, type = header.guestExpiresAt?.let { WithIndicators.TemporaryUser(it) } ?: WithIndicators.RegularUser(false) ) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 13d1711c2bc..51c9a15c511 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -106,13 +106,14 @@ Delete the conversation Start audio call Wire - Enable rich text mode button - Enable drawing mode button - Rich text formatting Header - Rich text formatting Bold - Rich text formatting Italic - Send Emoticon button - Send GIF button + Open formatting options + Enable drawing mode + Use a heading + Use bolded text + Use italic text + Close formatting options + Send Emoticon + Send GIF Mention someone Go back to conversation list open conversation details @@ -134,7 +135,7 @@ Right arrow Go back Mention icon - Attach new item to conversation + Add attachment Open Message Details Copy the message Share the selected file with other app diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt index 4652b6e4795..e5b6c4e425c 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt @@ -148,11 +148,20 @@ fun UserProfileAvatar( legalHoldIndicatorVisible = false ), ) { + val accessibilityModifier = if (contentDescription != null && clickable?.enabled == true) { + Modifier.clearAndSetSemantics { + this.contentDescription = contentDescription + role = Role.Button + } + } else { + Modifier + } Box( contentAlignment = Alignment.Center, modifier = modifier .wrapContentSize() .clip(CircleShape) + .then(accessibilityModifier) .clickable(clickable) ) { var userStatusIndicatorParams by remember { mutableStateOf(Size.Zero to Offset.Zero) } From 345dce0678ba34d700938aa93932e1ded0059fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BBerko?= Date: Wed, 6 May 2026 15:21:06 +0200 Subject: [PATCH 2/2] Update core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MichaƂ Saleniuk <30429749+saleniuk@users.noreply.github.com> --- .../com/wire/android/ui/common/avatar/UserProfileAvatar.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt index e5b6c4e425c..3f2e8e9669d 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/avatar/UserProfileAvatar.kt @@ -148,10 +148,12 @@ fun UserProfileAvatar( legalHoldIndicatorVisible = false ), ) { - val accessibilityModifier = if (contentDescription != null && clickable?.enabled == true) { + val accessibilityModifier = if (contentDescription != null) { Modifier.clearAndSetSemantics { this.contentDescription = contentDescription - role = Role.Button + if (clickable?.enabled == true) { + role = Role.Button + } } } else { Modifier