Modern Apps git

← Modern-Apps.git

everysync: route snapshot restore dialog and cover AccountDetail

Commit
69910ed20cb62344b428d42efcfaba96107f1433
Author
Vayun Mathur <[email protected]>
When
2026-12-02 01:31 UTC (4 days ago)
Parents
0ce8462
DialogAsRoute: SnapshotSection held the restore confirmation in
remember-state (pending SnapshotMeta) and rendered AlertDialog
inline. The snapshot identity is fully serializable, so the dialog
is now Route.RestoreSnapshotDialog with the snapshot fields in the
route arguments, rendered with DialogPage() metadata in
Navigation.kt. Its stateless content lives under ui/dialogs/ as
RestoreSnapshotDialog (library ConfirmDialog, so confirm dismisses
before restoring - the host never double-pops). SnapshotSection
now only reports onRestoreRequest; AccountDetailActions gains
openRestoreSnapshot, implemented by the binder with backStack.add.
No local-exception marker: nothing non-serializable is involved.

RouteScreenshotCoverage: AccountDetail had a capture named
3-account, which does not name the account-detail route key.
Renamed to 3-account-detail, and added
7-restore-snapshot-dialog for the new dialog route, both
rendering the real stateless screens with fixed fixtures.

FixtureDeterminism (further fatal in :everysync:lint beyond the
two named errors): BinderNavigationWave3Test built WorkerParameters
with UUID.randomUUID(); replaced with a fixed UUID constant.

Tests were updated to the new seam: row taps now assert the
restore request for the exact snapshot, and a new UiComposeTest
covers RestoreSnapshotDialog confirm/dismiss. everysync/AGENTS.md
lists the new route and dialog file. No lint config, detector,
baseline or exemption markers were changed, so no exceptions.tsv
regeneration was needed.

Verified:
./gradlew :everysync:lint :everysync:lintVitalRelease
  :everysync:testDevUnitTest :everysync:compileReleaseKotlin
BUILD SUCCESSFUL

Diff

