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.
This commit is contained in:
atsunatsu committed 2026-09-22 13:13:08 +08:00
1 parent 3d5b55faa3
commit 4260fbb096
1 file changed
+7 -2
@@ -248,11 +248,16 @@ fun MainScreen(
mapFilterViewModel = mapFilterViewModel, mapFilterViewModel = mapFilterViewModel,
onMatchGrid = { grid -> onMatchGrid = { grid ->
// Grid-QSO dialog "Match" button: pre-fill the // 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) mutualViewModel.prefillMatchFromGrid(grid)
while (backStack.size > 1) backStack.removeAt(backStack.size - 1) // 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) backStack.add(Screen.Mutual)
} }
}
) )
} }
entry<Screen.Mutual> { entry<Screen.Mutual> {