af8b5b404e22

fix: Android settings/sync browser parity — tappable Sync hub row (drop open button + DEVICE FLOW label, add pair-device description), initial-sync local-network copy, deck tabs use fixed browser stride + active-card tap no-op (v2.3.1)

time
2026-06-18 17:46 UTC · 5 months ago
machine
koh2
agent
claude-opus-4-8
session
android sync ux parity
parent
55d03cd77bf2
5 files app/build.gradle+2 −2app/src/main/java/com/peachpasswords/ui/pairing/ChirpPairScreen.kt+1 −1app/src/main/java/com/peachpasswords/ui/settings/SettingsCardBodies.kt+19 −5app/src/main/java/com/peachpasswords/ui/settings/SettingsScreen.kt+18 −29app/src/test/java/com/peachpasswords/ui/settings/SettingsStackTest.kt+14 −20
app/build.gradle+2 −2
@@ -16,8 +16,8 @@1616         applicationId "com.peachpasswords"1717         minSdk 261818         targetSdk 3519-        versionCode 23000020-        versionName "2.3.0"19+        versionCode 23010020+        versionName "2.3.1"2121 2222         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"2323         vectorDrawables {

view file

app/src/main/java/com/peachpasswords/ui/pairing/ChirpPairScreen.kt+1 −1
@@ -144,7 +144,7 @@144144 @Composable145145 private fun Copy(phase: PairingPhase, peer: String?, error: String?) {146146     val (headline, sub) = when (phase) {147-        PairingPhase.IDLE -> "Pair a device" to "Peach pairs over a short, inaudible chirp — no codes typed, no servers."147+        PairingPhase.IDLE -> "Pair a device" to "Sync over your local network. No cloud, no account, no servers."148148         PairingPhase.LISTENING, PairingPhase.CHIRPING -> "Listening…" to "Hold this phone near the other device and start pairing there too."149149         PairingPhase.HANDSHAKE -> "Almost there" to "Check that the code below matches on ${peer ?: "the other device"}."150150         PairingPhase.PAIRED -> "Paired" to "${peer ?: "Your devices"} will now keep your vault in step over the local network."

view file

app/src/main/java/com/peachpasswords/ui/settings/SettingsCardBodies.kt+19 −5
@@ -102,9 +102,9 @@102102 }103103 104104 @Composable105-private fun RowLine(fg: Color, content: @Composable RowScope.() -> Unit) {105+private fun RowLine(fg: Color, modifier: Modifier = Modifier, content: @Composable RowScope.() -> Unit) {106106     Row(107-        Modifier.fillMaxWidth().padding(vertical = 9.dp),107+        Modifier.fillMaxWidth().then(modifier).padding(vertical = 9.dp),108108         verticalAlignment = Alignment.CenterVertically,109109         horizontalArrangement = Arrangement.SpaceBetween,110110         content = content,@@ -434,7 +434,23 @@434434             )435435         }436436     }437-    RowLine(fg) { Name("Sync hub", fg); SubtleButton("open", fg) { onNavigate(PeachNav.ChirpPair) } }437+    // The whole row is the tap target — no separate "open" button (browser438+    // sync-hub parity: every settings row is tappable, the chevron signals it).439+    RowLine(fg, Modifier.clickable { onNavigate(PeachNav.ChirpPair) }) {440+        Name("Sync hub", fg)441+        Text("›", color = fg.copy(alpha = 0.6f), fontFamily = PeachType.Mono, fontSize = 15.sp)442+    }443+    RowLine(fg) {444+        Column(Modifier.weight(1f)) {445+            Text("Pair new device", color = fg, fontFamily = PeachType.Body, fontSize = 13.sp)446+            Text(447+                "Add a phone, another browser, or your desktop sync helper.",448+                color = fg.copy(alpha = 0.7f), fontFamily = PeachType.Body, fontSize = 11.sp, lineHeight = 16.sp,449+                modifier = Modifier.padding(top = 2.dp),450+            )451+        }452+        SubtleButton("pair", fg) { onNavigate(PeachNav.ChirpPair) }453+    }438454 439455     SubLabel("PAIRED DEVICES", fg)440456     if (pairedDevices.isEmpty()) {@@ -453,8 +469,6 @@453469         RowLine(fg) { Name("Sync", fg); SubtleButton("sync now", fg) { syncVm.syncNow() } }454470     }455471 456-    SubLabel("DEVICE FLOW", fg)457-    RowLine(fg) { Name("Pair new device", fg); SubtleButton("pair", fg) { onNavigate(PeachNav.ChirpPair) } }458472     Hint("Sync uses the same zero-knowledge vault format as backup and restore; pairing authorizes a device, not a cloud account.", fg)459473 }460474 

view file

app/src/main/java/com/peachpasswords/ui/settings/SettingsScreen.kt+18 −29
@@ -97,24 +97,22 @@9797 }9898 9999 /**100- * The vertical stride between consecutive collapsed tabs, sized so the deck fans101- * out to fill the available height instead of bunching in the top ~half (brief102- * Fix 7). Falls back to [min] on short screens and is capped at [max] so tabs103- * never spread too thin on tall ones.100+ * Fixed vertical stride between consecutive collapsed tabs — browser parity101+ * (StackDeck.tsx: `EXPANDED_H - TAB_OVERLAP + distance * (TAB_H - TAB_OVERLAP)`).102+ * The deck reads as a tight physical stack fanned just below the active card, not103+ * spread to fill the whole screen. Each tab overlaps its neighbour by [TAB_OVERLAP].104104  */105-internal fun collapsedTabStride(106-    available: Dp,107-    expanded: Dp,108-    tabCard: Dp,109-    tabCount: Int,110-    min: Dp,111-    max: Dp,112-): Dp {113-    if (tabCount <= 0) return min114-    val raw = (available - expanded - tabCard) / tabCount115-    return raw.coerceIn(min, max)116-}105+private val COLLAPSED_TAB_STRIDE = TAB_H - TAB_OVERLAP117106 107+/**108+ * Top offset (from the deck top) of a collapsed tab at the given cyclic [distance]109+ * from the active card. Mirrors the browser's deck-open layout so positions match110+ * one-to-one. The active card sits at 0; the first fanned tab sits just under the111+ * expanded card and each subsequent tab steps down by one [COLLAPSED_TAB_STRIDE].112+ */113+internal fun collapsedTabTop(distance: Int): Dp =114+    EXPANDED_H - TAB_OVERLAP + COLLAPSED_TAB_STRIDE * distance115+118116 @Composable119117 fun SettingsScreen(120118     onBack: () -> Unit,@@ -199,15 +197,6 @@199197 200198             BoxWithConstraints(Modifier.fillMaxSize()) {201199                 val focusHeight = maxHeight - 8.dp202-                // Fan the collapsed tabs across the whole height instead of the top ~half.203-                val tabStride = collapsedTabStride(204-                    available = maxHeight,205-                    expanded = EXPANDED_H,206-                    tabCard = TAB_CARD_H,207-                    tabCount = STACK_CARDS.size - 1,208-                    min = TAB_H - TAB_OVERLAP,209-                    max = 72.dp,210-                )211200                 STACK_CARDS.forEachIndexed { index, card ->212201                     val isActive = card.id == active213202                     val distance = when {@@ -218,7 +207,7 @@218207                     val targetTop = when {219208                         isActive -> 0.dp220209                         !deckOpen -> focusHeight + 44.dp + (distance * 8).dp221-                        else -> EXPANDED_H - TAB_OVERLAP + (distance * tabStride.value).dp210+                        else -> collapsedTabTop(distance)222211                     }223212                     val targetHeight = when {224213                         isActive && deckOpen -> EXPANDED_H@@ -311,9 +300,9 @@311300                             }312301                             .height(cardH),313302                         onClick = {314-                            if (isActive) {315-                                if (deckOpen) deckOpen = false316-                            } else {303+                            // Tapping the active card is a no-op (browser StackDeck304+                            // parity); flick it up to focus, a tab up to focus that one.305+                            if (!isActive) {317306                                 active = card.id318307                                 deckOpen = false319308                             }

view file

app/src/test/java/com/peachpasswords/ui/settings/SettingsStackTest.kt+14 −20
@@ -2,33 +2,27 @@22 33 import androidx.compose.ui.unit.dp44 import org.junit.Assert.assertEquals5-import org.junit.Assert.assertTrue65 import org.junit.Test76 87 class SettingsStackTest {98 10-    // ── Screen fill: collapsed tabs fan to use the whole height ────────────────9+    // ── Collapsed tab layout: fixed browser-parity stride ─────────────────────1110 12-    @Test fun settings_stack_collapsed_fills_screen_height() {13-        // 6 tabs, 258dp active card, 50dp tab card. On a tall screen the stride14-        // opens up toward the cap rather than staying at the 32dp floor.15-        val tall = collapsedTabStride(16-            available = 800.dp, expanded = 258.dp, tabCard = 50.dp, tabCount = 6,17-            min = 32.dp, max = 72.dp,18-        )19-        val short = collapsedTabStride(20-            available = 480.dp, expanded = 258.dp, tabCard = 50.dp, tabCount = 6,21-            min = 32.dp, max = 72.dp,22-        )23-        assertTrue("taller screen spreads tabs further", tall > short)24-        // raw = (800-258-50)/6 = 82 → clamped to the 72dp cap.25-        assertEquals(72.dp, tall)26-        // raw = (480-258-50)/6 ≈ 28.7 → clamped up to the 32dp floor.27-        assertEquals(32.dp, short)11+    @Test fun collapsed_tabs_use_fixed_browser_stride() {12+        // Browser StackDeck.tsx: top = EXPANDED_H - TAB_OVERLAP + distance * (TAB_H - TAB_OVERLAP)13+        // = 258 - 14 + distance * (46 - 14) = 244 + distance * 32. Independent of14+        // screen height — the deck reads as a tight stack, not spread to fill.15+        assertEquals(244.dp, collapsedTabTop(0))16+        assertEquals(276.dp, collapsedTabTop(1))17+        assertEquals(308.dp, collapsedTabTop(2))2818     }2919 30-    @Test fun stride_falls_back_to_min_with_no_tabs() {31-        assertEquals(32.dp, collapsedTabStride(800.dp, 258.dp, 50.dp, 0, 32.dp, 72.dp))20+    @Test fun collapsed_tab_stride_is_constant() {21+        // Every successive tab steps down by exactly one stride (32dp), regardless22+        // of how many tabs there are — no dynamic fill.23+        val stride = collapsedTabTop(3) - collapsedTabTop(2)24+        assertEquals(32.dp, stride)25+        assertEquals(collapsedTabTop(5) - collapsedTabTop(4), stride)3226     }3327 3428     // ── Drag gesture resolution ───────────────────────────────────────────────

view file