Modern Apps git

← Modern-Apps.git

findfamily: restore bottom-panel person and waypoint content

Commit
61f75a3835d7a41d010589fe119329a497662b16
Author
Vayun Mathur <[email protected]>
When
2026-12-05 00:01 UTC (1 day ago)
Parents
a778940
In v2.6.11b (ef00c6d7e) tapping a person or a saved place swapped
the map page's bottom sheet content: MainPage carried the selection
(Route.MainPage arguments feeding ViewModel state) and
MainSheetContent branched between FamilyListSheet, PersonDetailSheet
and the waypoint name/range form, with the waypoint following the
map centre so the place could be moved by dragging the map.

At HEAD that interaction was replaced by Route.PersonSheet /
Route.WaypointSheet DialogPage destinations whose entries also
wrapped their content in a Compose Dialog. The user and waypoint
pages therefore opened as dialogs over the map, and the modal dialog
blocked the map underneath, dropping the drag-to-move behaviour for
saved places (the caveat recorded when the sheet destinations were
introduced).

Restore the bottom-content interaction while keeping selection
route-driven, as the repo requires: PersonSheet and WaypointSheet
remain routes in the navigation graph, but their entries now render
MainPage itself (SiblingPage crossfade, no DialogPage) and MainPage
hosts their content in its bottom panel. MainSheetContent swaps
between the family list and the person/waypoint panel content on
phone, and FindFamilyWideLayout's side panel does the same on
expanded windows. PersonSheet and WaypointSheet lose their Dialog
and Card wrappers and render directly as panel content, keeping all
current fields and actions (person detail, arrival/departure alerts,
no-show watch, Find Nearby, verify, history, change contact;
waypoint name/range/save/cancel/delete). Selection pushes use
pushOrReplace so tapping another person or place swaps the panel
instead of stacking selections; back and tapping the map return the
panel to the family list. Because the panel is the non-modal
BottomSheetScaffold sheet, the map stays reachable while editing a
place and MapView keeps reporting the dragged centre into
MapPageState.waypointCoord, restoring move-by-dragging.

MainPageUiState now carries the selected person/waypoint ids so the
stateless MainPageContent and previews can render the swapped panel;
the person and waypoint screenshot previews render the real panel
host. findfamily/AGENTS.md now describes these routes as
bottom-panel routes rather than dialog pages.

Tests: W5MainPageContentTest asserts the panel swaps to person and
waypoint content and that the family row is gone;
MainPageNavigationRealRepoTest taps a real person and a real saved
place in the full Navigation graph, asserts the panel shows the
person detail / saved-place editor, and asserts back returns the
panel to the family list. Test-first: the new tests failed to
compile against HEAD's always-family-list MainSheetContent and then
failed behaviourally before the host was restored.

Verified in this worktree (JAVA_HOME JDK 21, Android SDK,
--max-workers=128):
./gradlew :findfamily:lint :findfamily:lintVitalRelease
:findfamily:testDevUnitTest :findfamily:compileDevScreenshotTestKotlin
all green (372 JVM + 242 native tests, 0 failures; lintVitalRelease
also re-run explicitly and green). No pre-existing failures to
attribute. :findfamily:checkMetadata is ambiguous in this Gradle
version (checkDev/ReleaseAarMetadata candidates), unrelated to
this change.

Diff

