Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.isTraversalGroup
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.style.TextAlign
Expand Down Expand Up @@ -168,7 +169,11 @@ public fun MediaAttachmentContent(
stringResource(UiCommonR.string.stream_ui_message_list_semantics_message_attachments, attachments.size)
Row(
modifier = Modifier
.semantics { this.contentDescription = description }
.semantics {
this.contentDescription = description
// Group the grid so a TalkBack swipe walks every tile before leaving it.
isTraversalGroup = true
}
.padding(MessageStyling.messageSectionPadding),
horizontalArrangement = Arrangement.spacedBy(gridSpacing),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -96,6 +97,8 @@ public fun GiphyMessageContent(
val cancelledAnnouncement = stringResource(R.string.stream_compose_message_list_giphy_cancelled)
val shuffledAnnouncement = stringResource(R.string.stream_compose_message_list_giphy_shuffled)

val giphyPreviewLabel = stringResource(R.string.stream_compose_giphy_preview_label)

val isTouchExplorationEnabled = rememberIsTouchExplorationEnabled()
val previewFocusRequester = remember { FocusRequester() }
// Track whether the preview has already requested focus so that a LazyColumn dispose +
Expand All @@ -120,7 +123,8 @@ public fun GiphyMessageContent(
.applyIf(isTouchExplorationEnabled) {
focusRequester(previewFocusRequester).focusable()
}
.semantics(mergeDescendants = true) {},
// Lead the preview's merged TalkBack announcement with the "Giphy preview" label.
.semantics(mergeDescendants = true) { contentDescription = giphyPreviewLabel },
) {
Row(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ internal fun MessageComposerQuotedMessage(
message = message,
currentUser = currentUser,
replyMessage = null,
// No click handler on the composer quoted preview; merge into one TalkBack stop.
modifier = Modifier.semantics(mergeDescendants = true) {},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ internal fun PollAnswersItem(
verticalArrangement = Arrangement.spacedBy(StreamTokens.spacingXs),
) {
Column(
// No click handler; merge into one TalkBack stop.
modifier = Modifier.semantics(mergeDescendants = true) {},
verticalArrangement = Arrangement.spacedBy(StreamTokens.spacingXs),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private fun Content(
Row(
modifier = Modifier
.fillMaxWidth()
// No click handler; merge into one TalkBack stop.
.semantics(mergeDescendants = true) {},
horizontalArrangement = Arrangement.End,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ internal fun PollVoteItem(
val borderSize = 2.dp

Row(
// No click handler; merge into one TalkBack stop.
modifier = modifier.semantics(mergeDescendants = true) {},
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(StreamTokens.spacingSm),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ private fun PollSwitchHeader(
value = enabled,
role = Role.Switch,
onValueChange = onCheckedChange,
)
.semantics(mergeDescendants = true) {},
),
verticalAlignment = Alignment.CenterVertically,
) {
Column(
Expand Down Expand Up @@ -230,8 +229,7 @@ private fun LimitVotesPerPerson(
value = enabled,
role = Role.Switch,
onValueChange = onCheckedChange,
)
.semantics(mergeDescendants = true) {},
),
verticalAlignment = Alignment.CenterVertically,
) {
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ internal fun MessageComposerAudioRecordingLockedContent(
modifier = RecordingBarModifier
.focusRequester(rowFocusRequester)
.focusable()
.semantics(mergeDescendants = true) { contentDescription = rowLabel },
// Merge the row into one TalkBack stop; the leading icon owns the row label.
.semantics(mergeDescendants = true) {},
verticalAlignment = Alignment.CenterVertically,
) {
Box(modifier = Modifier.size(48.dp), contentAlignment = Alignment.Center) {
Icon(
painter = painterResource(id = R.drawable.stream_design_ic_voice),
contentDescription = null,
contentDescription = rowLabel,
tint = ChatTheme.colors.accentError,
)
}
Expand Down Expand Up @@ -314,7 +315,8 @@ private fun RowScope.OverviewPlaybackRow(
.fillMaxHeight()
.focusRequester(focusRequester)
.focusable()
.semantics(mergeDescendants = true) { contentDescription = rowLabel },
// Merge the row into one TalkBack stop; the waveform owns the row label.
.semantics(mergeDescendants = true) {},
verticalAlignment = Alignment.CenterVertically,
) {
val playbackInMs = (currentProgress * state.durationInMs).toInt()
Expand All @@ -330,6 +332,7 @@ private fun RowScope.OverviewPlaybackRow(
StaticWaveformSlider(
modifier = Modifier
.fillMaxSize()
.semantics { contentDescription = rowLabel }
.padding(start = StreamTokens.spacingMd, top = 8.dp, bottom = 8.dp),
waveformData = state.waveform,
progress = currentProgress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private fun EditIndicatorCard(body: QuotedMessageBody) {
)
.padding(StreamTokens.spacingXs)
.height(IntrinsicSize.Min)
// No click handler; merge into one TalkBack stop.
.semantics(mergeDescendants = true) {},
horizontalArrangement = Arrangement.spacedBy(StreamTokens.spacingXs),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ internal fun DefaultChannelHeaderCenterContent(
onClickLabel = onHeaderTitleClickLabel,
role = Role.Button,
) { callback(channel) }
.semantics(mergeDescendants = true) {}
},
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public fun MessageContainer(
true
}
}
// No click handler on deleted/uploading messages; merge into one TalkBack stop.
else -> Modifier.semantics(mergeDescendants = true) {}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<string name="stream_compose_flag_message_title">"Marcar mensaje"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Vista previa de Giphy"</string>
<string name="stream_compose_image_options">"Opciones de imagen"</string>
<string name="stream_compose_image_order">"%1$d de %2$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"Cancelar compartir"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<string name="stream_compose_flag_message_title">"Signaler le message"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Aperçu Giphy"</string>
<string name="stream_compose_image_options">"Options de l\'image"</string>
<string name="stream_compose_image_order">"%1$d sur %2$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"Annuler le partage"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<string name="stream_compose_flag_message_title">"मैसेज चिह्नित करें"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Giphy पूर्वावलोकन"</string>
<string name="stream_compose_image_options">"इमेज के विकल्प"</string>
<string name="stream_compose_image_order">"%2$d में से %1$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"शेयरिंग रद्द करें"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<string name="stream_compose_flag_message_title">"Tandai Pesan"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Pratinjau Giphy"</string>
<string name="stream_compose_image_options">"Opsi gambar"</string>
<string name="stream_compose_image_order">"%1$d dari %2$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"Batalkan Berbagi"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<string name="stream_compose_flag_message_title">"Segnala messaggio"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Anteprima Giphy"</string>
<string name="stream_compose_image_options">"Opzioni immagine"</string>
<string name="stream_compose_image_order">"%1$d di %2$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"Annulla condivisione"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<string name="stream_compose_flag_message_title">"メッセージを報告"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Giphyプレビュー"</string>
<string name="stream_compose_image_options">"画像オプション"</string>
<string name="stream_compose_image_order">"%1$d / %2$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"共有をキャンセル"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<string name="stream_compose_flag_message_title">"메시지 신고"</string>
<string name="stream_compose_giphy_label">"GIPHY"</string>
<string name="stream_compose_giphy_preview">"Giphy"</string>
<string name="stream_compose_giphy_preview_label">"Giphy 미리보기"</string>
<string name="stream_compose_image_options">"이미지 옵션"</string>
<string name="stream_compose_image_order">"%1$d / %2$d"</string>
<string name="stream_compose_image_preview_cancel_sharing">"공유 취소"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
<string name="stream_compose_video_preview">Video</string>
<string name="stream_compose_file_preview">File</string>
<string name="stream_compose_giphy_preview">Giphy</string>
<string name="stream_compose_giphy_preview_label">Giphy preview</string>
<string name="stream_compose_link_preview">Link</string>
<string name="stream_compose_message_deleted_preview">Message deleted</string>
<string name="stream_compose_no_messages_yet">No messages yet</string>
Expand Down
Loading