Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Large text and touch size: sheets scroll, state lines may wrap, every control is at least 48 dp

Clauded098afc77b00
diff --git a/android/app/src/main/kotlin/com/coucou/android/ui/ServicesPanel.kt b/android/app/src/main/kotlin/com/coucou/android/ui/ServicesPanel.kt
index e1b14012..b28b412e 100644
--- a/android/app/src/main/kotlin/com/coucou/android/ui/ServicesPanel.kt
+++ b/android/app/src/main/kotlin/com/coucou/android/ui/ServicesPanel.kt
@@ -36,13 +36,13 @@ private fun ServiceCardView(c: ServiceCard) {
Panel {
Column(Modifier.fillMaxWidth().padding(Spacing.INSIDE.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) {
- Text(c.title, Modifier.weight(1f), style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 1, overflow = TextOverflow.Ellipsis)
+ Text(c.title, Modifier.weight(1f), style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 2, overflow = TextOverflow.Ellipsis)
c.reason?.let { Text(it, style = TypeScale.LABEL.style(t.textDim.c()), maxLines = 1, overflow = TextOverflow.Ellipsis) }
}
Text(c.headline, style = TypeScale.TITLE.style(t.text.c()), maxLines = 2, overflow = TextOverflow.Ellipsis)
for (line in c.items) {
Row(horizontalArrangement = Arrangement.spacedBy(Spacing.GAP.dp), verticalAlignment = Alignment.CenterVertically) {
- Text(line.label, Modifier.weight(1f), style = TypeScale.BODY.style(t.text.c()), maxLines = 1, overflow = TextOverflow.Ellipsis)
+ Text(line.label, Modifier.weight(1f), style = TypeScale.BODY.style(t.text.c()), maxLines = 2, overflow = TextOverflow.Ellipsis)
if (line.detail.isNotEmpty()) Text(line.detail, style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 1)
}
}
diff --git a/android/app/src/main/kotlin/com/coucou/android/ui/SettingsScreens.kt b/android/app/src/main/kotlin/com/coucou/android/ui/SettingsScreens.kt
index 4f404321..f592c79b 100644
--- a/android/app/src/main/kotlin/com/coucou/android/ui/SettingsScreens.kt
+++ b/android/app/src/main/kotlin/com/coucou/android/ui/SettingsScreens.kt
@@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
@@ -121,7 +122,7 @@ private fun TimeRow(label: String, minutes: Int, enabled: Boolean, onChange: (In
) {
Text(label, Modifier.weight(1f), style = TypeScale.BODY.style(t.text.c()))
StepButton("−", "$label, ${QuietHours.STEP} minutes earlier", enabled) { onChange(minutes - QuietHours.STEP) }
- Text(clock(minutes), Modifier.width(56.dp), style = TypeScale.BODY.style(t.text.c()).copy(fontFamily = FontFamily.Monospace), maxLines = 1)
+ Text(clock(minutes), Modifier.widthIn(min = 56.dp), style = TypeScale.BODY.style(t.text.c()).copy(fontFamily = FontFamily.Monospace), maxLines = 1)
StepButton("+", "$label, ${QuietHours.STEP} minutes later", enabled) { onChange(minutes + QuietHours.STEP) }
}
}
@@ -298,7 +299,7 @@ fun SettingsScreen(model: AppModel, onHistory: () -> Unit, onGallery: () -> Unit
Text(stringResource(R.string.about_credit), style = TypeScale.BODY.style(t.text.c()))
Text(
stringResource(R.string.about_repo),
- Modifier.clickable(role = Role.Button) { runCatching { uri.openUri(Attribution.REPO_URL) } },
+ Modifier.heightIn(min = Spacing.MIN_TOUCH.dp).clickable(role = Role.Button) { runCatching { uri.openUri(Attribution.REPO_URL) } }.padding(vertical = 14.dp),
style = TypeScale.BODY.style(t.text.c()).copy(textDecoration = TextDecoration.Underline),
)
Text(stringResource(R.string.about_assets), style = TypeScale.SECONDARY.style(t.textDim.c()))
diff --git a/android/app/src/main/kotlin/com/coucou/android/ui/UsagePanel.kt b/android/app/src/main/kotlin/com/coucou/android/ui/UsagePanel.kt
index 5e5adb13..f1ada635 100644
--- a/android/app/src/main/kotlin/com/coucou/android/ui/UsagePanel.kt
+++ b/android/app/src/main/kotlin/com/coucou/android/ui/UsagePanel.kt
@@ -53,7 +53,7 @@ private fun PlanBlock(name: String, plan: PlanUsage, nowMs: Long) {
Column(Modifier.fillMaxWidth().padding(Spacing.INSIDE.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) {
Text(name, Modifier.weight(1f), style = TypeScale.HEADLINE.style(t.text.c()))
- plan.plan?.let { Text(it, style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 1) }
+ plan.plan?.let { Text(it, style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 2) }
}
plan.fiveHour?.let { WindowBar(name, stringResource(R.string.usage_five_hours), it, nowMs, weekly = false) }
plan.sevenDay?.let { WindowBar(name, stringResource(R.string.usage_week), it, nowMs, weekly = true) }
@@ -85,6 +85,6 @@ private fun WindowBar(plan: String, label: String, w: PlanWindow, nowMs: Long, w
Box(Modifier.fillMaxWidth().height(8.dp).clip(RoundedCornerShape(4.dp)).background(t.secondaryButton.c()).clearAndSetSemantics { }) {
Box(Modifier.fillMaxWidth(pct / 100f).height(8.dp).clip(RoundedCornerShape(4.dp)).background(color))
}
- Text(reset, Modifier.clearAndSetSemantics { }, style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 1)
+ Text(reset, Modifier.clearAndSetSemantics { }, style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 2)
}
}
diff --git a/android/app/src/main/kotlin/com/coucou/android/ui/WardrobeScreen.kt b/android/app/src/main/kotlin/com/coucou/android/ui/WardrobeScreen.kt
index bde7db09..5cfcd5d8 100644
--- a/android/app/src/main/kotlin/com/coucou/android/ui/WardrobeScreen.kt
+++ b/android/app/src/main/kotlin/com/coucou/android/ui/WardrobeScreen.kt
@@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
@@ -175,7 +176,7 @@ private fun OutfitCell(label: String, chosen: Boolean, onClick: () -> Unit, icon
val shape = RoundedCornerShape(Radii.PANEL.dp)
val selectedText = stringResource(R.string.wardrobe_selected)
Column(
- Modifier.fillMaxWidth().clip(shape).background(t.panel.c()).border(if (chosen) 2.dp else 1.dp, if (chosen) t.text.c() else t.line.c(), shape)
+ Modifier.fillMaxWidth().heightIn(min = Spacing.MIN_TOUCH.dp).clip(shape).background(t.panel.c()).border(if (chosen) 2.dp else 1.dp, if (chosen) t.text.c() else t.line.c(), shape)
.clickable(role = Role.RadioButton, onClick = onClick)
.semantics { selected = chosen; contentDescription = if (chosen) "$label, $selectedText" else label }
.padding(vertical = 12.dp, horizontal = 4.dp),
diff --git a/android/app/src/test/kotlin/com/coucou/android/AccessibilityGuardTest.kt b/android/app/src/test/kotlin/com/coucou/android/AccessibilityGuardTest.kt
new file mode 100644
index 00000000..bf9b58c7
--- /dev/null
+++ b/android/app/src/test/kotlin/com/coucou/android/AccessibilityGuardTest.kt
@@ -0,0 +1,70 @@
+package com.coucou.android
+
+import com.coucou.android.core.Spacing
+import java.io.File
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+/** TalkBack, touch size and large text: guards on the Compose sources, which cannot run on a JVM. */
+class AccessibilityGuardTest {
+ private val ui = File("src/main/kotlin/com/coucou/android/ui")
+ private fun src(name: String) = File(ui, name).readText()
+
+ @Test fun theMinimumTouchTargetIs48dp() = assertEquals(48, Spacing.MIN_TOUCH)
+
+ @Test fun everyTappableThingIsAtLeastAMinimumTouchTarget() {
+ // Within the five lines above a click handler there must be a height (or size) of at least 48 dp, or the row is taller by design.
+ val bigRows = Regex("""(heightIn\(min = (Spacing\.MIN_TOUCH|5\d|6\d|7\d)|sizeIn\(|\.size\((Spacing\.MIN_TOUCH|5\d|6\d)|ListRow\()""")
+ for (f in ui.listFiles { it.extension == "kt" }!!.sortedBy { it.name }) {
+ val lines = f.readLines()
+ lines.forEachIndexed { i, line ->
+ if (line.trimStart().startsWith("import")) return@forEachIndexed
+ if (!(line.contains(".clickable(") || line.contains(".selectable(") || line.contains(".toggleable("))) return@forEachIndexed
+ val window = lines.subList(maxOf(0, i - 5), i + 1).joinToString("\n")
+ // The island's cards and the full-width settings rows are tall by construction; a scrim is not a control.
+ val exempt = f.name == "IslandOverlay.kt" || line.contains("indication = null") || window.contains("fillMaxSize()")
+ assertTrue("${f.name}:${i + 1} is tappable but its height is not at least 48 dp", exempt || bigRows.containsMatchIn(window))
+ }
+ }
+ }
+
+ @Test fun agentsAndTabsAreSpokenWithTheirStateNotOnlyAColour() {
+ val home = src("HomePanel.kt")
+ assertTrue(home.contains("SpokenLabels.agent(name, state, line)"))
+ assertTrue(home.contains("SpokenLabels.agent(name, stringResource(stateLabel(state)), HomeText.line(focus))"))
+ assertTrue(src("BottomBar.kt").contains("SpokenLabels.tab("))
+ }
+
+ @Test fun aRequestIsAnnouncedWhenItsSheetRises() {
+ val sheets = src("Sheets.kt")
+ assertTrue(sheets.contains("paneTitle = announce"))
+ assertTrue(sheets.contains("SpokenLabels.approval("))
+ // The scrim behind a sheet is a labelled button for TalkBack, not a silent area.
+ assertTrue(sheets.contains("contentDescription = closeLabel"))
+ // The island speaks too: a request at once.
+ assertTrue(src("IslandOverlay.kt").contains("LiveRegionMode.Assertive"))
+ }
+
+ @Test fun aSheetScrollsSoALargeFontNeverHidesDenyOrAllow() {
+ val sheets = src("Sheets.kt")
+ val host = sheets.substringAfter("fun BottomSheetHost").substringBefore("/** The colour of an agent")
+ assertTrue(host.contains(".verticalScroll(rememberScrollState())"))
+ }
+
+ @Test fun textThatCarriesAStateIsNotCutToOneLine() {
+ // At a font scale of 1.3 these lines would lose their end; they may take two lines.
+ val home = src("HomePanel.kt")
+ assertTrue(home.contains("Text(line ?: state, style = TypeScale.SECONDARY.style(t.textDim.c()), maxLines = 2"))
+ assertTrue(home.contains("Text(linkText, Modifier.weight(1f), style = TypeScale.LABEL.style(dim), maxLines = 2"))
+ assertTrue(src("UsagePanel.kt").contains("maxLines = 2"))
+ // A time and a count in a fixed 56 dp box would be cut by a large font.
+ assertFalse(src("SettingsScreens.kt").contains("Modifier.width(56.dp)"))
+ }
+
+ @Test fun choicesAreReadAsSelectedRadioButtons() {
+ val settings = src("SettingsScreens.kt")
+ assertTrue(settings.contains("this.selected = value == selected") && settings.contains("role = Role.RadioButton"))
+ }
+}