From 89deea2617a8176fdf011cef28365c902a6402bf Mon Sep 17 00:00:00 2001 From: The Daniel Date: Tue, 26 May 2026 10:36:20 -0400 Subject: [PATCH] fix(wallet): drop per-relay backup status list from Spark settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iOS doesn't surface a per-relay backup status display in the wallet settings screen, and the section is overkill for the Android side too — the majority of users start with the default Spark wallet (which never shows the relay-backup affordance at all, because the nsec is the canonical backup), and the remaining minority on non-default Spark wallets get the "Backup to Nostr Relays" button alongside the Recovery Phrase row without needing a per-relay status card to interpret. Removes the entire status block: the "Relay Backup Status" header + refresh icon, the relay-URL + green/grey dot card, the "Delete Relay Backup" TextButton + status messages, and the confirmation dialog. The "Backup to Nostr Relays" button stays — non-default wallets can still push the encrypted backup to relays, we just don't surface the fine-grained per-relay state inline. WalletViewModel plumbing (`relayBackupStatuses`, `relayBackupCheckLoading`, `checkRelayBackupStatuses()`, `deleteRelayBackup()`) is left in place deliberately. The status check + delete actions are still wired through the WalletScreen parameter list so other entry points (or a future debug-only view) can use them, and ripping the ViewModel state out would balloon this diff into a refactor. --- .../com/wisp/app/ui/screen/WalletScreen.kt | 138 +----------------- 1 file changed, 7 insertions(+), 131 deletions(-) diff --git a/app/src/main/kotlin/com/wisp/app/ui/screen/WalletScreen.kt b/app/src/main/kotlin/com/wisp/app/ui/screen/WalletScreen.kt index a6f1f93d..e838a6fb 100644 --- a/app/src/main/kotlin/com/wisp/app/ui/screen/WalletScreen.kt +++ b/app/src/main/kotlin/com/wisp/app/ui/screen/WalletScreen.kt @@ -3337,137 +3337,13 @@ private fun WalletSettingsContent( } } - // Relay backup status section (when logged in). Skipped for default - // wallets — the nsec already serves as their backup. - if (isLoggedIn && !isDefaultWallet) { - Spacer(Modifier.height(16.dp)) - - Row( - modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically - ) { - Text( - "Relay Backup Status", - style = MaterialTheme.typography.titleSmall, - color = MaterialTheme.colorScheme.onSurface - ) - IconButton( - onClick = onCheckRelayBackups, - enabled = !relayBackupCheckLoading - ) { - if (relayBackupCheckLoading) { - CircularProgressIndicator( - modifier = Modifier.size(18.dp), - strokeWidth = 2.dp - ) - } else { - Icon( - Icons.Default.Refresh, - contentDescription = "Check relay backups", - modifier = Modifier.size(20.dp) - ) - } - } - } - - if (relayBackupStatuses.isNotEmpty()) { - Card( - modifier = Modifier.fillMaxWidth(), - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceVariant - ) - ) { - Column(modifier = Modifier.padding(12.dp)) { - relayBackupStatuses.forEach { info -> - Row( - modifier = Modifier - .fillMaxWidth() - .padding(vertical = 4.dp), - verticalAlignment = Alignment.CenterVertically - ) { - Box( - modifier = Modifier - .size(8.dp) - .background( - if (info.hasBackup) Color(0xFF4CAF50) else Color(0xFF9E9E9E), - CircleShape - ) - ) - Spacer(Modifier.width(8.dp)) - Text( - info.relayUrl.removePrefix("wss://").removePrefix("ws://"), - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurface, - maxLines = 1, - overflow = TextOverflow.Ellipsis - ) - } - } - } - } - - Spacer(Modifier.height(8.dp)) - - var showDeleteDialog by remember { mutableStateOf(false) } - - TextButton( - onClick = { showDeleteDialog = true }, - colors = ButtonDefaults.textButtonColors(contentColor = Color(0xFFD32F2F)), - enabled = deleteBackupStatus !is DeleteBackupStatus.InProgress - ) { - if (deleteBackupStatus is DeleteBackupStatus.InProgress) { - CircularProgressIndicator( - modifier = Modifier.size(16.dp), - strokeWidth = 2.dp, - color = Color(0xFFD32F2F) - ) - Spacer(Modifier.width(8.dp)) - } - Text("Delete Relay Backup") - } - - if (deleteBackupStatus is DeleteBackupStatus.Success) { - Text( - "Backup deleted", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.primary - ) - } else if (deleteBackupStatus is DeleteBackupStatus.Error) { - Text( - deleteBackupStatus.message, - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.error - ) - } - - if (showDeleteDialog) { - AlertDialog( - onDismissRequest = { showDeleteDialog = false }, - title = { Text("Delete Relay Backup?") }, - text = { - Text("This will delete your wallet backup from your relays. Make sure you have your recovery phrase saved elsewhere.") - }, - confirmButton = { - TextButton( - onClick = { - showDeleteDialog = false - onDeleteRelayBackup() - }, - colors = ButtonDefaults.textButtonColors(contentColor = Color(0xFFD32F2F)) - ) { - Text("Delete") - } - }, - dismissButton = { - TextButton(onClick = { showDeleteDialog = false }) { - Text("Cancel") - } - } - ) - } - } - } + // Relay backup status list intentionally omitted — iOS doesn't + // surface a per-relay backup display, and the majority of users + // will use the default Spark wallet (which doesn't need relay + // backup since the nsec is the canonical backup). Non-default + // wallets can still tap "Backup to Nostr Relays" above; the + // status / delete plumbing in WalletViewModel stays alive in + // case we want to surface it again later. } // Disclaimer