notes: remove manual watch sync chip from wear list
- Commit
b83b54570ba27c01c59a5850831326096d2d3412- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-05 16:53 UTC (19 hours ago)
- Parents
4261eb1
Phone-to-watch sync is now fully automatic over the Watch conduit, so the manual 'Sync now' chip on the wear notes list is dead weight. Remove the Sync chip, the sync-result note it fed, its onRequestSync plumbing and the wear_request_sync/wear_sync_requested/wear_no_phone strings, and update the wear screenshot preview. Automatic WearNotesSync publishing and pending-op flush are unchanged. Verified: :notes:lint :notes:lintVitalRelease :notes:testDevUnitTest pass; :notes:metadata regenerated.
Diff
notes/src/main/java/com/vayunmathur/notes/ui/WearNotesListScreen.kt
diff --git a/notes/src/main/java/com/vayunmathur/notes/ui/WearNotesListScreen.kt b/notes/src/main/java/com/vayunmathur/notes/ui/WearNotesListScreen.ktindex d468e42a9f..1f6a5e5ded 100644--- a/notes/src/main/java/com/vayunmathur/notes/ui/WearNotesListScreen.kt+++ b/notes/src/main/java/com/vayunmathur/notes/ui/WearNotesListScreen.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.notes.R import com.vayunmathur.notes.data.WearNotesStore-import com.vayunmathur.notes.sync.WearLinkBridge-import kotlinx.coroutines.launch /** Round-screen recent-notes list: most recently updated first, from the local store (offline-safe). */ @Composable@@ -35,8 +29,7 @@ fun WearNotesListScreen( ) { val notes by store.notes.collectAsState() val pending by store.pendingOps.collectAsState()- val context = LocalContext.current- WearNotesListContent(notes = notes, pendingCount = pending.size, onOpenNote = onOpenNote, onCreateNote = onCreateNote, onRequestSync = { WearLinkBridge.requestSync(context) })+ WearNotesListContent(notes = notes, pendingCount = pending.size, onOpenNote = onOpenNote, onCreateNote = onCreateNote) } /**@@ -49,12 +42,7 @@ internal fun WearNotesListContent( pendingCount: Int, onOpenNote: (String) -> Unit, onCreateNote: () -> 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) val listState = rememberScalingLazyListState() ScalingLazyColumn(state = listState) {@@ -76,16 +64,6 @@ internal fun WearNotesListContent( ) } }- 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 = onCreateNote,@@ -116,17 +94,5 @@ internal fun WearNotesListContent( ) } }- 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),- )- } } }
notes/src/main/res/values/wear_strings.xml
diff --git a/notes/src/main/res/values/wear_strings.xml b/notes/src/main/res/values/wear_strings.xmlindex 0325f66dc7..93607ad1fb 100644--- a/notes/src/main/res/values/wear_strings.xml+++ b/notes/src/main/res/values/wear_strings.xml@@ -2,9 +2,6 @@ <resources> <string name="wear_empty">No notes synced yet. Open Notes on your phone to sync this watch.</string> <string name="wear_new_note">New note</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_truncated">Showing your most recent notes; the rest stays on your phone</string> <string name="wear_body_truncated">… (full text on your phone)</string> <string name="wear_read_only_rich">Contains drawings or images from your phone — view only here. You can still delete it.</string>
notes/src/screenshotTest/kotlin/com/vayunmathur/notes/ui/WearMetadataPreviews.kt
diff --git a/notes/src/screenshotTest/kotlin/com/vayunmathur/notes/ui/WearMetadataPreviews.kt b/notes/src/screenshotTest/kotlin/com/vayunmathur/notes/ui/WearMetadataPreviews.ktindex baab8bbd37..ff89a646a1 100644--- a/notes/src/screenshotTest/kotlin/com/vayunmathur/notes/ui/WearMetadataPreviews.kt+++ b/notes/src/screenshotTest/kotlin/com/vayunmathur/notes/ui/WearMetadataPreviews.kt@@ -33,7 +33,7 @@ class WearMetadataPreviews { @Composable fun Preview1ListRound() { RoundPreview {- WearNotesListContent(notes = fixtureNotes, pendingCount = 0, onOpenNote = {}, onCreateNote = {}, onRequestSync = { true })+ WearNotesListContent(notes = fixtureNotes, pendingCount = 0, onOpenNote = {}, onCreateNote = {}) } }