everysync/AGENTS.md
diff --git a/everysync/AGENTS.md b/everysync/AGENTS.mdindex f5554c4ca5..2842002104 100644--- a/everysync/AGENTS.md+++ b/everysync/AGENTS.md@@ -21,7 +21,7 @@ Host: `api.maproj.org` (Cloudflare FIRST_PARTY pins). Server checkout: `../locat - Five sink types: Calendar / Contacts / Note / Password / Todo (incl. IPC sinks into sibling apps) - WorkManager periodic sync + daily snapshots, rescheduled on boot/update via `BootReceiver` **Architecture / data-flow:** `data/` (accounts/tokens) + `platform/` (account authenticator) → `provider/` registry + `SyncProvider` impls (incl. `E2eeProvider`) → `sync/` engine/scheduler/worker + relay blob store/merge + vault keys/roster/owner-transfer → `data/sink/` writers + `domain/format/` iCal/VCard. `EverySyncApplication.onCreate`: `NetworkClient.init(FIRST_PARTY)` → schedule periodic + daily snapshot → one-time Keystore key migration. `MainActivity`: join-link parse → `requestToJoin` + snackbar confirm.-**Entry points + reading order:** `EverySyncApplication.kt` → `MainActivity.kt` (`parseJoinLink`/`handleJoinLink`) → `Route` (`Accounts` / `AddAccount` / `AccountDetail` / `Settings`) → `sync/SyncEngine.kt` → `provider/ProviderRegistry.kt`.+**Entry points + reading order:** `EverySyncApplication.kt` → `MainActivity.kt` (`parseJoinLink`/`handleJoinLink`) → `Route` (`Accounts` / `AddAccount` / `AccountDetail` / `Settings` / `RestoreSnapshotDialog`) → `sync/SyncEngine.kt` → `provider/ProviderRegistry.kt`. **Gotchas:** - KEEP `EverySyncApplication` — it does real work (network init, scheduler, key migration), not boilerplate; do NOT delete it as a "shared-base" cleanup. Manifest `android:name` must stay. - `singleTop` warm-start join links arrive via `onNewIntent`, not a fresh `onCreate`@@ -83,6 +83,8 @@ Host: `api.maproj.org` (Cloudflare FIRST_PARTY pins). Server checkout: `../locat - com/vayunmathur/everysync/ui/AccountDetailScreen.kt - com/vayunmathur/everysync/ui/SettingsScreen.kt - com/vayunmathur/everysync/ui/VaultSharingSection.kt+- com/vayunmathur/everysync/ui/SnapshotSection.kt — snapshot rows; Restore pushes `Route.RestoreSnapshotDialog`+- com/vayunmathur/everysync/ui/dialogs/RestoreSnapshotDialog.kt — stateless restore confirmation rendered by the dialog route entry in `Navigation.kt`  ## Verify (this module only) ```
everysync/src/main/java/com/vayunmathur/everysync/Navigation.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/Navigation.kt b/everysync/src/main/java/com/vayunmathur/everysync/Navigation.ktindex 57557c1b29..f7b31aefff 100644--- a/everysync/src/main/java/com/vayunmathur/everysync/Navigation.kt+++ b/everysync/src/main/java/com/vayunmathur/everysync/Navigation.kt@@ -2,10 +2,12 @@ package com.vayunmathur.everysync  import androidx.compose.runtime.Composable import com.vayunmathur.everysync.platform.EverySyncViewModel+import com.vayunmathur.everysync.sync.SnapshotStore.SnapshotMeta import com.vayunmathur.everysync.ui.AccountDetailScreen import com.vayunmathur.everysync.ui.AccountsScreen import com.vayunmathur.everysync.ui.AddAccountScreen import com.vayunmathur.everysync.ui.SettingsScreen+import com.vayunmathur.everysync.ui.dialogs.RestoreSnapshotDialog import com.vayunmathur.library.util.DialogPage import com.vayunmathur.library.util.ListDetailPage import com.vayunmathur.library.util.ListPage@@ -26,5 +28,24 @@ fun Navigation(viewModel: EverySyncViewModel) {             AccountDetailScreen(backStack, viewModel, it.accountName)         }         entry<Route.Settings>(metadata = ListPage()) { SettingsScreen(backStack, viewModel) }+        entry<Route.RestoreSnapshotDialog>(metadata = DialogPage()) { route ->+            RestoreSnapshotDialog(+                dayEpochMs = route.dayEpochMs,+                dataType = route.dataType,+                onDismiss = { backStack.pop() },+                onConfirm = {+                    viewModel.restoreSnapshot(+                        SnapshotMeta(+                            vaultId = route.vaultId,+                            dataType = route.dataType,+                            dayEpochMs = route.dayEpochMs,+                            recordCount = route.recordCount,+                            blobCount = route.blobCount,+                            takenAtMs = route.takenAtMs,+                        ),+                    )+                },+            )+        }     } }
everysync/src/main/java/com/vayunmathur/everysync/Route.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/Route.kt b/everysync/src/main/java/com/vayunmathur/everysync/Route.ktindex 4ba39c26a2..447db78e3f 100644--- a/everysync/src/main/java/com/vayunmathur/everysync/Route.kt+++ b/everysync/src/main/java/com/vayunmathur/everysync/Route.kt@@ -14,4 +14,20 @@ sealed interface Route : NavKey {     @Serializable data class AccountDetail(val accountName: String) : Route     /** Destination showing EverySync settings. */     @Serializable data object Settings : Route++    /**+     * Restore-snapshot confirmation dialog for one snapshot. The snapshot+     * identity travels in the arguments (never as pending-target state in+     * the account screen that asked), so Back, process death and+     * screenshots all see which snapshot is being restored.+     */+    @Serializable+    data class RestoreSnapshotDialog(+        val vaultId: String,+        val dataType: String,+        val dayEpochMs: Long,+        val recordCount: Int,+        val blobCount: Int = 0,+        val takenAtMs: Long = 0L,+    ) : Route }
everysync/src/main/java/com/vayunmathur/everysync/platform/EverySyncUiContract.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/platform/EverySyncUiContract.kt b/everysync/src/main/java/com/vayunmathur/everysync/platform/EverySyncUiContract.ktindex 623e93d63e..a8ba49a919 100644--- a/everysync/src/main/java/com/vayunmathur/everysync/platform/EverySyncUiContract.kt+++ b/everysync/src/main/java/com/vayunmathur/everysync/platform/EverySyncUiContract.kt@@ -98,6 +98,8 @@ interface AccountDetailActions {     fun back() {}     /** Restores a daily snapshot (replays its records through the sinks). */     fun restoreSnapshot(snapshot: SnapshotMeta) {}+    /** Pushes the restore-snapshot confirmation dialog route for [snapshot]. */+    fun openRestoreSnapshot(snapshot: SnapshotMeta) {}     /** Takes today's snapshots now (idempotent — same-day vaults are skipped). */     fun snapshotNow() {} 
everysync/src/main/java/com/vayunmathur/everysync/ui/AccountDetailScreen.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/ui/AccountDetailScreen.kt b/everysync/src/main/java/com/vayunmathur/everysync/ui/AccountDetailScreen.ktindex fb677d083e..e9f3f9905e 100644--- a/everysync/src/main/java/com/vayunmathur/everysync/ui/AccountDetailScreen.kt+++ b/everysync/src/main/java/com/vayunmathur/everysync/ui/AccountDetailScreen.kt@@ -53,6 +53,19 @@ fun AccountDetailScreen(backStack: NavBackStack<Route>, viewModel: EverySyncView              override fun restoreSnapshot(snapshot: SnapshotMeta) = viewModel.restoreSnapshot(snapshot) +            override fun openRestoreSnapshot(snapshot: SnapshotMeta) {+                backStack.add(+                    Route.RestoreSnapshotDialog(+                        vaultId = snapshot.vaultId,+                        dataType = snapshot.dataType,+                        dayEpochMs = snapshot.dayEpochMs,+                        recordCount = snapshot.recordCount,+                        blobCount = snapshot.blobCount,+                        takenAtMs = snapshot.takenAtMs,+                    ),+                )+            }+             override fun snapshotNow() = viewModel.snapshotNow()              override fun removeAccount(accountName: String) {@@ -185,7 +198,7 @@ fun AccountDetailScreen(state: AccountDetailUiState, actions: AccountDetailActio             SnapshotSection(                 snapshots = state.snapshots,                 restoring = state.restoring,-                onRestore = { actions.restoreSnapshot(it) },+                onRestoreRequest = { actions.openRestoreSnapshot(it) },                 onSnapshotNow = { actions.snapshotNow() },             )         }
everysync/src/main/java/com/vayunmathur/everysync/ui/SnapshotSection.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/ui/SnapshotSection.kt b/everysync/src/main/java/com/vayunmathur/everysync/ui/SnapshotSection.ktindex e7de2436d5..4dc3982ca6 100644--- a/everysync/src/main/java/com/vayunmathur/everysync/ui/SnapshotSection.kt+++ b/everysync/src/main/java/com/vayunmathur/everysync/ui/SnapshotSection.kt@@ -5,10 +5,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable-import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOf-import androidx.compose.runtime.remember-import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.pluralStringResource@@ -16,30 +12,28 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.vayunmathur.everysync.R import com.vayunmathur.everysync.sync.SnapshotStore.SnapshotMeta-import com.vayunmathur.library.ui.AlertDialog import com.vayunmathur.library.ui.DateString import com.vayunmathur.library.ui.ListItem import com.vayunmathur.library.ui.OutlinedButton import com.vayunmathur.library.ui.SettingsSection import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TextButton import com.vayunmathur.library.ui.is24Hour import kotlin.time.Instant  /**- * Daily snapshot recovery: one row per restorable day (newest first) with a- * confirm dialog. Restore replays records through the sinks as normal merge- * input — newer edits win by LWW where they conflict, nothing is overwritten.+ * Daily snapshot recovery: one row per restorable day (newest first).+ * Tapping Restore pushes the `Route.RestoreSnapshotDialog` destination;+ * restore replays records through the sinks as normal merge input — newer+ * edits win by LWW where they conflict, nothing is overwritten.  */ @Composable fun SnapshotSection(     snapshots: List<SnapshotMeta>,     restoring: Boolean,-    onRestore: (SnapshotMeta) -> Unit,+    onRestoreRequest: (SnapshotMeta) -> Unit,     onSnapshotNow: () -> Unit, ) {     val context = LocalContext.current-    var pending: SnapshotMeta? by remember { mutableStateOf(null) }      SettingsSection(title = stringResource(R.string.snapshots_title)) {         Text(stringResource(R.string.snapshots_description))@@ -73,7 +67,7 @@ fun SnapshotSection(                     },                     trailingContent = {                         OutlinedButton(-                            onClick = { pending = snapshot },+                            onClick = { onRestoreRequest(snapshot) },                             enabled = !restoring,                             modifier = Modifier.fillMaxWidth(0.4f),                         ) { Text(stringResource(R.string.snapshot_restore)) }@@ -82,29 +76,4 @@ fun SnapshotSection(             }         }     }--    pending?.let { snapshot ->-        val day = DateString.dateTime(-            Instant.fromEpochMilliseconds(snapshot.dayEpochMs),-            is24Hour(context),-        )-        AlertDialog(-            onDismissRequest = { pending = null },-            title = { Text(stringResource(R.string.snapshot_restore_title)) },-            text = { Text(stringResource(R.string.snapshot_restore_confirm, day, snapshot.dataType)) },-            confirmButton = {-                TextButton(-                    onClick = {-                        pending = null-                        onRestore(snapshot)-                    },-                ) { Text(stringResource(R.string.snapshot_restore)) }-            },-            dismissButton = {-                TextButton(onClick = { pending = null }) {-                    Text(stringResource(com.vayunmathur.library.ui.R.string.cancel))-                }-            },-        )-    } }
everysync/src/main/java/com/vayunmathur/everysync/ui/dialogs/RestoreSnapshotDialog.kt
diff --git a/everysync/src/main/java/com/vayunmathur/everysync/ui/dialogs/RestoreSnapshotDialog.kt b/everysync/src/main/java/com/vayunmathur/everysync/ui/dialogs/RestoreSnapshotDialog.ktnew file mode 100644index 0000000000..8f50cc0569--- /dev/null+++ b/everysync/src/main/java/com/vayunmathur/everysync/ui/dialogs/RestoreSnapshotDialog.kt@@ -0,0 +1,33 @@+package com.vayunmathur.everysync.ui.dialogs++import androidx.compose.runtime.Composable+import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.stringResource+import com.vayunmathur.everysync.R+import com.vayunmathur.library.ui.ConfirmDialog+import com.vayunmathur.library.ui.DateString+import com.vayunmathur.library.ui.is24Hour+import kotlin.time.Instant++/** The restore-snapshot confirmation, stateless for previews/tests. */+@Composable+fun RestoreSnapshotDialog(+    dayEpochMs: Long,+    dataType: String,+    onConfirm: () -> Unit,+    onDismiss: () -> Unit,+) {+    val context = LocalContext.current+    val day = DateString.dateTime(+        Instant.fromEpochMilliseconds(dayEpochMs),+        is24Hour(context),+    )+    ConfirmDialog(+        title = stringResource(R.string.snapshot_restore_title),+        message = stringResource(R.string.snapshot_restore_confirm, day, dataType),+        confirmLabel = stringResource(R.string.snapshot_restore),+        dismissLabel = stringResource(com.vayunmathur.library.ui.R.string.cancel),+        onConfirm = onConfirm,+        onDismiss = onDismiss,+    )+}
everysync/src/screenshotTest/kotlin/com/vayunmathur/everysync/ui/MetadataPreviews.kt
diff --git a/everysync/src/screenshotTest/kotlin/com/vayunmathur/everysync/ui/MetadataPreviews.kt b/everysync/src/screenshotTest/kotlin/com/vayunmathur/everysync/ui/MetadataPreviews.ktindex 799d751992..b9915e2114 100644--- a/everysync/src/screenshotTest/kotlin/com/vayunmathur/everysync/ui/MetadataPreviews.kt+++ b/everysync/src/screenshotTest/kotlin/com/vayunmathur/everysync/ui/MetadataPreviews.kt@@ -10,6 +10,7 @@ import androidx.compose.ui.tooling.preview.Preview import com.android.tools.screenshot.PreviewTest import com.vayunmathur.everysync.data.Settings import com.vayunmathur.everysync.provider.DataType+import com.vayunmathur.everysync.ui.dialogs.RestoreSnapshotDialog import com.vayunmathur.everysync.platform.AccountDetailActions import com.vayunmathur.everysync.platform.AccountDetailUiState import com.vayunmathur.everysync.platform.AccountRow@@ -76,7 +77,7 @@ class MetadataPreviews {     }      @PreviewTest-    @Preview(name = "3-account", device = PHONE, group = "phone", showSystemUi = true)+    @Preview(name = "3-account-detail", device = PHONE, group = "phone", showSystemUi = true)     @Composable     fun Preview3Account() {         DynamicTheme(darkTheme = true) {@@ -172,4 +173,18 @@ class MetadataPreviews {             )         }     }++    @PreviewTest+    @Preview(name = "7-restore-snapshot-dialog", device = PHONE, group = "phone", showSystemUi = true)+    @Composable+    fun Preview7RestoreSnapshotDialog() {+        DynamicTheme(darkTheme = true) {+            RestoreSnapshotDialog(+                dayEpochMs = 1_741_651_200_000L,+                dataType = "notes",+                onConfirm = {},+                onDismiss = {},+            )+        }+    } }
everysync/src/test/java/com/vayunmathur/everysync/BinderNavigationWave3Test.kt
diff --git a/everysync/src/test/java/com/vayunmathur/everysync/BinderNavigationWave3Test.kt b/everysync/src/test/java/com/vayunmathur/everysync/BinderNavigationWave3Test.ktindex bfa85a4ee0..a4b6c3c8fc 100644--- a/everysync/src/test/java/com/vayunmathur/everysync/BinderNavigationWave3Test.kt+++ b/everysync/src/test/java/com/vayunmathur/everysync/BinderNavigationWave3Test.kt@@ -156,7 +156,7 @@ class BinderNavigationWave3Test {             AccountConfig("worker-ghost", "no-such-provider", setOf(DataType.NOTES)),         )         fun params(input: androidx.work.Data) = androidx.work.WorkerParameters(-            java.util.UUID.randomUUID(), input, emptyList(),+            java.util.UUID.fromString("00000000-0000-0000-0000-000000000001"), input, emptyList(),             androidx.work.WorkerParameters.RuntimeExtras(), 0, 0,             java.util.concurrent.Executor { it.run() }, kotlinx.coroutines.Dispatchers.Default,             object : androidx.work.impl.utils.taskexecutor.TaskExecutor {
everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeTest.kt
diff --git a/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeTest.kt b/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeTest.ktindex f5d79d20e1..2ddbfcc45b 100644--- a/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeTest.kt+++ b/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeTest.kt@@ -91,18 +91,31 @@ class UiComposeTest {         rule.setContent {             androidx.compose.foundation.layout.Column {                 SyncErrorBanner("Something failed")-                SnapshotSection(listOf(meta), restoring = false, onRestore = { restored = it }, onSnapshotNow = { snapNow = true })+                SnapshotSection(listOf(meta), restoring = false, onRestoreRequest = { restored = it }, onSnapshotNow = { snapNow = true })             }         }         rule.onNodeWithText("Something failed").assertIsDisplayed()         rule.onNodeWithText("Restore", substring = true).performClick()-        rule.waitForIdle() // dialog opens; confirm-        rule.onAllNodesWithText("Restore")[1].performClick(); assertEquals(meta, restored)+        // Clicking Restore now pushes the dialog route; the request itself+        // is the seam the binder turns into that navigation.+        assertEquals(meta, restored)     }     @Test fun snapshotEmptySection() {-        rule.setContent { SnapshotSection(emptyList(), restoring = true, onRestore = {}, onSnapshotNow = {}) }+        rule.setContent { SnapshotSection(emptyList(), restoring = true, onRestoreRequest = {}, onSnapshotNow = {}) }         rule.waitForIdle()     }+    @Test fun restoreSnapshotDialogConfirms() {+        var confirmed = false; var dismissed = false+        rule.setContent {+            com.vayunmathur.everysync.ui.dialogs.RestoreSnapshotDialog(+                dayEpochMs = 1700000000000, dataType = "notes",+                onConfirm = { confirmed = true }, onDismiss = { dismissed = true },+            )+        }+        rule.onAllNodesWithText("Restore")[0].performClick()+        // ConfirmDialog dismisses first, then confirms.+        assertTrue(dismissed); assertTrue(confirmed)+    }     @Test fun vaultSharingEmptyAndCreate() {         var created = ""         val actions = object : AccountDetailActions { override fun createVault(d: String, t: String) { created = "$d:$t" } }
everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeWave3Test.kt
diff --git a/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeWave3Test.kt b/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeWave3Test.ktindex 91520c7d52..1dd20c272a 100644--- a/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeWave3Test.kt+++ b/everysync/src/test/java/com/vayunmathur/everysync/ui/UiComposeWave3Test.kt@@ -77,7 +77,7 @@ class UiComposeWave3Test {             override fun removeAccount(a: String) { removed = a }             override fun back() { backed = true }             override fun snapshotNow() { snapshotNow = true }-            override fun restoreSnapshot(s: SnapshotStore.SnapshotMeta) { restoredDay = s.dayEpochMs }+            override fun openRestoreSnapshot(s: SnapshotStore.SnapshotMeta) { restoredDay = s.dayEpochMs }             override fun offerableRoles(d: String) = listOf("editor", "viewer")         }         val snap = SnapshotStore.SnapshotMeta("v-ui-1", "contacts", 1_700_000_000_000L, 4, takenAtMs = 1_700_000_000_000L)@@ -101,11 +101,9 @@ class UiComposeWave3Test {         assertTrue(toggled.any { it.startsWith("CONTACTS") }, toggled.toString())         rule.onNodeWithText("Sync now").performScrollTo().performClick()         assertEquals("alice", synced)-        // Snapshot row: open the confirm dialog and cancel it (no restore).+        // Snapshot row: tapping Restore requests the dialog route for it.         rule.onNodeWithText("Restore").performScrollTo().performClick()-        rule.waitForIdle()-        rule.onAllNodesWithText("Cancel")[0].performClick()-        assertEquals(0L, restoredDay)+        assertEquals(1_700_000_000_000L, restoredDay)         // Take a snapshot now.         rule.onNodeWithText("Back up now", substring = true).performClick()         assertTrue(snapshotNow)@@ -269,7 +267,7 @@ class UiComposeWave3Test {         assertEquals(false, settingsOpened || addOpened) // chrome clicks covered by binders elsewhere     } -    @Test fun snapshotSectionRestoreConfirmEmptyAndRestoring() {+    @Test fun snapshotSectionRestoreRequestEmptyAndRestoring() {         var restored: SnapshotStore.SnapshotMeta? = null         var now = false         val first = SnapshotStore.SnapshotMeta("v1", "notes", 1_700_000_000_000L, 2)@@ -277,23 +275,20 @@ class UiComposeWave3Test {         rule.setContent {             SnapshotSection(                 listOf(first, second), restoring = false,-                onRestore = { restored = it }, onSnapshotNow = { now = true },+                onRestoreRequest = { restored = it }, onSnapshotNow = { now = true },             )         }         rule.onNodeWithText("Back up now", substring = true).performClick()         assertTrue(now)-        // Confirm the restore of the second row via its dialog: the row-        // button opens it, the dialog's own Restore button confirms it.+        // Tapping the second row's Restore requests its dialog route; the+        // binder pushes Route.RestoreSnapshotDialog for exactly that snapshot.         rule.onAllNodesWithText("Restore")[1].performClick()-        rule.waitForIdle()-        val count = rule.onAllNodesWithText("Restore").fetchSemanticsNodes().size-        rule.onAllNodesWithText("Restore")[count - 1].performClick()         assertEquals(second, restored)     }      @Test fun snapshotSectionEmptyRestoring() {         rule.setContent {-            SnapshotSection(emptyList(), restoring = true, onRestore = {}, onSnapshotNow = {})+            SnapshotSection(emptyList(), restoring = true, onRestoreRequest = {}, onSnapshotNow = {})         }         rule.onNodeWithText("No snapshots yet", substring = true).assertIsDisplayed()     }