6bfe8d19d1df

fix: move Updates row into Vault section in Settings so it's discoverable (v2.9.14)

time
2026-07-31 01:54 UTC · 2 months ago
machine
koh2
parent
ad746cc8f855
3 files VERSION+1 −1app/build.gradle+1 −1app/src/main/java/com/peachpasswords/ui/settings/SettingsCardBodies.kt+42 −47
VERSION+1 −1
@@ -1 +1 @@1-2.9.131+2.9.14

view file

app/build.gradle+1 −1
@@ -32,7 +32,7 @@3232         minSdk 263333         targetSdk 353434         // Keep the Android code in Gradle; the semantic name comes from root VERSION.35-        versionCode 24015935+        versionCode 2401603636         versionName semanticVersion3737 3838         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

view file

app/src/main/java/com/peachpasswords/ui/settings/SettingsCardBodies.kt+42 −47
@@ -104,56 +104,10 @@104104         CardId.Vault -> VaultBody(fg, vm, settings, entriesCount, onNavigate)105105         CardId.Sync -> SyncBody(fg, onNavigate)106106         CardId.Pro -> ProBody(fg, vm)107-        CardId.Feedback -> {108-            // The closest thing Peach has to an About surface, and where the brief109-            // put the update entry point: version first, then the feedback form.110-            AboutUpdatesBody(fg, onNavigate)111-            FeedbackBody(fg, vm)112-        }107+        CardId.Feedback -> FeedbackBody(fg, vm)113108     }114109 }115110 116-/* ────────────────────────────  about / updates  ─────────────────────────── */117-118-@Composable119-private fun AboutUpdatesBody(fg: Color, onNavigate: (PeachNav) -> Unit) {120-    val vm: UpdateViewModel = hiltViewModel()121-    val available by vm.available.collectAsState()122-    val state by vm.state.collectAsState()123-124-    SubLabel("THIS BUILD", fg, top = 0.dp)125-    RowLine(fg) {126-        Name("Version", fg)127-        ValueText(BuildConfig.VERSION_NAME, fg)128-    }129-    RowLine(fg) {130-        Column(Modifier.weight(1f)) {131-            Text("Updates", color = fg, fontFamily = PeachType.Body, fontSize = 13.sp)132-            Text(133-                when {134-                    available != null -> "v${available?.version} is available"135-                    state.phase == UpdatePhase.Checking -> "Checking…"136-                    state.phase == UpdatePhase.UpToDate -> "You're on the latest version"137-                    state.phase == UpdatePhase.Failed -> "Couldn't reach the update server"138-                    else -> "Peach checks once a day and tells you when there's a new version."139-                },140-                color = fg.copy(alpha = 0.7f),141-                fontFamily = PeachType.Body,142-                fontSize = 11.sp,143-                lineHeight = 16.sp,144-                modifier = Modifier.padding(top = 2.dp),145-            )146-        }147-        if (available != null) {148-            SubtleButton("update", fg) { onNavigate(PeachNav.Update) }149-        } else {150-            SubtleButton(if (state.phase == UpdatePhase.Checking) "checking" else "check now", fg) {151-                vm.check()152-            }153-        }154-    }155-}156-157111 /* ─────────────────────────  shared row vocabulary  ───────────────────────── */158112 159113 @Composable@@ -512,6 +466,44 @@512466 /* ────────────────────────────────  Vault  ───────────────────────────────── */513467 514468 @Composable469+private fun UpdatesRows(fg: Color, onNavigate: (PeachNav) -> Unit) {470+    val vm: UpdateViewModel = hiltViewModel()471+    val available by vm.available.collectAsState()472+    val state by vm.state.collectAsState()473+474+    RowLine(fg) {475+        Name("Version", fg)476+        ValueText(BuildConfig.VERSION_NAME, fg)477+    }478+    RowLine(fg) {479+        Column(Modifier.weight(1f)) {480+            Text("Updates", color = fg, fontFamily = PeachType.Body, fontSize = 13.sp)481+            Text(482+                when {483+                    available != null -> "v${'$'}{available?.version} is available"484+                    state.phase == UpdatePhase.Checking -> "Checking…"485+                    state.phase == UpdatePhase.UpToDate -> "You're on the latest version"486+                    state.phase == UpdatePhase.Failed -> "Couldn't reach the update server"487+                    else -> "Peach checks once a day and tells you when there's a new version."488+                },489+                color = fg.copy(alpha = 0.7f),490+                fontFamily = PeachType.Body,491+                fontSize = 11.sp,492+                lineHeight = 16.sp,493+                modifier = Modifier.padding(top = 2.dp),494+            )495+        }496+        if (available != null) {497+            SubtleButton("update", fg) { onNavigate(PeachNav.Update) }498+        } else {499+            SubtleButton(if (state.phase == UpdatePhase.Checking) "checking" else "check now", fg) {500+                vm.check()501+            }502+        }503+    }504+}505+506+@Composable515507 private fun VaultBody(516508     fg: Color,517509     vm: SettingsViewModel,@@ -594,6 +586,9 @@594586     RowLine(fg) { Name("Restore from Codex", fg); SubtleButton("open", fg) { onNavigate(PeachNav.CodexRestore) } }595587 596588     var historyShowAll by remember { mutableStateOf(false) }589+    SubLabel("UPDATES", fg)590+    UpdatesRows(fg, onNavigate)591+597592     SubLabel("VAULT HISTORY", fg)598593     if (history.isEmpty()) {599594         Text(

view file