communicate: remove manual watch sync chip from wear list
- Commit
b87836134959af115dab4f5dfee44b0712c866c8- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-05 16:53 UTC (18 hours ago)
- Parents
847856d
Phone-to-watch sync is now fully automatic over the Watch conduit, so the 'Sync now' chip on the wear conversation list is dead weight. Remove the chip, the sync-result note, its onRequestSync plumbing and the wear_request_sync/wear_sync_requested strings, and update the wear preview. Automatic WearCommunicateSync snapshot publishing is unchanged; wear_no_phone is kept because the thread screen still uses it. Verified: :communicate:lint :communicate:lintVitalRelease pass; :communicate:testDevUnitTest failure in Y1RegistrationScreensTest also fails on clean origin/main; :communicate:metadata regenerated.
Diff
communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.ktindex a34b7dcd2a..a5dea9eb15 100644--- a/communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.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.communicate.R import com.vayunmathur.communicate.data.WearCommunicateStore-import com.vayunmathur.communicate.sync.WearLinkBridge-import kotlinx.coroutines.launch /** Merged conversation list (all lines), most recent first, from the local snapshot (offline-safe). */ @Composable@@ -38,8 +32,7 @@ fun WearConversationListScreen( val snapshot by store.snapshot.collectAsState() val pending by store.pendingOps.collectAsState() val alert by store.lastAlert.collectAsState()- val context = LocalContext.current- WearConversationListContent(snapshot = snapshot, pendingCount = pending.size, alert = alert, onOpenThread = onOpenThread, onOpenAlert = { store.clearAlert(); onOpenThread(it.threadKey) }, onOpenCalls = onOpenCalls, onOpenVoicemail = onOpenVoicemail, onOpenPhoneOnly = onOpenPhoneOnly, onRequestSync = { WearLinkBridge.requestSync(context) })+ WearConversationListContent(snapshot = snapshot, pendingCount = pending.size, alert = alert, onOpenThread = onOpenThread, onOpenAlert = { store.clearAlert(); onOpenThread(it.threadKey) }, onOpenCalls = onOpenCalls, onOpenVoicemail = onOpenVoicemail, onOpenPhoneOnly = onOpenPhoneOnly) } /** Stateless conversation list behind [WearConversationListScreen]: snapshot/alert are parameters for previews. */@@ -53,12 +46,7 @@ internal fun WearConversationListContent( onOpenCalls: () -> Unit, onOpenVoicemail: () -> Unit, onOpenPhoneOnly: () -> 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 {@@ -99,16 +87,6 @@ internal fun WearConversationListContent( ) } }- 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 = onOpenCalls,@@ -186,21 +164,5 @@ internal fun WearConversationListContent( modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp), ) }- item {- Chip(- onClick = {- scope.launch {- syncNote = if (onRequestSync()) {- requestedText- } else {- noPhoneText- }- }- },- label = { Text(stringResource(R.string.wear_request_sync), maxLines = 1) },- colors = ChipDefaults.secondaryChipColors(),- modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),- )- } } }
communicate/src/main/res/values/wear_strings.xml
diff --git a/communicate/src/main/res/values/wear_strings.xml b/communicate/src/main/res/values/wear_strings.xmlindex b0c627ae00..080f18cb30 100644--- a/communicate/src/main/res/values/wear_strings.xml+++ b/communicate/src/main/res/values/wear_strings.xml@@ -3,8 +3,6 @@ <string name="wear_empty">No conversations synced yet. Open Communicate on your phone to sync this watch.</string> <string name="wear_calls">Calls</string> <string name="wear_voicemail">Voicemail</string>- <string name="wear_request_sync">Sync now</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 action(s)</string> <string name="wear_truncated">Showing the most recent items; the rest stays on your phone</string>
communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.kt
diff --git a/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.kt b/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.ktindex 8941c1908f..e240353271 100644--- a/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.kt+++ b/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.kt@@ -42,7 +42,7 @@ class WearMetadataPreviews { @Composable fun Preview1ConversationsRound() { RoundPreview {- WearConversationListContent(snapshot = fixtureSnapshot, pendingCount = 0, alert = null, onOpenThread = {}, onOpenAlert = {}, onOpenCalls = {}, onOpenVoicemail = {}, onOpenPhoneOnly = {}, onRequestSync = { true })+ WearConversationListContent(snapshot = fixtureSnapshot, pendingCount = 0, alert = null, onOpenThread = {}, onOpenAlert = {}, onOpenCalls = {}, onOpenVoicemail = {}, onOpenPhoneOnly = {}) } }