From 4260fbb0967e8a8c87d3513bb0702fc6ed00e820 Mon Sep 17 00:00:00 2001 From: atsunatsu Date: Tue, 22 Sep 2026 13:13:08 +0800 Subject: [PATCH] fix(nav): map Match prefill pushes Mutual onto the stack The grid-QSO dialog Match button now adds Mutual on top of the Map entry instead of clearing the stack, so the system back gesture pops back to the map page (the page the user came from). Bottom-nav tab switches keep their replace semantics. --- app/src/main/java/com/rtbishop/look4sat/MainScreen.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt index 617bd39f..c337da5f 100644 --- a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt +++ b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt @@ -248,10 +248,15 @@ fun MainScreen( mapFilterViewModel = mapFilterViewModel, onMatchGrid = { grid -> // Grid-QSO dialog "Match" button: pre-fill the - // match page for that grid and switch to its tab. + // match page for that grid and open it. mutualViewModel.prefillMatchFromGrid(grid) - while (backStack.size > 1) backStack.removeAt(backStack.size - 1) - backStack.add(Screen.Mutual) + // Push Mutual on top of the Map entry instead of + // replacing the stack (bottom-nav style): the + // system back gesture then pops back to the map + // page, which is the page the user came from. + if (backStack.lastOrNull() !is Screen.Mutual) { + backStack.add(Screen.Mutual) + } } ) }