From 871fb880183882d4de87931ba8424a8b89383815 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 26 Jun 2025 15:28:53 +0200 Subject: [PATCH 1/2] a11y: improve content description of the clear filter button. Change from "Clear" to "Clear filters" --- .../features/roomlist/impl/filters/RoomListFiltersView.kt | 3 ++- features/roomlist/impl/src/main/res/values/localazy.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/filters/RoomListFiltersView.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/filters/RoomListFiltersView.kt index 214ac44cfd..6cb94d9f96 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/filters/RoomListFiltersView.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/filters/RoomListFiltersView.kt @@ -40,6 +40,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.zIndex import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons +import io.element.android.features.roomlist.impl.R import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.theme.components.Icon @@ -147,7 +148,7 @@ private fun RoomListClearFiltersButton( modifier = Modifier.align(Alignment.Center), imageVector = CompoundIcons.Close(), tint = ElementTheme.colors.iconOnSolidPrimary, - contentDescription = stringResource(id = io.element.android.libraries.ui.strings.R.string.action_clear), + contentDescription = stringResource(id = R.string.screen_roomlist_clear_filters), ) } } diff --git a/features/roomlist/impl/src/main/res/values/localazy.xml b/features/roomlist/impl/src/main/res/values/localazy.xml index 90432433c2..58afb06591 100644 --- a/features/roomlist/impl/src/main/res/values/localazy.xml +++ b/features/roomlist/impl/src/main/res/values/localazy.xml @@ -21,6 +21,7 @@ "This is a one time process, thanks for waiting." "Setting up your account." "Create a new conversation or room" + "Clear filters" "Get started by messaging someone." "No chats yet." "Favourites" From 3b687a129c9f6166146e6d45f052a3eb8baaf9de Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 26 Jun 2025 15:55:15 +0200 Subject: [PATCH 2/2] a11y: improve content description of the close formatting button. Change from "Close" to "Cancel and close text formatting" --- .../libraries/textcomposer/TextComposer.kt | 24 ++++++++++--------- .../impl/src/main/res/values/localazy.xml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt index 815000c626..47216d7e88 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt @@ -178,17 +178,19 @@ fun TextComposer( remember(state.richTextEditorState, composerMode, onResetComposerMode, onError) { @Composable { TextInputBox( - modifier = Modifier.clickable( - interactionSource = remember { MutableInteractionSource() }, - indication = null, - ) { - coroutineScope.launch { - state.requestFocus() - view.showKeyboard() + modifier = Modifier + .clickable( + interactionSource = remember { MutableInteractionSource() }, + indication = null, + ) { + coroutineScope.launch { + state.requestFocus() + view.showKeyboard() + } } - }.semantics { - hideFromAccessibility() - }, + .semantics { + hideFromAccessibility() + }, composerMode = composerMode, onResetComposerMode = onResetComposerMode, isTextEmpty = state.richTextEditorState.messageHtml.isEmpty(), @@ -317,7 +319,7 @@ fun TextComposer( IconColorButton( onClick = onDismissTextFormatting, imageVector = CompoundIcons.Close(), - contentDescription = stringResource(CommonStrings.action_close), + contentDescription = stringResource(R.string.rich_text_editor_close_formatting_options), ) }, textFormatting = textFormattingOptions, diff --git a/libraries/textcomposer/impl/src/main/res/values/localazy.xml b/libraries/textcomposer/impl/src/main/res/values/localazy.xml index 2be7a12577..89331da7ed 100644 --- a/libraries/textcomposer/impl/src/main/res/values/localazy.xml +++ b/libraries/textcomposer/impl/src/main/res/values/localazy.xml @@ -2,7 +2,7 @@ "Add attachment" "Toggle bullet list" - "Close formatting options" + "Cancel and close text formatting" "Toggle code block" "Add a caption" "Encrypted message…"