Modern Apps git

← Modern-Apps.git

todo: remove manual watch sync chip from wear home

Commit
847856d17b93f5e47a1e7fd879cc0e40bf080ea7
Author
Vayun Mathur <[email protected]>
When
2026-12-05 16:53 UTC (15 hours ago)
Parents
f76b193
Phone-to-watch sync is now fully automatic over the Watch conduit, so the 'Sync' chip on the wear todo home is dead weight.

Remove the chip, the sync-result note, its onRequestSync plumbing and the wear_sync/wear_sync_requested/wear_no_phone strings; the wear_no_page empty text no longer tells the user to tap Sync. Update the wear preview. Automatic WearTodoSync catalog/page publishing is unchanged.

Verified: :todo:lint :todo:lintVitalRelease pass; :todo:testDevUnitTest full-run failure in TodoComposeFinalTest passes in isolation and is unrelated; :todo:metadata regenerated.

Diff

todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.kt
diff --git a/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.ktindex 44a4e7c19e..6326db4795 100644--- a/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.kt@@ -5,12 +5,8 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember-import androidx.compose.runtime.rememberCoroutineScope-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.text.style.TextAlign import androidx.compose.ui.unit.dp@@ -23,8 +19,6 @@ import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import com.vayunmathur.todo.R import com.vayunmathur.todo.data.WearTodoStore-import com.vayunmathur.todo.sync.WearLinkBridge-import kotlinx.coroutines.launch  /**  * Watch home = the phone app's drawer: smart views in phone order, then@@ -39,8 +33,7 @@ fun WearTodoHomeScreen( ) {     val catalog by store.catalog.collectAsState()     val pending by store.pendingOps.collectAsState()-    val context = LocalContext.current-    WearTodoHomeContent(catalog = catalog, pendingCount = pending.size, onOpenPage = onOpenPage, onQuickAdd = onQuickAdd, onRequestSync = { WearLinkBridge.requestSync(context) })+    WearTodoHomeContent(catalog = catalog, pendingCount = pending.size, onOpenPage = onOpenPage, onQuickAdd = onQuickAdd) }  /** Stateless home behind [WearTodoHomeScreen]: catalog/pending count are parameters for previews. */@@ -50,12 +43,7 @@ internal fun WearTodoHomeContent(     pendingCount: Int,     onOpenPage: (String) -> Unit,     onQuickAdd: () -> Unit,-    onRequestSync: suspend () -> Boolean, ) {-    val scope = rememberCoroutineScope()-    var syncNote by remember { mutableStateOf<String?>(null) }-    val requestedText = stringResource(R.string.wear_sync_requested)-    val noPhoneText = stringResource(R.string.wear_no_phone)      ScalingLazyColumn(state = rememberScalingLazyListState()) {         item {@@ -76,16 +64,6 @@ internal fun WearTodoHomeContent(                 )             }         }-        syncNote?.let { note ->-            item {-                Text(-                    note,-                    style = MaterialTheme.typography.body2,-                    textAlign = TextAlign.Center,-                    modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 4.dp),-                )-            }-        }         item {             Chip(                 onClick = onQuickAdd,@@ -116,21 +94,5 @@ internal fun WearTodoHomeContent(                 )             }         }-        item {-            Chip(-                onClick = {-                    scope.launch {-                        syncNote = if (onRequestSync()) {-                            requestedText-                        } else {-                            noPhoneText-                        }-                    }-                },-                label = { Text(stringResource(R.string.wear_sync), maxLines = 1) },-                colors = ChipDefaults.secondaryChipColors(),-                modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),-            )-        }     } }
todo/src/main/res/values/wear_strings.xml
diff --git a/todo/src/main/res/values/wear_strings.xml b/todo/src/main/res/values/wear_strings.xmlindex e68b478c8f..4c315f16db 100644--- a/todo/src/main/res/values/wear_strings.xml+++ b/todo/src/main/res/values/wear_strings.xml@@ -1,11 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <resources>     <string name="wear_empty">No tasks synced yet. Open Todo on your phone to sync this watch.</string>-    <string name="wear_no_page">This page has not synced yet. Open Todo on your phone, or tap Sync.</string>+    <string name="wear_no_page">This page has not synced yet. Open Todo on your phone.</string>     <string name="wear_quick_add">Quick add</string>-    <string name="wear_sync">Sync</string>-    <string name="wear_sync_requested">Asked your phone for a fresh copy</string>-    <string name="wear_no_phone">Phone not reachable — showing the last synced copy</string>     <string name="wear_pending">Waiting for your phone to confirm %1$d change(s)</string>     <string name="wear_load_more">Load more</string>     <string name="wear_complete">Complete</string>
todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.kt
diff --git a/todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.kt b/todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.ktindex d4c6d9309f..fdfa7c398a 100644--- a/todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.kt+++ b/todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.kt@@ -44,7 +44,6 @@ class WearMetadataPreviews {                 pendingCount = 0,                 onOpenPage = {},                 onQuickAdd = {},-                onRequestSync = { true },             )         }     }