a11y: roles on toggle rows, dialog focus, no cancel-traps
- Commit
eab429cabc9cefc0b2adf16b6d42b2ac6b9c873e- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-21 12:02 UTC (14 days ago)
- Parents
a22d63c
App-local checkbox/radio rows announced as generic clicks with the inner control as a second target; they now use toggleable/selectable with Role.Checkbox/RadioButton and a display-only inner control, mirroring the fixed settings row (health, education, everysync radio rows). Shared dialogs never moved accessibility focus on open: the library AlertDialog wrapper now requests focus once placed (a LaunchedEffect request is lost inside Dialog popups) and ConfirmDialog routes through it with a pane title, landing on Cancel for destructive dialogs. FindFamily's AddTrackerDialog blocked Cancel, back and outside-tap during a BLE bind - the bind job is now cancellable from all three. A semantics regression test asserts the dialog pane title and initial focus. One reported non-fix: MultiCategoryPicker's toggleable is a dropdown opener, not a switch - relabelling it would mislead, it needs its own change.
Diff
education/src/main/java/com/vayunmathur/education/ui/QuizQuestionInputs.kt
diff --git a/education/src/main/java/com/vayunmathur/education/ui/QuizQuestionInputs.kt b/education/src/main/java/com/vayunmathur/education/ui/QuizQuestionInputs.ktindex 3f3edd48c3..ec392157e2 100644--- a/education/src/main/java/com/vayunmathur/education/ui/QuizQuestionInputs.kt+++ b/education/src/main/java/com/vayunmathur/education/ui/QuizQuestionInputs.kt@@ -22,6 +22,7 @@ import androidx.compose.runtime.toMutableStateList import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp import com.vayunmathur.education.R@@ -94,6 +95,7 @@ private fun MultipleChoiceInput( .selectable( selected = selected == i, enabled = enabled,+ role = Role.RadioButton, onClick = { selected = i; onAnswer(ChoiceAnswer(i)) }, ) .padding(vertical = 4.dp),@@ -122,6 +124,7 @@ private fun MultipleSelectInput( .toggleable( value = isChecked, enabled = enabled,+ role = Role.Checkbox, onValueChange = { if (it) selected.add(i) else selected.remove(i) onAnswer(if (selected.isEmpty()) null else MultiChoiceAnswer(selected.toSet()))
email/src/main/java/com/vayunmathur/email/ui/AddAccountFormScreen.kt
diff --git a/email/src/main/java/com/vayunmathur/email/ui/AddAccountFormScreen.kt b/email/src/main/java/com/vayunmathur/email/ui/AddAccountFormScreen.ktindex 46eb54fd58..d2212c3bc7 100644--- a/email/src/main/java/com/vayunmathur/email/ui/AddAccountFormScreen.kt+++ b/email/src/main/java/com/vayunmathur/email/ui/AddAccountFormScreen.kt@@ -1,6 +1,5 @@ package com.vayunmathur.email.ui -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column@@ -13,6 +12,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState+import androidx.compose.foundation.selection.toggleable import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable@@ -27,6 +27,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType@@ -142,8 +143,11 @@ private fun OutlookOAuthForm( HorizontalDivider() - Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.clickable { useAppPassword = !useAppPassword }) {- Checkbox(checked = useAppPassword, onCheckedChange = { useAppPassword = it })+ Row(+ verticalAlignment = Alignment.CenterVertically,+ modifier = Modifier.toggleable(value = useAppPassword, role = Role.Checkbox) { useAppPassword = it },+ ) {+ Checkbox(checked = useAppPassword, onCheckedChange = null) Text(stringResource(R.string.use_app_password_instead), style = MaterialTheme.typography.bodyMedium) } @@ -237,8 +241,11 @@ private fun PasswordForm( OutlinedTextField(value = email, onValueChange = { email = it.trim() }, label = { Text(stringResource(R.string.email_address)) }, singleLine = true, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Next), modifier = Modifier.fillMaxWidth()) if (preset.id == PROVIDER_CUSTOM) {- Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.clickable { useDifferentUsername = !useDifferentUsername }) {- Checkbox(checked = useDifferentUsername, onCheckedChange = { useDifferentUsername = it })+ Row(+ verticalAlignment = Alignment.CenterVertically,+ modifier = Modifier.toggleable(value = useDifferentUsername, role = Role.Checkbox) { useDifferentUsername = it },+ ) {+ Checkbox(checked = useDifferentUsername, onCheckedChange = null) Text(stringResource(R.string.username_is_not_my_email), style = MaterialTheme.typography.bodyMedium) } if (useDifferentUsername) {@@ -266,8 +273,11 @@ private fun PasswordForm( AddAccountSection(host = imapHost, onHostChange = { imapHost = it.trim() }, port = imapPort, onPortChange = { imapPort = it.filter(Char::isDigit) }, useSsl = imapUseSsl, onSslChange = { imapUseSsl = it }) Text(stringResource(R.string.smtp_outgoing), style = MaterialTheme.typography.titleSmall, fontWeight = FontWeight.SemiBold) AddAccountSection(host = smtpHost, onHostChange = { smtpHost = it.trim() }, port = smtpPort, onPortChange = { smtpPort = it.filter(Char::isDigit) }, useSsl = smtpUseSsl, onSslChange = { smtpUseSsl = it }, portImeAction = ImeAction.Done)- Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.clickable { allowInsecureCerts = !allowInsecureCerts }) {- Checkbox(checked = allowInsecureCerts, onCheckedChange = { allowInsecureCerts = it })+ Row(+ verticalAlignment = Alignment.CenterVertically,+ modifier = Modifier.toggleable(value = allowInsecureCerts, role = Role.Checkbox) { allowInsecureCerts = it },+ ) {+ Checkbox(checked = allowInsecureCerts, onCheckedChange = null) Text(stringResource(R.string.allow_insecure_certificates), style = MaterialTheme.typography.bodyMedium) } if (allowInsecureCerts) {
everysync/src/main/java/com/vayunmathur/everysync/ui/SettingsScreen.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/ui/SettingsScreen.kt b/everysync/src/main/java/com/vayunmathur/everysync/ui/SettingsScreen.ktindex ae24dab842..b7f94b211b 100644--- a/everysync/src/main/java/com/vayunmathur/everysync/ui/SettingsScreen.kt+++ b/everysync/src/main/java/com/vayunmathur/everysync/ui/SettingsScreen.kt@@ -19,6 +19,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.Role import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.ui.text.input.KeyboardType import androidx.lifecycle.compose.collectAsStateWithLifecycle@@ -102,8 +103,8 @@ fun SettingsScreen(state: SettingsUiState, actions: SettingsActions) { @Composable private fun ConflictOption(labelRes: Int, value: String, selected: String, onSelect: (String) -> Unit) { ListItem(- modifier = Modifier.selectable(selected = selected == value, onClick = { onSelect(value) }),+ modifier = Modifier.selectable(selected = selected == value, role = Role.RadioButton, onClick = { onSelect(value) }), content = { Text(stringResource(labelRes)) },- leadingContent = { RadioButton(selected = selected == value, onClick = { onSelect(value) }) },+ leadingContent = { RadioButton(selected = selected == value, onClick = null) }, ) }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddTrackerDialog.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddTrackerDialog.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddTrackerDialog.ktindex 30f1e09aa8..e438853c58 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddTrackerDialog.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/dialogs/AddTrackerDialog.kt@@ -35,6 +35,7 @@ import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedTextField import com.vayunmathur.library.ui.Text import com.vayunmathur.library.util.NavBackStack+import kotlinx.coroutines.Job import kotlinx.coroutines.launch /**@@ -52,8 +53,19 @@ fun AddTrackerDialog(backStack: NavBackStack<Route>) { var name by remember { mutableStateOf("") } var binding by remember { mutableStateOf(false) } var failed by remember { mutableStateOf(false) }+ var bindJob by remember { mutableStateOf<Job?>(null) } val devices = remember { mutableStateListOf<BluetoothDevice>() } + // Cancel must always be reachable: while binding, the old code disabled+ // the Cancel button and blocked onDismissRequest, trapping the user+ // (TalkBack included) in the dialog until the BLE bind finished or+ // failed. Cancelling now cancels the in-flight bind and pops.+ val cancelAndPop = {+ bindJob?.cancel()+ bindJob = null+ backStack.pop()+ }+ LaunchedEffect(Unit) { runCatching { TrackerProvisioner(context).unprovisioned().collect { d ->@@ -62,7 +74,7 @@ fun AddTrackerDialog(backStack: NavBackStack<Route>) { } } - Dialog({ if (!binding) backStack.pop() }) {+ Dialog({ cancelAndPop() }) { Card { Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) { Text(stringResource(R.string.add_tracker_title), style = MaterialTheme.typography.headlineMedium)@@ -87,7 +99,7 @@ fun AddTrackerDialog(backStack: NavBackStack<Route>) { Card(Modifier.clickable(enabled = !binding && name.isNotBlank()) { failed = false binding = true- scope.launch {+ bindJob = scope.launch { val ok = TrackerBinder.bind(context, name, device) binding = false if (ok) backStack.pop() else failed = true@@ -114,7 +126,7 @@ fun AddTrackerDialog(backStack: NavBackStack<Route>) { ) } - Button({ if (!binding) backStack.pop() }, enabled = !binding) {+ Button({ cancelAndPop() }) { Text(stringResource(android.R.string.cancel)) } }
findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.ktindex 7befd98a32..7deb04a7df 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/dialogs/DialogsRealRepoInteractionsTest.kt@@ -184,10 +184,15 @@ class DialogsRealRepoInteractionsTest { } @Test fun addTrackerDialogTypesNameAndCancels() {- val stack = stack()+ val stack = NavBackStack(arrayOf(Route.MainPage, Route.AddTrackerDialog)) rule.setContent { DynamicTheme { AddTrackerDialog(stack) } } rule.waitForIdle() assertTrue(rule.onAllNodesWithText("tracker", substring = true).fetchSemanticsNodes().isNotEmpty())+ // Cancel is always reachable (previously blocked while binding):+ // tapping it pops the dialog route.+ rule.onNodeWithText("Cancel", substring = true).performClick()+ rule.waitForIdle()+ assertEquals(Route.MainPage, stack.last()) } @Test fun securityCodeDialogShowsCodeForBundledPeer() = runBlocking {
health/src/main/java/com/vayunmathur/health/ui/MedicalAboutYouSection.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/MedicalAboutYouSection.kt b/health/src/main/java/com/vayunmathur/health/ui/MedicalAboutYouSection.ktindex ca055fb8b8..674b0e5c76 100644--- a/health/src/main/java/com/vayunmathur/health/ui/MedicalAboutYouSection.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/MedicalAboutYouSection.kt@@ -16,6 +16,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.dp import com.vayunmathur.health.R import com.vayunmathur.health.Route@@ -216,13 +217,14 @@ private fun AboutYouOptionDialog( .selectable( selected = index == selectedIndex, onClick = { onPick(index) },+ role = Role.RadioButton, ), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), ) { RadioButton( selected = index == selectedIndex,- onClick = { onPick(index) },+ onClick = null, ) Text(label, style = MaterialTheme.typography.bodyLarge) }
health/src/main/java/com/vayunmathur/health/ui/components/AnswerPickerDialog.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/components/AnswerPickerDialog.kt b/health/src/main/java/com/vayunmathur/health/ui/components/AnswerPickerDialog.ktindex 20c7c52295..274a2ede5d 100644--- a/health/src/main/java/com/vayunmathur/health/ui/components/AnswerPickerDialog.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/components/AnswerPickerDialog.kt@@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.dp import com.vayunmathur.health.R import com.vayunmathur.health.domain.SocialHistoryQuestions@@ -74,11 +75,13 @@ private fun AnswerRow(label: String, selected: Boolean, onClick: () -> Unit) { modifier = Modifier .fillMaxWidth() // selectable on the row, so the whole line is the target rather than the radio alone.- .selectable(selected = selected, onClick = onClick, role = null),+ // The row carries the RadioButton role; the inner radio is visual only+ // (onClick = null) so there is a single toggle target for TalkBack.+ .selectable(selected = selected, onClick = onClick, role = Role.RadioButton), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), ) {- RadioButton(selected = selected, onClick = onClick)+ RadioButton(selected = selected, onClick = null) Text(label, style = MaterialTheme.typography.bodyLarge) } }
library/ui/src/main/java/com/vayunmathur/library/ui/ConfirmDialog.kt
diff --git a/library/ui/src/main/java/com/vayunmathur/library/ui/ConfirmDialog.kt b/library/ui/src/main/java/com/vayunmathur/library/ui/ConfirmDialog.ktindex bea8880328..4c17a35f1d 100644--- a/library/ui/src/main/java/com/vayunmathur/library/ui/ConfirmDialog.kt+++ b/library/ui/src/main/java/com/vayunmathur/library/ui/ConfirmDialog.kt@@ -1,10 +1,19 @@ package com.vayunmathur.library.ui -import androidx.compose.material3.AlertDialog import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue+import androidx.compose.ui.Modifier+import androidx.compose.ui.focus.FocusRequester+import androidx.compose.ui.focus.focusRequester+import androidx.compose.ui.layout.onGloballyPositioned+import androidx.compose.ui.semantics.paneTitle+import androidx.compose.ui.semantics.semantics /** * The yes/no dialog, mostly for destructive actions.@@ -32,17 +41,39 @@ fun ConfirmDialog( // label is rendered from confirmLabel with the standard treatment. confirmContent: (@Composable () -> Unit)? = null, ) {+ // Initial focus (the FocusRequester pattern from GameResultOverlay):+ // paneTitle makes TalkBack announce this title, and keyboard/D-pad focus+ // lands on the dismiss button when there is one — the safe choice for a+ // destructive dialog — otherwise on the confirm button. Requesting in+ // onGloballyPositioned, not LaunchedEffect: a Dialog popup is not yet+ // laid out when effects first run, so an effect request is lost. The+ // shared AlertDialog wrapper applies the same placed-request to its+ // surface for dialogs without a known safe button.+ val initialFocus = remember { FocusRequester() }+ var focusRequested by remember { mutableStateOf(false) }+ val initialFocusModifier = Modifier+ .focusRequester(initialFocus)+ .onGloballyPositioned {+ if (!focusRequested) {+ focusRequested = true+ runCatching { initialFocus.requestFocus() }+ }+ } AlertDialog( onDismissRequest = onDismiss,+ modifier = Modifier.semantics { paneTitle = title }, title = { Text(title) }, text = message?.let { { Text(it) } }, confirmButton = {- TextButton(onClick = {- // Dismiss first so the dialog cannot linger over whatever the- // action navigates to.- onDismiss()- onConfirm()- }) {+ TextButton(+ onClick = {+ // Dismiss first so the dialog cannot linger over whatever the+ // action navigates to.+ onDismiss()+ onConfirm()+ },+ modifier = if (dismissLabel == null) initialFocusModifier else Modifier,+ ) { if (confirmContent != null) confirmContent() else Text( confirmLabel,@@ -51,6 +82,10 @@ fun ConfirmDialog( ) } },- dismissButton = dismissLabel?.let { { TextButton(onClick = onDismiss) { Text(it) } } },+ dismissButton = dismissLabel?.let {+ {+ TextButton(onClick = onDismiss, modifier = initialFocusModifier) { Text(it) }+ }+ }, ) }
library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt
diff --git a/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt b/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.ktindex d39f2dd620..d884b1a755 100644--- a/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt+++ b/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt@@ -46,14 +46,22 @@ import androidx.compose.material3.TextFieldDefaults import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.contentColorFor import androidx.compose.runtime.Composable+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier+import androidx.compose.ui.focus.FocusRequester+import androidx.compose.ui.focus.focusRequester+import androidx.compose.ui.focus.focusTarget import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.Shape import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.vector.ImageVector+import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.TextLayoutResult import androidx.compose.ui.text.TextStyle@@ -1000,6 +1008,17 @@ fun VerticalDivider( ) = androidx.compose.material3.VerticalDivider(modifier = modifier, thickness = thickness, color = color) // --- Alert dialog ---+/**+ * Shared [androidx.compose.material3.AlertDialog] wrapper.+ *+ * Accessibility: focus moves onto the dialog when it opens (the+ * [FocusRequester] + `focusTarget` pattern from `GameResultOverlay`), so+ * TalkBack and keyboard/D-pad users land on the dialog — announced via any+ * `paneTitle` the caller sets in [modifier] — instead of staying on the+ * control behind it that opened the dialog. Callers should set+ * `Modifier.semantics { paneTitle = <title> }` when they have a title+ * string, as [ConfirmDialog] does.+ */ @Composable fun AlertDialog( onDismissRequest: () -> Unit,@@ -1011,10 +1030,26 @@ fun AlertDialog( text: (@Composable () -> Unit)? = null, shape: Shape = androidx.compose.material3.AlertDialogDefaults.shape, properties: DialogProperties = DialogProperties(),-) = androidx.compose.material3.AlertDialog(- onDismissRequest = onDismissRequest, confirmButton = confirmButton, modifier = modifier,- dismissButton = dismissButton, icon = icon, title = title, text = text, shape = shape, properties = properties,-)+) {+ val focusRequester = remember { FocusRequester() }+ // A Dialog's popup is not laid out when a LaunchedEffect first runs, so+ // requesting focus there is lost ("FocusRequester is not initialized").+ // Request once the dialog surface is placed instead, exactly once.+ var focusRequested by remember { mutableStateOf(false) }+ androidx.compose.material3.AlertDialog(+ onDismissRequest = onDismissRequest, confirmButton = confirmButton,+ modifier = modifier+ .focusRequester(focusRequester)+ .focusTarget()+ .onGloballyPositioned {+ if (!focusRequested) {+ focusRequested = true+ runCatching { focusRequester.requestFocus() }+ }+ },+ dismissButton = dismissButton, icon = icon, title = title, text = text, shape = shape, properties = properties,+ )+} // --- Time picker --- @Composable
library/ui/src/test/java/com/vayunmathur/library/ui/A11ySemanticsSliceTest.kt
diff --git a/library/ui/src/test/java/com/vayunmathur/library/ui/A11ySemanticsSliceTest.kt b/library/ui/src/test/java/com/vayunmathur/library/ui/A11ySemanticsSliceTest.ktindex f8efecbf59..027d064926 100644--- a/library/ui/src/test/java/com/vayunmathur/library/ui/A11ySemanticsSliceTest.kt+++ b/library/ui/src/test/java/com/vayunmathur/library/ui/A11ySemanticsSliceTest.kt@@ -16,6 +16,7 @@ import androidx.compose.ui.semantics.SemanticsProperties import androidx.compose.ui.test.SemanticsMatcher import androidx.compose.ui.test.assert import androidx.compose.ui.test.assertIsDisplayed+import androidx.compose.ui.test.assertIsFocused import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.unit.dp@@ -77,6 +78,25 @@ class A11ySemanticsSliceTest { assertTrue(errors.isEmpty(), "unexpected Error semantics: $errors") } + @Test fun confirmDialogMovesFocusToDialogOnOpen() {+ rule.setContent {+ ConfirmDialog(+ title = "Delete?",+ confirmLabel = "Delete",+ onConfirm = {},+ onDismiss = {},+ dismissLabel = "Cancel",+ )+ }+ rule.waitForIdle()+ // The dialog is announced by its pane title, and initial focus lands+ // inside it on the safe (dismiss) button, not on whatever opened it.+ rule.onNode(+ SemanticsMatcher.expectValue(SemanticsProperties.PaneTitle, "Delete?"),+ ).assertIsDisplayed()+ rule.onNodeWithText("Cancel").assertIsFocused()+ }+ @Test fun loadingMessageIsAPoliteLiveRegion() { rule.setContent { LoadingState(message = "Fetching things") } rule.onNodeWithText("Fetching things").assert(