From 6c460cbff766d2e0fa331b7880fb63f868928513 Mon Sep 17 00:00:00 2001 From: Kara Zajac Date: Wed, 15 Jul 2026 10:02:55 -0400 Subject: [PATCH] Fix: back button on finder screen exits app instead of closing finder The hot/cold FinderScreen is a full-screen overlay with no BackHandler, so system-back fell through to the Activity and finished it. Added BackHandler(onBack = onClose) so back closes the finder and returns to the main list. Release 0.1.3. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_0187UiEtasyowhEBYs6s9iF5 --- app/build.gradle.kts | 4 ++-- app/src/main/kotlin/org/soulstone/vigil/ui/MainScreen.kt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c2e7f6b..4fe30b1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -13,8 +13,8 @@ android { applicationId = "org.soulstone.vigil" minSdk = 26 targetSdk = 35 - versionCode = 3 - versionName = "0.1.2" + versionCode = 4 + versionName = "0.1.3" } // Fixed debug keystore committed to the repo (a debug key is non-secret — its diff --git a/app/src/main/kotlin/org/soulstone/vigil/ui/MainScreen.kt b/app/src/main/kotlin/org/soulstone/vigil/ui/MainScreen.kt index 6189ed1..333a077 100644 --- a/app/src/main/kotlin/org/soulstone/vigil/ui/MainScreen.kt +++ b/app/src/main/kotlin/org/soulstone/vigil/ui/MainScreen.kt @@ -1,6 +1,7 @@ package org.soulstone.vigil.ui import android.text.format.DateUtils +import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.icons.filled.NotificationsActive import androidx.compose.material.icons.filled.Sensors @@ -432,6 +433,8 @@ private fun DetailRow(label: String, value: String) { * proximity meter. Works even on silent/modified tags that refuse to ring. */ @Composable private fun FinderScreen(t: TrackerEntity, onRing: (TrackerEntity) -> Unit, onClose: () -> Unit) { + // Intercept system back so it closes the finder instead of exiting the app. + BackHandler(onBack = onClose) val rssi by ScanService.finderRssi.collectAsState() val smoothed = remember { mutableStateOf(-100f) } LaunchedEffect(rssi) { rssi?.let { smoothed.value = 0.35f * it + 0.65f * smoothed.value } }