findfamily/AGENTS.md
diff --git a/findfamily/AGENTS.md b/findfamily/AGENTS.mdindex 28030bc9ac..d6b1bd39fa 100644--- a/findfamily/AGENTS.md+++ b/findfamily/AGENTS.md@@ -21,7 +21,7 @@ WebSocket relay host: `wss://api.maproj.org/api/ws` (Cloudflare FIRST_PARTY pins - Live battery, speed, and dwell-time per person; UWB precision ranging where hardware supports it - Powered-off finding (BLE beacons) and a Quick Settings tile to stop sharing instantly **Architecture / data-flow:** Single `MainPage` UI + `platform/FindFamilyViewModel` over `data/FindFamilyRepository` (Room: users, waypoints, links, no-show alerts); live location flows through `util/LocationTracking*` foreground service + `tracker/` BLE protocol and `uwb/` ranging, relayed E2EE via `:library:e2ee-p2p` (`util/Networking*`). `onCreateBeforeContent`: parse the add-invite deep link, then `NetworkClient.init(FIRST_PARTY)`.-**Entry points + reading order:** `Route` (`MainPage` / sheets / `AddPersonDialog` / `AddLinkDialog` / `AddTrackerDialog` / `MissingFeaturesDialog` / `SecurityCodeDialog` / `NoShowAlertDialog` / `PermissionUpgradeDialog` / `UwbRangingPage`, all `DialogPage()` except the two full screens) → `Navigation.kt` → `ui/MainPage.kt` → `platform/FindFamilyViewModel.kt` → `data/FindFamilyRepository.kt`. Dialogs are routes: screens push `Route.…Dialog` and the entry renders the stateless `…Content` under `ui/dialogs/` (or the sheet content) unconditionally; `PersonDetailSheet` only requests the no-show dialog via its `onShowNoShowAlert` callback. Every route has a deterministic capture in `src/screenshotTest` (`MetadataPreviews`, `<n>-<route-kebab>`).+**Entry points + reading order:** `Route` (`MainPage` / `PersonSheet` / `WaypointSheet` / `FirstRunSheet` / `AddPersonDialog` / `AddLinkDialog` / `AddTrackerDialog` / `MissingFeaturesDialog` / `SecurityCodeDialog` / `NoShowAlertDialog` / `PermissionUpgradeDialog` / `UwbRangingPage`) → `Navigation.kt` → `ui/MainPage.kt` → `platform/FindFamilyViewModel.kt` → `data/FindFamilyRepository.kt`. Dialogs are routes: screens push `Route.…Dialog` and the entry renders the stateless `…Content` under `ui/dialogs/` unconditionally (all `DialogPage()`); `PersonDetailSheet` only requests the no-show dialog via its `onShowNoShowAlert` callback. Person/waypoint selection is also route-driven but is not a dialog: `PersonSheet` / `WaypointSheet` entries render `MainPage`, whose bottom panel (phone `BottomSheetScaffold` sheet, expanded side panel) swaps from the family list to that route's person/waypoint content, so the map stays reachable to move a saved place by dragging it; back returns the panel to the family list. Every route has a deterministic capture in `src/screenshotTest` (`MetadataPreviews`, `<n>-<route-kebab>`). **Gotchas:** - Location permission spec must request fine AND coarse together (Android 12+ Precise/Approximate choice; fine alone is ignored), plus background location and `BLUETOOTH_SCAN` — the powered-off-finder scanner starts then dies without it - `singleTop` warm-start invites/UWB taps arrive via `onNewIntent`, not a fresh `onCreate`@@ -73,8 +73,8 @@ location sharing never starts there. ## Key files ### Root — entry + navigation - com/vayunmathur/findfamily/MainActivity.kt — deep-link parsing, permission spec, permission-upgrade trigger-- com/vayunmathur/findfamily/Route.kt — sealed `Route` destinations (sheets + dialog routes + UWB screen)-- com/vayunmathur/findfamily/Navigation.kt — `MainNavigation` entries for every route+- com/vayunmathur/findfamily/Route.kt — sealed `Route` destinations (bottom-panel person/waypoint routes + dialog routes + UWB screen)+- com/vayunmathur/findfamily/Navigation.kt — `MainNavigation` entries for every route; `PersonSheet`/`WaypointSheet` render `MainPage` (bottom-panel host), the `…Dialog` routes use `DialogPage()` ### data/ — Room entities + repository - com/vayunmathur/findfamily/data/FindFamilyRepository.kt - com/vayunmathur/findfamily/data/FFDatabase.kt@@ -151,6 +151,8 @@ location sharing never starts there. - com/vayunmathur/findfamily/ui/MainFabOverlay.kt - com/vayunmathur/findfamily/ui/FamilyListSheet.kt - com/vayunmathur/findfamily/ui/PersonDetailSheet.kt+- com/vayunmathur/findfamily/ui/PersonSheet.kt — bottom-panel person content for `Route.PersonSheet` (detail + Find Nearby/verify/history), hosted by `MainPage`'s panel, not a dialog+- com/vayunmathur/findfamily/ui/WaypointSheet.kt — bottom-panel saved-place editor for `Route.WaypointSheet` (name/range/delete; place moves with the map centre), hosted by `MainPage`'s panel, not a dialog - com/vayunmathur/findfamily/ui/UserCard.kt - com/vayunmathur/findfamily/ui/UserPicture.kt — face icons via `peopleFaceRequest`: stable SHA-256 memory+disk cache keys and explicit decode size through `:library:image`, so scrolling the people list does not refetch/re-decode faces - com/vayunmathur/findfamily/ui/AutoToggleRow.kt
findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.ktindex 6c0110d44a..0ba59c9e88 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/Navigation.kt@@ -8,9 +8,7 @@ import com.vayunmathur.findfamily.platform.FindFamilyViewModel import com.vayunmathur.findfamily.platform.Platform import com.vayunmathur.findfamily.ui.FirstRunSheet import com.vayunmathur.findfamily.ui.MainPage-import com.vayunmathur.findfamily.ui.PersonSheet import com.vayunmathur.findfamily.ui.UwbRangingScreen-import com.vayunmathur.findfamily.ui.WaypointSheet import com.vayunmathur.findfamily.ui.dialogs.AddLinkDialog import com.vayunmathur.findfamily.ui.dialogs.AddPersonDialog import com.vayunmathur.findfamily.ui.dialogs.AddTrackerDialog@@ -27,6 +25,7 @@ import com.vayunmathur.library.ui.rememberMessenger import com.vayunmathur.library.ui.dialog.DatePickerDialog import com.vayunmathur.library.util.DialogPage import com.vayunmathur.library.util.MainNavigation+import com.vayunmathur.library.util.SiblingPage import com.vayunmathur.library.util.rememberNavBackStack import kotlin.time.Clock import kotlinx.datetime.TimeZone@@ -99,11 +98,17 @@ fun Navigation(         entry<Route.MainPage> {             MainPage(platform, backStack, ffViewModel)         }-        entry<Route.PersonSheet>(metadata = DialogPage()) {-            PersonSheet(backStack, ffViewModel, platform, it.userId)+        // Person/waypoint routes are not dialogs: they render the map page+        // itself, whose bottom panel swaps from the family list to that+        // route's content (PersonSheet / WaypointSheet hosted by MainPage).+        // SiblingPage crossfades instead of sliding, since the map stays put+        // and only the panel content changes. Back pops to MainPage, which+        // returns the panel to the family list.+        entry<Route.PersonSheet>(metadata = SiblingPage()) {+            MainPage(platform, backStack, ffViewModel)         }-        entry<Route.WaypointSheet>(metadata = DialogPage()) {-            WaypointSheet(backStack, ffViewModel, it.waypointId)+        entry<Route.WaypointSheet>(metadata = SiblingPage()) {+            MainPage(platform, backStack, ffViewModel)         }         entry<Route.UserPageHistoryDatePicker>(metadata = DialogPage()) {             DatePickerDialog(
findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/Route.ktindex fd3ee27a6b..cb6dc22196 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/Route.kt@@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable /** Navigation destinations for FindFamily's single-activity graph. */ sealed interface Route: NavKey {     @Serializable-    /** Map home destination. Selection lives in [PersonSheet]/[WaypointSheet], not here. */+    /** Map home destination; its bottom panel shows the family list. Selection lives in [PersonSheet]/[WaypointSheet], which swap that panel's content. */     data object MainPage: Route      @Serializable@@ -16,11 +16,11 @@ sealed interface Route: NavKey {     data object FirstRunSheet: Route      @Serializable-    /** Sheet for the given person, shown over the map. */+    /** Person for the map page's bottom panel: tapping a person swaps the panel from the family list to this person's content; back returns it to the list. Not a dialog. */     data class PersonSheet(val userId: Long): Route      @Serializable-    /** Sheet for the given waypoint (0 = create a new one), shown over the map. */+    /** Waypoint (0 = create a new one) for the map page's bottom panel: swaps the panel to the saved-place editor while the map stays reachable to move the place; back returns it to the family list. Not a dialog. */     data class WaypointSheet(val waypointId: Long): Route      @Serializable
findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyUiContract.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyUiContract.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyUiContract.ktindex a0df8899d9..3d8c3f31a1 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyUiContract.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/platform/FindFamilyUiContract.kt@@ -108,9 +108,10 @@ interface PersonActions {  * the family sheet, the top-bar contents and the floating action button. It carries plain  * data only — no ViewModel — so both the real app and the store-listing previews can build it.  *- * Selection is deliberately absent: `MainPage` always shows the family list.  * The selected person/place lives in the back stack (`Route.PersonSheet` /- * `Route.WaypointSheet`) and its UI is hosted by those destinations.+ * `Route.WaypointSheet`); those routes render in the map page's bottom panel+ * (see `MainSheetContent`), so this state carries the selected ids to let the+ * panel swap between the family list and the person/waypoint content.  *  * The map itself is passed to `MainPageContent` as a slot, so this state deliberately says  * nothing about map tiles or the camera.@@ -118,14 +119,22 @@ interface PersonActions { data class MainPageUiState(     val usingGpsFallback: Boolean = false,     val familyList: FamilyListUiState = FamilyListUiState(),-)+    /** Person selected via `Route.PersonSheet`, or null for the family list. */+    val selectedUserId: Long? = null,+    /** Waypoint selected via `Route.WaypointSheet` (0 = new place), or null. */+    val selectedWaypointId: Long? = null,+) {+    /** True when the bottom panel shows the family list. */+    val nothingSelected: Boolean+        get() = selectedUserId == null && selectedWaypointId == null+}  /**  * Map-overlay and FAB callbacks for the map page. Same no-op-default arrangement as the sheet  * action interfaces so [Noop] is all a preview needs. The stateful `MainPage` wires these to  * the ViewModel and nav back stack. Selection-scoped actions (delete, UWB,- * history, waypoint save) live on the `PersonSheet` / `WaypointSheet`- * destinations, not here.+ * history, waypoint save) live in the `PersonSheet` / `WaypointSheet`+ * bottom-panel content, not here.  */ interface MainPageActions {     fun onGpsWarningClick() {}
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.ktindex d652e68c07..9ff4ff0cac 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainFabOverlay.kt@@ -170,9 +170,8 @@ internal fun BoxScope.MainFabOverlay(             .offset { IntOffset(0, sheetLiftPx()) }     ) {         MaterialTheme(colorScheme = lightScheme) {-            // MainPage always shows the family list (selection lives in the-            // PersonSheet/WaypointSheet destinations, which carry their own-            // actions), so the FAB is always the add menu.+            // Selection lives in the bottom panel's person/waypoint content,+            // which carries its own actions, so the FAB is always the add menu.             run {                 if (inPreview) {                     // The expressive FloatingActionButtonMenu is animation-driven and
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.ktindex 08f58e2101..b2b8193822 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPage.kt@@ -170,9 +170,9 @@ fun MainPage(     ffViewModel: FindFamilyViewModel, ) {     // Selection lives in the back stack: the top destination (if it is a-    // sheet) supplies the ids the map/camera react to. This page itself-    // always shows the family list; the sheet destinations host the-    // person/waypoint UI.+    // person/waypoint route) supplies the ids the map/camera react to, and+    // this page's bottom panel swaps from the family list to that route's+    // content. The routes are hosted here, not as dialogs.     val topRoute = backStack.backStack.lastOrNull()     val selectedUserId = (topRoute as? Route.PersonSheet)?.userId     val selectedWaypointId = (topRoute as? Route.WaypointSheet)?.waypointId@@ -219,6 +219,8 @@ fun MainPage(      val state = MainPageUiState(         usingGpsFallback = usingGpsFallback,+        selectedUserId = selectedUserId,+        selectedWaypointId = selectedWaypointId,         familyList = FamilyListUiState(             connectedUsers = connectedUsers,             awaitingRequestUsers = awaitingRequestUsers,@@ -249,6 +251,16 @@ fun MainPage(         state = state,         familyActions = familyActions,         actions = mainActions,+        personContent = {+            if (selectedUserId != null) {+                PersonSheet(backStack, ffViewModel, platform, selectedUserId)+            }+        },+        waypointContent = {+            if (selectedWaypointId != null) {+                WaypointSheet(backStack, ffViewModel, selectedWaypointId)+            }+        },         map = {             MainMapSlot(                 ffViewModel = ffViewModel,@@ -261,11 +273,13 @@ fun MainPage(                 waypointRange = waypointRange,                 onUserClick = { userId ->                     ffViewModel.mapState.onPersonOpened()-                    backStack.add(Route.PersonSheet(userId))+                    backStack.pushOrReplace(Route.PersonSheet(userId)) {+                        it is Route.PersonSheet || it is Route.WaypointSheet+                    }                 },                 onMapClick = {-                    // Tapping the map away from any marker dismisses an open-                    // sheet (normally unreachable under the sheet's scrim).+                    // Tapping the map away from any marker returns the bottom+                    // panel to the family list.                     if (topRoute is Route.PersonSheet || topRoute is Route.WaypointSheet) {                         backStack.pop()                     }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.ktindex d95cc6aa49..3d1a2dee3b 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageActions.kt@@ -166,12 +166,16 @@ internal fun rememberMainPageActions(         object : FamilyListActions by ffViewModel {             override fun selectUser(userId: Long) {                 ffViewModel.mapState.onPersonOpened()-                backStack.add(Route.PersonSheet(userId))+                backStack.pushOrReplace(Route.PersonSheet(userId)) {+                    it is Route.PersonSheet || it is Route.WaypointSheet+                }             }              override fun beginEditWaypoint(waypoint: Waypoint) {                 ffViewModel.beginEditWaypoint(waypoint)-                backStack.add(Route.WaypointSheet(waypoint.id))+                backStack.pushOrReplace(Route.WaypointSheet(waypoint.id)) {+                    it is Route.PersonSheet || it is Route.WaypointSheet+                }             }              override fun acceptRequest(userId: Long) {@@ -196,7 +200,9 @@ internal fun rememberMainPageActions(         override fun addPerson() { backStack.add(Route.AddPersonDialog()) }         override fun beginCreateWaypoint() {             ffViewModel.mapState.beginCreateWaypoint()-            backStack.add(Route.WaypointSheet(0L))+            backStack.pushOrReplace(Route.WaypointSheet(0L)) {+                it is Route.PersonSheet || it is Route.WaypointSheet+            }         }         override fun addLink() { backStack.add(Route.AddLinkDialog) }         override fun addTracker() { backStack.add(Route.AddTrackerDialog) }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.ktindex a5df74f4be..64cbda69aa 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageContent.kt@@ -42,6 +42,8 @@ fun MainPageContent(     familyActions: FamilyListActions,     actions: MainPageActions,     map: @Composable () -> Unit,+    personContent: @Composable () -> Unit = {},+    waypointContent: @Composable () -> Unit = {}, ) {     val scaffoldState = rememberBottomSheetScaffoldState() @@ -53,9 +55,7 @@ fun MainPageContent(     val expanded = isExpandedWidth() && !inPreview      // The peek stays NON-ZERO: a peek of 0.dp crashes (Material3 keeps only-    // the Expanded anchor while the state targets PartiallyExpanded). This-    // page always shows the family list — person/waypoint sheets are-    // separate destinations — so the peek never collapses for history mode.+    // the Expanded anchor while the state targets PartiallyExpanded).     val peekHeight = SheetPeekHeight      // The FAB sits on top of the always-light map, so color it from a light dynamic@@ -96,9 +96,16 @@ fun MainPageContent(                 }             },             panel = { modifier ->-                // Always the family list: person/waypoint sheets are-                // separate destinations over the map, on every form factor.-                FamilyListSheet(state.familyList, familyActions)+                // Same bottom-panel swap as the phone sheet, in the side+                // panel: selection routes replace the family list here too.+                Box(modifier) {+                    MainSheetContent(+                        state = state,+                        familyActions = familyActions,+                        personContent = personContent,+                        waypointContent = waypointContent,+                    )+                }             },         )         return@@ -116,6 +123,8 @@ fun MainPageContent(             MainSheetContent(                 state = state,                 familyActions = familyActions,+                personContent = personContent,+                waypointContent = waypointContent,             )         }     ) { _ ->
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.ktindex 2dcf2903cf..79b2093ea0 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainPageOverlays.kt@@ -17,8 +17,8 @@ internal fun MapOverlayBar( ) {     val gpsWarningDescription = stringResource(R.string.gps_fallback_warning_content_description) -    // Selection-scoped actions (Find Nearby / verify) live on the-    // PersonSheet / WaypointSheet destinations. The map's own overlay only+    // Selection-scoped actions (Find Nearby / verify) live in the bottom+    // panel's person/waypoint content. The map's own overlay only     // carries the GPS warning; there is no overflow/menu icon on this page.     val overlayActions: List<OverlayAction> = listOfNotNull(         if (state.usingGpsFallback) {
findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.ktindex 5b288fe0ea..b589ef22b8 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MainSheetContent.kt@@ -154,6 +154,8 @@ import kotlin.time.Instant internal fun MainSheetContent(     state: MainPageUiState,     familyActions: FamilyListActions,+    personContent: @Composable () -> Unit = {},+    waypointContent: @Composable () -> Unit = {}, ) {     // The sheet's own content MUST be taller than the peek, or Material3 emits a single     // anchor and the scaffold crashes.@@ -165,10 +167,16 @@ internal fun MainSheetContent(     // measure pass. That is a hard FATAL, and it is reached by an ordinary route: a fresh     // install has no family members, so FamilyListSheet is close to empty.     //-    // Person/waypoint sheets are separate destinations (Route.PersonSheet /-    // Route.WaypointSheet) over the map; this in-page sheet always shows the-    // family list.+    // Bottom-panel host for the selection routes: Route.PersonSheet /+    // Route.WaypointSheet swap this panel to the person/waypoint content+    // (v2.6.11b behaviour) instead of opening a dialog over the map, so the+    // map stays reachable — in particular to drag a saved place to a new+    // centre. With no selection the panel shows the family list.     Box(Modifier.heightIn(min = SheetPeekHeight + SheetMinContentMargin)) {-        FamilyListSheet(state.familyList, familyActions)+        when {+            state.selectedUserId != null -> personContent()+            state.selectedWaypointId != null -> waypointContent()+            else -> FamilyListSheet(state.familyList, familyActions)+        }     } }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.ktindex f5358c07a7..982036556d 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/PersonSheet.kt@@ -15,7 +15,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp-import androidx.compose.ui.window.Dialog import com.vayunmathur.findfamily.R import com.vayunmathur.findfamily.Route import com.vayunmathur.findfamily.platform.FindFamilyViewModel@@ -24,7 +23,6 @@ import com.vayunmathur.findfamily.platform.PersonActions import com.vayunmathur.findfamily.platform.PersonUiState import com.vayunmathur.findfamily.platform.Platform import com.vayunmathur.findfamily.platform.UwbSessionManager-import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.IconRestore import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedButton@@ -32,14 +30,14 @@ import com.vayunmathur.library.ui.Text import com.vayunmathur.library.util.NavBackStack  /**- * Sheet destination for one person (`Route.PersonSheet`), shown over the- * map. The route argument is the selection: this entry exists only while a- * person is selected, and dismissing it (back / scrim) pops back to the map.+ * Bottom-panel content for one person (`Route.PersonSheet`). The route+ * argument is the selection: this content is hosted in the map page's+ * bottom panel (see `MainSheetContent`) while a person is selected, and+ * back returns the panel to the family list. It is not a dialog.  *- * Hosts the person detail sheet plus the actions that used to branch on the- * selected user in the map overlay/FAB: Find Nearby, verify, and- * entering history mode (the scrubber renders here; the map underneath- * keeps showing the historical pin for [userId]).+ * Hosts the person detail sheet plus the selection actions: Find Nearby,+ * verify, and entering history mode (the scrubber renders here; the map+ * behind the panel keeps showing the historical pin for [userId]).  */ @Composable fun PersonSheet(@@ -104,12 +102,10 @@ fun PersonSheet(         }     } -    Dialog(onDismissRequest = { backStack.pop() }) {-        Card {-            Column(-                Modifier.padding(16.dp),-                verticalArrangement = Arrangement.spacedBy(8.dp),-            ) {+    Column(+        Modifier.padding(16.dp),+        verticalArrangement = Arrangement.spacedBy(8.dp),+    ) {                 if (user == null) {                     // Row deleted (or not yet loaded): nothing to show.                     Text(stringResource(R.string.delete_person_content_description))@@ -170,8 +166,5 @@ fun PersonSheet(                         }                     }                 }-            }-        }     }- }
findfamily/src/main/java/com/vayunmathur/findfamily/ui/WaypointSheet.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/WaypointSheet.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/WaypointSheet.ktindex 65e05d46b2..59eaac7d66 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/WaypointSheet.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/WaypointSheet.kt@@ -13,12 +13,10 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp-import androidx.compose.ui.window.Dialog import com.vayunmathur.findfamily.R import com.vayunmathur.findfamily.Route import com.vayunmathur.findfamily.platform.FindFamilyViewModel import com.vayunmathur.library.ui.Button-import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.OutlinedButton import com.vayunmathur.library.ui.OutlinedTextField import com.vayunmathur.library.ui.Text@@ -26,15 +24,16 @@ import com.vayunmathur.library.ui.rememberMessenger import com.vayunmathur.library.util.NavBackStack  /**- * Sheet destination for one waypoint (`Route.WaypointSheet`), shown over- * the map. The route argument is the selection (0 = create a new place);- * the editable form state itself (name / range / coordinate) lives in- * `MapPageState` and is prefilled by `beginCreateWaypoint` /- * `beginEditWaypoint` before this destination is pushed.+ * Bottom-panel content for one waypoint (`Route.WaypointSheet`). The route+ * argument is the selection (0 = create a new place); the editable form+ * state itself (name / range / coordinate) lives in `MapPageState` and is+ * prefilled by `beginCreateWaypoint` / `beginEditWaypoint` before this+ * route is pushed. It is hosted in the map page's bottom panel, not a+ * dialog, and back returns the panel to the family list.  *- * The coordinate follows the map centre while the sheet is open (the map- * underneath keeps reporting its dragged centre for the selected- * waypoint), matching the previous in-page editor.+ * The coordinate follows the map centre while the panel is open (the map+ * behind the panel keeps reporting its dragged centre for the selected+ * waypoint), so a saved place can be moved by dragging the map.  */ @Composable fun WaypointSheet(@@ -57,8 +56,7 @@ fun WaypointSheet(         messenger.show(notificationsDeniedMessage)     } -    Dialog(onDismissRequest = { backStack.pop() }) {-        WaypointSheetContent(+    WaypointSheetContent(             name = waypointName,             range = waypointRange,             showDelete = waypointId != 0L && existing != null,@@ -79,10 +77,9 @@ fun WaypointSheet(                 }             },         )-    } } -/** Stateless waypoint form: the route entry supplies the form values and callbacks. */+/** Stateless waypoint form: the bottom-panel host supplies the form values and callbacks. */ @Composable internal fun WaypointSheetContent(     name: String,@@ -94,11 +91,10 @@ internal fun WaypointSheetContent(     onSave: () -> Unit,     onDelete: () -> Unit, ) {-    Card {-        Column(-            Modifier.padding(16.dp),-            verticalArrangement = Arrangement.spacedBy(8.dp),-        ) {+    Column(+        Modifier.padding(16.dp),+        verticalArrangement = Arrangement.spacedBy(8.dp),+    ) {             OutlinedTextField(                 name,                 onNameChange,@@ -138,6 +134,5 @@ internal fun WaypointSheetContent(                     Modifier.fillMaxWidth(),                 ) { Text(stringResource(R.string.delete_place_content_description)) }             }-        }-    }     }+}
findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt
diff --git a/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt b/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.ktindex 16c29d69ef..746681e770 100644--- a/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt+++ b/findfamily/src/screenshotTest/kotlin/com/vayunmathur/findfamily/ui/MetadataPreviews.kt@@ -217,15 +217,23 @@ class MetadataPreviews {     @Composable     fun Preview2Person() {         DynamicTheme(darkTheme = true) {-            // Person UI is now the Route.PersonSheet destination; preview-            // its sheet content directly over the static map backdrop.-            Box(Modifier.fillMaxSize()) {-                StaticMapBackdrop()-                PersonDetailSheet(-                    PersonUiState(user = maya, location = mayaLocation, waypoints = sampleWaypoints),-                    PersonActions.Noop,-                )-            }+            // Route.PersonSheet renders in the map page's bottom panel:+            // preview the real panel host with the person content swapped in.+            MainPageContent(+                state = MainPageUiState(+                    familyList = sampleFamilyList(),+                    selectedUserId = maya.id,+                ),+                familyActions = FamilyListActions.Noop,+                actions = MainPageActions.Noop,+                map = { StaticMapBackdrop() },+                personContent = {+                    PersonDetailSheet(+                        PersonUiState(user = maya, location = mayaLocation, waypoints = sampleWaypoints),+                        PersonActions.Noop,+                    )+                },+            )         }     } @@ -283,15 +291,27 @@ class MetadataPreviews {     @Composable     fun Preview6WaypointSheet() {         DynamicTheme(darkTheme = true) {-            WaypointSheetContent(-                name = "Home",-                range = "150",-                showDelete = true,-                onNameChange = {},-                onRangeChange = {},-                onCancel = {},-                onSave = {},-                onDelete = {},+            // Route.WaypointSheet renders in the bottom panel, same host.+            MainPageContent(+                state = MainPageUiState(+                    familyList = sampleFamilyList(),+                    selectedWaypointId = 1L,+                ),+                familyActions = FamilyListActions.Noop,+                actions = MainPageActions.Noop,+                map = { StaticMapBackdrop() },+                waypointContent = {+                    WaypointSheetContent(+                        name = "Home",+                        range = "150",+                        showDelete = true,+                        onNameChange = {},+                        onRangeChange = {},+                        onCancel = {},+                        onSave = {},+                        onDelete = {},+                    )+                },             )         }     }
findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.ktindex 3d2ec0a3dd..21f771c909 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/MainPageNavigationRealRepoTest.kt@@ -9,6 +9,13 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onAllNodesWithText import androidx.compose.ui.test.onNodeWithText+import androidx.compose.ui.test.performClick+import androidx.compose.ui.test.performTouchInput+import androidx.compose.ui.test.swipeUp+import androidx.compose.ui.test.onRoot+import androidx.activity.OnBackPressedDispatcher+import androidx.activity.compose.LocalOnBackPressedDispatcherOwner+import androidx.compose.runtime.LaunchedEffect import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import com.vayunmathur.findfamily.Navigation@@ -50,6 +57,7 @@ import kotlin.time.Clock class MainPageNavigationRealRepoTest {      @get:Rule val rule = createComposeRule()+    private var backDispatcher: OnBackPressedDispatcher? = null     private val app: Application get() = ApplicationProvider.getApplicationContext()     private lateinit var repo: FindFamilyRepository     private lateinit var vm: FindFamilyViewModel@@ -92,6 +100,8 @@ class MainPageNavigationRealRepoTest {         noShowTarget: Pair<Long, Long?>? = null,     ) {         rule.setContent {+            val backOwner = LocalOnBackPressedDispatcherOwner.current+            LaunchedEffect(backOwner) { backDispatcher = backOwner?.onBackPressedDispatcher }             DynamicTheme {                 Navigation(                     Platform(app), vm,@@ -147,6 +157,52 @@ class MainPageNavigationRealRepoTest {         assertTrue(rule.onAllNodesWithText("Alice", substring = true).fetchSemanticsNodes().isNotEmpty())     } +    @Test fun tappingPersonSwapsBottomPanelNotDialog() = runBlocking {+        seedFamily()+        composeNavigation()+        // Family list is the bottom panel: no person detail is in it yet.+        kotlin.test.assertEquals(+            0,+            rule.onAllNodesWithText("Change connected contact", substring = true).fetchSemanticsNodes().size,+        )+        rule.onNodeWithText("Alice", substring = true).performClick()+        rule.waitForIdle()+        // Bottom panel swapped to the person: its detail actions now+        // occupy the panel that showed the family list.+        assertTrue(rule.onAllNodesWithText("Change connected contact", substring = true).fetchSemanticsNodes().isNotEmpty(), allTexts())+        // Back returns the bottom panel to the family list.+        rule.runOnUiThread { backDispatcher?.onBackPressed() }+        rule.waitForIdle()+        kotlin.test.assertEquals(+            0,+            rule.onAllNodesWithText("Change connected contact", substring = true).fetchSemanticsNodes().size,+        )+        assertTrue(rule.onAllNodesWithText("Alice", substring = true).fetchSemanticsNodes().isNotEmpty())+    }++    @Test fun tappingWaypointSwapsBottomPanelNotDialog() = runBlocking {+        seedFamily()+        composeNavigation()+        // Scroll the family list to the saved-places section, then tap the+        // waypoint whose name is exactly "Home" (user cards only mention+        // Home inside a longer status line).+        rule.onNodeWithText("Alice", substring = true)+            .performTouchInput { swipeUp() }+        rule.waitForIdle()+        rule.onNodeWithText("Alice", substring = true)+            .performTouchInput { swipeUp() }+        rule.waitForIdle()+        rule.onNodeWithText("Home", substring = false).performClick()+        rule.waitForIdle()+        // Saved-place editor (with delete) replaces the family list in the+        // bottom panel, so the map stays reachable to move the place.+        assertTrue(rule.onAllNodesWithText("Delete saved place", substring = true).fetchSemanticsNodes().isNotEmpty(), allTexts())+        kotlin.test.assertEquals(+            0,+            rule.onAllNodesWithText("Change connected contact", substring = true).fetchSemanticsNodes().size,+        )+    }+     @Test fun personSheetShowsPersonDetail() { runBlocking {         seedFamily()         val alice = repo.getAllUsers().first { it.name == "Alice" }@@ -176,6 +232,17 @@ class MainPageNavigationRealRepoTest {         assertTrue(rule.onAllNodesWithText("Alice", substring = true).fetchSemanticsNodes().isNotEmpty())     } +    private fun allTexts(): String {+        val texts = mutableListOf<String>()+        fun walk(node: androidx.compose.ui.semantics.SemanticsNode) {+            node.config.getOrElseNullable(androidx.compose.ui.semantics.SemanticsProperties.Text) { null }+                ?.forEach { texts += it.text }+            node.children.forEach(::walk)+        }+        walk(rule.onRoot().fetchSemanticsNode())+        return texts.joinToString(" | ")+    }+     private fun stack() = com.vayunmathur.library.util.NavBackStack<com.vayunmathur.findfamily.Route>(         arrayOf(com.vayunmathur.findfamily.Route.MainPage)     )
findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5MainPageContentTest.kt
diff --git a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5MainPageContentTest.kt b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5MainPageContentTest.ktindex b2407ec597..cba4c05fe0 100644--- a/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5MainPageContentTest.kt+++ b/findfamily/src/test/java/com/vayunmathur/findfamily/ui/W5MainPageContentTest.kt@@ -4,6 +4,7 @@ package com.vayunmathur.findfamily.ui  import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.onAllNodesWithText import androidx.compose.ui.test.onNodeWithText import androidx.test.ext.junit.runners.AndroidJUnit4 import com.vayunmathur.findfamily.data.RequestStatus@@ -17,10 +18,10 @@ import org.junit.runner.RunWith import kotlin.test.Test  /**- * Robolectric Compose tests for the in-page sheet ([MainSheetContent]):- * it always renders the family list now — person/waypoint sheets are the- * `Route.PersonSheet` / `Route.WaypointSheet` destinations, covered by- * navigation-level tests.+ * Robolectric Compose tests for the in-page bottom panel+ * ([MainSheetContent]): the `Route.PersonSheet` / `Route.WaypointSheet`+ * routes render their content in this panel instead of a dialog, and+ * with no selection the panel shows the family list.  */ @RunWith(AndroidJUnit4::class) class W5MainPageContentTest {@@ -43,6 +44,8 @@ class W5MainPageContentTest {             MainSheetContent(                 state = state,                 familyActions = FamilyListActions.Noop,+                personContent = { androidx.compose.material3.Text("PERSON-PANEL") },+                waypointContent = { androidx.compose.material3.Text("WAYPOINT-PANEL") },             )         }     }@@ -62,4 +65,35 @@ class W5MainPageContentTest {         )         rule.onNodeWithText("Alice").assertIsDisplayed()     }++    @Test+    fun personSelectionSwapsBottomPanelToPersonContent() {+        content(+            MainPageUiState(+                selectedUserId = 1L,+                familyList = FamilyListUiState(connectedUsers = listOf(user(1L))),+            ),+        )+        rule.onNodeWithText("PERSON-PANEL").assertIsDisplayed()+        // The family list is replaced, not overlaid: its row is gone.+        kotlin.test.assertEquals(+            0,+            rule.onAllNodesWithText("Alice").fetchSemanticsNodes().size,+        )+    }++    @Test+    fun waypointSelectionSwapsBottomPanelToWaypointContent() {+        content(+            MainPageUiState(+                selectedWaypointId = 5L,+                familyList = FamilyListUiState(connectedUsers = listOf(user(1L))),+            ),+        )+        rule.onNodeWithText("WAYPOINT-PANEL").assertIsDisplayed()+        kotlin.test.assertEquals(+            0,+            rule.onAllNodesWithText("Alice").fetchSemanticsNodes().size,+        )+    } }