From a3e3932f736dd86663d0a82b08e5eaee65b2b7a6 Mon Sep 17 00:00:00 2001 From: QIU Date: Wed, 26 Aug 2026 06:17:38 +0000 Subject: [PATCH] fix(log): TalkBack could not find the mode row The tappable mode row used a bare `clickable`, which declares no role. TalkBack read it as two pieces of text with nothing to say it could be activated, so the only way to correct a wrong mode was invisible to anyone using a screen reader - and the row had just become the only way to reach that field. Role.Button plus an onClickLabel naming the action. The label lives in the resource files like every other user-visible string. Caught by self-review against the project's own accessibility pattern in Components.kt rather than by a test; Compose UI is not unit-tested here, so this class of defect is only ever found by reading. --- core/presentation/src/main/res/values-zh/strings.xml | 1 + core/presentation/src/main/res/values/strings.xml | 1 + .../main/java/com/rtbishop/look4sat/feature/radar/LogTab.kt | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/presentation/src/main/res/values-zh/strings.xml b/core/presentation/src/main/res/values-zh/strings.xml index 39acf7e4..00923f3c 100644 --- a/core/presentation/src/main/res/values-zh/strings.xml +++ b/core/presentation/src/main/res/values-zh/strings.xml @@ -277,6 +277,7 @@ 选择转发器 对方呼号 模式 + 修改模式 已存入本地日志 已上传 %1$d 条, %2$d 条仍在队列 已上传 %1$d 条 diff --git a/core/presentation/src/main/res/values/strings.xml b/core/presentation/src/main/res/values/strings.xml index 4c606b05..53b9fb93 100644 --- a/core/presentation/src/main/res/values/strings.xml +++ b/core/presentation/src/main/res/values/strings.xml @@ -308,6 +308,7 @@ Select transponder Callsign Mode + Edit the mode Saved to local log Uploaded %1$d, %2$d still queued Uploaded %1$d QSO diff --git a/feature/radar/src/main/java/com/rtbishop/look4sat/feature/radar/LogTab.kt b/feature/radar/src/main/java/com/rtbishop/look4sat/feature/radar/LogTab.kt index 502d819f..2d2026ef 100644 --- a/feature/radar/src/main/java/com/rtbishop/look4sat/feature/radar/LogTab.kt +++ b/feature/radar/src/main/java/com/rtbishop/look4sat/feature/radar/LogTab.kt @@ -58,6 +58,7 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment +import androidx.compose.ui.semantics.Role import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color @@ -279,6 +280,7 @@ private fun ExpandedLogInput( // previous one's mode and uploaded a value the operator never chose. var mode by remember(radio.uuid) { mutableStateOf(radio.uplinkMode ?: "FM") } var modeEditable by remember(radio.uuid) { mutableStateOf(false) } + val editModeLabel = stringResource(id = R.string.wavelog_mode_edit) // Calls logged during this pass, so a repeat can be mentioned without being blocked: the same // station on a later pass is a legitimate new contact. This replaces a 300ms window that // swallowed what it guessed were accidental double submissions - a guess that could discard @@ -442,7 +444,9 @@ private fun ExpandedLogInput( // 48dp is the Material Design minimum for anything tappable, and this row is // tapped to reveal the mode field. Padding alone left it around 20dp. .heightIn(min = 48.dp) - .clickable { modeEditable = true } + // Role.Button so TalkBack announces it as interactive. A bare clickable + // declares no role, so the row read as two labels and the tap was undiscoverable. + .clickable(role = Role.Button, onClickLabel = editModeLabel) { modeEditable = true } .padding(horizontal = LocalSpacing.current.extraExtraSmall) ) { Text(