a11y: let banner title be implemented as a heading.

Closes #6384
This commit is contained in:
Benoit Marty 2026-04-23 16:10:19 +02:00 committed by Benoit Marty
parent 784ede2eb1
commit 02ab58ffbe

View file

@ -24,6 +24,8 @@ import androidx.compose.runtime.Immutable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import io.element.android.compound.theme.ElementTheme import io.element.android.compound.theme.ElementTheme
import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.compound.tokens.generated.CompoundIcons
@ -148,7 +150,11 @@ private fun TitleAndDescription(
text = title, text = title,
style = ElementTheme.typography.fontBodyLgMedium, style = ElementTheme.typography.fontBodyLgMedium,
color = titleColor, color = titleColor,
modifier = Modifier.weight(1f), modifier = Modifier
.weight(1f)
.semantics {
heading()
},
) )
if (trailingContent != null) { if (trailingContent != null) {
Spacer(Modifier.width(12.dp)) Spacer(Modifier.width(12.dp))