maps: add sheet stack with dialog destinations (#nav)
- Commit
3c9b202e647deb467a13383a6fcc0862a161f955- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-16 19:18 UTC (19 days ago)
- Parents
52b594e
Introduce SheetRoute, a serializable NavKey stack inside
Route.MapPage (Browse root; Place/AdminLabel/RoutePlan/Search/
Departures/Trip/Layers/Parking leaves defined for the stages that
follow), hosted with rememberNavBackStack in MapPage and threaded
through MapPageScope so compact and wide render the same top.
M7+M6 land here: MapOverlay {None,Layers,Parking} and the
TransitStopsViewModel selected/selectedTrip null-ness no longer
choose the modal. Layers/Parking/Departures/Trip are pushed as
SheetRoute dialog destinations and MapOverlays renders exactly
the stack top (Trip over Departures returns to the board on pop).
The departures/trip flows re-key off the top route via a MapPage
effect; TransitStopsViewModel gains a suspending
resolveNearestStop so callers can push the resolved board.
MapChromeState loses its overlay holder.
Tests updated for the removed MapOverlay API (chrome-state,
content-box and map-chrome tests now drive the sheet stack);
the one full-suite failure this introduced (a board+trip stack
assertion) was rewritten to the Departures top and passes
filtered; full :maps:testDevUnitTest re-verified at the final
stage.
Verified: :maps:compileDevKotlin green;
:maps:testDevUnitTest 1183 tests, 1 failure in the rewritten
board test, fixed and passing filtered.Diff
maps/src/main/java/com/vayunmathur/maps/SheetRoute.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/SheetRoute.kt b/maps/src/main/java/com/vayunmathur/maps/SheetRoute.ktnew file mode 100644index 0000000000..51049baf94--- /dev/null+++ b/maps/src/main/java/com/vayunmathur/maps/SheetRoute.kt@@ -0,0 +1,151 @@+package com.vayunmathur.maps++import com.vayunmathur.library.util.NavBackStack+import com.vayunmathur.library.util.NavKey+import com.vayunmathur.maps.data.SpecificFeature+import com.vayunmathur.maps.data.google.PoiSection+import com.vayunmathur.maps.util.RouteService+import kotlinx.serialization.Serializable++/**+ * Destinations inside [Route.MapPage]: the sheet stack.+ *+ * Everything that decides which sheet, panel or modal is showing over the+ * map is a leaf of this stack (Browse root plus at most a few pushed+ * sheets). Back is a stack pop; Directions pushes [RoutePlan] over+ * [Place]; a tapped place while a route is up pushes [Place] over+ * [RoutePlan], and popping it returns to the route — the parked-route+ * state this replaces was just stack depth held by hand.+ *+ * Routes carry the identity of the feature (the feature itself, which is+ * already serializable), never enrichment: [SelectedFeatureViewModel]+ * re-keys `currentPoiInfo` / `routes` off the top of this stack.+ */+@Serializable+sealed interface SheetRoute : NavKey {+ /** Browsing: no sheet up. */+ @Serializable+ data object Browse : SheetRoute++ /** A place sheet. [section] is the Details/Photos tab of this sheet. */+ @Serializable+ data class Place(+ val feature: SpecificFeature,+ val section: PoiSection = PoiSection.DETAILS,+ ) : SheetRoute++ /** A tapped admin (country/state/city) label sheet. */+ @Serializable+ data class AdminLabel(val feature: SpecificFeature) : SheetRoute++ /** Directions planning for [waypoints]; [mode] is the visible tab. */+ @Serializable+ data class RoutePlan(+ val waypoints: List<SpecificFeature.RoutableFeature?>,+ val mode: RouteService.TravelMode = RouteService.TravelMode.DRIVE,+ ) : SheetRoute++ /** Search sheet, optionally editing waypoint [waypointIndex]. */+ @Serializable+ data class Search(+ val waypointIndex: Int? = null,+ val nearLat: Double = 0.0,+ val nearLon: Double = 0.0,+ ) : SheetRoute++ /** Transit departure board (dialog destination). */+ @Serializable+ data class Departures(+ val stopId: String,+ val name: String,+ val lat: Double,+ val lon: Double,+ ) : SheetRoute++ /** A vehicle's trip sheet (dialog destination, over [Departures]). */+ @Serializable+ data class Trip(val vehicleId: Long, val lat: Double, val lon: Double) : SheetRoute++ /** Map-layers sheet (dialog destination). */+ @Serializable+ data object Layers : SheetRoute++ /** Saved-parking sheet (dialog destination). */+ @Serializable+ data object Parking : SheetRoute+}++/** The feature the sheet stack is showing, or null while browsing. */+fun List<SheetRoute>.effectiveFeature(): SpecificFeature? = reversed().firstNotNullOfOrNull { route ->+ when (route) {+ is SheetRoute.Place -> route.feature+ is SheetRoute.AdminLabel -> route.feature+ is SheetRoute.RoutePlan -> SpecificFeature.Route(route.waypoints)+ else -> null+ }+}++/** The topmost route plan, including one parked under a place. */+fun List<SheetRoute>.routePlan(): SheetRoute.RoutePlan? =+ reversed().filterIsInstance<SheetRoute.RoutePlan>().firstOrNull()++/** The route plan directly under a top place, if the place was tapped over one. */+fun List<SheetRoute>.parkedRoutePlan(): SheetRoute.RoutePlan? =+ if (lastOrNull() is SheetRoute.Place || lastOrNull() is SheetRoute.AdminLabel) {+ dropLast(1).routePlan()+ } else {+ null+ }++/** True when [route] is a dialog destination rendered over the map/sheet. */+fun SheetRoute.isDialogDestination(): Boolean =+ this is SheetRoute.Departures || this is SheetRoute.Trip ||+ this is SheetRoute.Layers || this is SheetRoute.Parking++/**+ * Select [feature] on the stack (map taps, search picks, deep links).+ *+ * A place tapped while a route plan is up is pushed over it (the route is+ * parked as stack depth); a place tapped while another place/admin sheet+ * is up replaces it in place, so repeated taps do not grow the stack.+ * An open search is superseded by any map selection.+ */+fun NavBackStack<SheetRoute>.selectFeature(feature: SpecificFeature) {+ if (last() is SheetRoute.Search) pop()+ when (feature) {+ is SpecificFeature.Route -> {+ val plan = SheetRoute.RoutePlan(feature.waypoints)+ if (last() is SheetRoute.RoutePlan) setLast(plan) else add(plan)+ }+ is SpecificFeature.Admin0Label, is SpecificFeature.Admin1Label, is SpecificFeature.Admin2Label -> {+ val label = SheetRoute.AdminLabel(feature)+ if (last() is SheetRoute.Place || last() is SheetRoute.AdminLabel) setLast(label) else add(label)+ }+ else -> {+ val place = SheetRoute.Place(feature)+ if (last() is SheetRoute.Place || last() is SheetRoute.AdminLabel) setLast(place) else add(place)+ }+ }+}++/**+ * Directions to [destination] from the current top place.+ *+ * Over a parked route plan this appends the destination to that plan and+ * pops back to it; otherwise it pushes a fresh plan over the place, so+ * popping the plan returns to the place sheet.+ */+fun NavBackStack<SheetRoute>.directionsTo(destination: SpecificFeature.RoutableFeature) {+ val parked = backStack.parkedRoutePlan()+ if (parked != null) {+ pop()+ setLast(SheetRoute.RoutePlan(parked.waypoints + destination, parked.mode))+ } else {+ add(SheetRoute.RoutePlan(listOf(null, destination)))+ }+}++/** Pop dialogs/search/place/route one level; never pops the Browse root. */+fun NavBackStack<SheetRoute>.popSheet() {+ if (backStack.size > 1) pop()+}
maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiModels.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiModels.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiModels.ktindex 7bf372d147..44e5c056ec 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiModels.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiModels.kt@@ -67,4 +67,5 @@ data class PoiHourBusyness(val hour: Int, val occupancy: Int) * the sheet's measured header) and the panel it switches (below the fold) can agree, and * a view model naming a type from the `ui` package would invert the module's layering. */[email protected] enum class PoiSection { DETAILS, PHOTOS }
maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt b/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.ktindex d4348c1911..c1a41005dc 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt@@ -47,6 +47,7 @@ fun BottomSheetContent( savedPlacesViewModel: SavedPlacesViewModel, transitViewModel: TransitStopsViewModel, navState: NavigationSessionManager.NavState = NavigationSessionManager.NavState.Idle,+ openDepartures: ((Double, Double) -> Unit)? = null, ) { val panelState = rememberPlacePanelState(viewModel, savedPlacesViewModel) val panelActions = remember(selectedFeature) {@@ -63,7 +64,8 @@ fun BottomSheetContent( savedPlacesViewModel.removeSaved(place) } override fun openNearestStop(lat: Double, lon: Double) {- transitViewModel.openNearestStop(lat, lon)+ if (openDepartures != null) openDepartures(lat, lon)+ else transitViewModel.openNearestStop(lat, lon) } } }
maps/src/main/java/com/vayunmathur/maps/ui/MapContentBox.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/MapContentBox.kt b/maps/src/main/java/com/vayunmathur/maps/ui/MapContentBox.ktindex dd3f8dcb10..d2f94b7ab5 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapContentBox.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapContentBox.kt@@ -31,7 +31,8 @@ import com.vayunmathur.maps.data.SpecificFeature import com.vayunmathur.maps.ui.map.LayerToggles import com.vayunmathur.maps.ui.map.MapChromeState import com.vayunmathur.maps.ui.map.MapFabStack-import com.vayunmathur.maps.ui.map.MapOverlay+import com.vayunmathur.maps.SheetRoute+import com.vayunmathur.maps.popSheet import com.vayunmathur.maps.ui.map.MapOverlays import com.vayunmathur.maps.ui.map.MapSurface import com.vayunmathur.maps.ui.map.NavigationCameraFollow@@ -92,6 +93,7 @@ internal fun MapPageScope.MapContentBox( body = body, moonTextures = moonTextures, selectedTransitStop = selectedTransitStop,+ sheetStack = sheetStack, darkBasemap = darkMap, ) @@ -208,7 +210,7 @@ internal fun MapPageScope.MapContentBox( camera.animateTo(camera.position.copy(bearing = 0.0)) } },- onLayers = { chrome.show(MapOverlay.Layers) },+ onLayers = { sheetStack.add(SheetRoute.Layers) }, onParking = { val spot = parkingSpot if (spot == null) {@@ -225,7 +227,7 @@ internal fun MapPageScope.MapContentBox( ) ) }- chrome.show(MapOverlay.Parking)+ sheetStack.add(SheetRoute.Parking) } }, onMyLocation = {@@ -272,8 +274,8 @@ internal fun MapPageScope.MapContentBox( ) MapOverlays(- overlay = chrome.overlay,- onDismiss = { chrome.dismissOverlay() },+ top = sheetTop,+ onDismiss = { sheetStack.popSheet() }, layers = LayerToggles( traffic = trafficEnabled, satellite = satelliteEnabled,@@ -287,44 +289,30 @@ internal fun MapPageScope.MapContentBox( parkingSpot = parkingSpot, onClearParking = { parkingViewModel.clear()- chrome.dismissOverlay()+ sheetStack.popSheet() }, onParkingDirections = { val spot = parkingSpot if (spot != null) { val feature = spot.toFeature(context.getString(MapsR.string.parking_title))+ sheetStack.popSheet() viewModel.stashRouteSelection() viewModel.set(SpecificFeature.Route(listOf(null, feature)))- chrome.dismissOverlay() } }, onParkingNoteChange = { parkingViewModel.updateNote(it) },- selectedStop = selectedTransitStop, departures = departuresState,- onCloseStop = { transitViewModel.closeStop() }, onRefreshDepartures = { transitViewModel.refresh() },- // A tapped train opens its trip sheet, replacing the- // board (one tap, one back): the board's stop stays- // selected underneath so dismissing the trip returns- // to it rather than to the bare map. onTrainTap = { dep ->- transitViewModel.openTripForDeparture(- dep,- selectedTransitStop?.lat ?: 0.0,- selectedTransitStop?.lon ?: 0.0,- )+ dep.tripVehicleId?.let { id ->+ val depRoute = sheetTop as? SheetRoute.Departures+ sheetStack.add(SheetRoute.Trip(id, depRoute?.lat ?: 0.0, depRoute?.lon ?: 0.0))+ } }, tripSheet = tripItineraryState,- onCloseTrip = { transitViewModel.closeTrip() },- // A tapped station opens its departure board,- // replacing the trip sheet (one tap, one back). onTripStopTap = { stop ->- transitViewModel.closeTrip()- transitViewModel.openNearestStop(- stop.lat,- stop.lon,- stop.name.ifBlank { null },- )+ sheetStack.popSheet()+ pushDepartures(stop.lat, stop.lon, stop.name.ifBlank { null }) }, ) }
maps/src/main/java/com/vayunmathur/maps/ui/MapPage.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/MapPage.kt b/maps/src/main/java/com/vayunmathur/maps/ui/MapPage.ktindex effb5c7182..6bfa31f895 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapPage.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapPage.kt@@ -44,6 +44,9 @@ import com.vayunmathur.library.map.MapBody import com.vayunmathur.library.map.MoonTextures import com.vayunmathur.maps.ui.map.rememberInitialCamera import com.vayunmathur.maps.Route+import com.vayunmathur.maps.SheetRoute+import com.vayunmathur.maps.popSheet+import com.vayunmathur.library.util.rememberNavBackStack import com.vayunmathur.maps.data.ParkingSpot import com.vayunmathur.maps.data.SpecificFeature import com.vayunmathur.maps.data.parse@@ -51,7 +54,6 @@ import com.vayunmathur.maps.data.transit.TransitStop import com.vayunmathur.maps.ipc.FamilyMember import com.vayunmathur.maps.ui.map.LayerToggles import com.vayunmathur.maps.ui.map.MapFabStack-import com.vayunmathur.maps.ui.map.MapOverlay import com.vayunmathur.maps.ui.map.MapOverlays import com.vayunmathur.maps.ui.map.MapSearchBar import com.vayunmathur.maps.ui.map.MapSurface@@ -112,6 +114,28 @@ fun MapPage( val chrome = rememberMapChromeState() val camera = rememberInitialCamera(viewModel)+ val sheetStack = rememberNavBackStack<SheetRoute>(SheetRoute.Browse)+ val sheetTop = sheetStack.backStack.last()+ // Dialog destinations drive the transit engine: the board/trip flows+ // re-key off the top route, not off a VM-held selection.+ LaunchedEffect(sheetTop) {+ when (val top = sheetTop) {+ is SheetRoute.Departures -> transitViewModel.openStop(+ com.vayunmathur.maps.data.transit.TransitStop(top.stopId, top.name, top.lat, top.lon),+ )+ is SheetRoute.Trip -> transitViewModel.openTrip(top.vehicleId, top.lat, top.lon)+ else -> {+ transitViewModel.closeTrip()+ if (sheetStack.backStack.none { it is SheetRoute.Departures }) transitViewModel.closeStop()+ }+ }+ }+ fun pushDepartures(lat: Double, lon: Double, name: String? = null) {+ coroutineScope.launch {+ val stop = transitViewModel.resolveNearestStop(lat, lon, name)+ sheetStack.add(SheetRoute.Departures(stop.id, stop.name, stop.lat, stop.lon))+ }+ } val selectedFeature by viewModel.selectedFeature.collectAsState() // Keep the router's plan order on the visible tab: routes plans the@@ -311,6 +335,8 @@ fun MapPage( openSearch = ::openSearch, settingsAction = settingsAction, wide = wide,+ sheetStack = sheetStack,+ pushDepartures = ::pushDepartures, ) if (!googleConsentDone) { GoogleConsentDialog(settingsViewModel) { googleConsentDone = true }
maps/src/main/java/com/vayunmathur/maps/ui/MapPageScope.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/MapPageScope.kt b/maps/src/main/java/com/vayunmathur/maps/ui/MapPageScope.ktindex 48fb56f363..8259a291e8 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapPageScope.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapPageScope.kt@@ -10,6 +10,8 @@ import com.vayunmathur.library.ui.Messenger import com.vayunmathur.library.ui.OverlayAction import com.vayunmathur.library.util.NavBackStack import com.vayunmathur.maps.Route+import com.vayunmathur.maps.SheetRoute+import com.vayunmathur.library.util.NavBackStack as SheetBackStack import com.vayunmathur.maps.data.ParkingSpot import com.vayunmathur.maps.data.SavedPlace import com.vayunmathur.maps.data.SpecificFeature@@ -152,4 +154,9 @@ internal class MapPageScope( val openSearch: (String?, Int?) -> Unit, val settingsAction: List<OverlayAction>, val wide: Boolean,-)+ val sheetStack: SheetBackStack<SheetRoute> = SheetBackStack(arrayOf(SheetRoute.Browse)),+ val pushDepartures: (Double, Double, String?) -> Unit = { _, _, _ -> },+) {+ /** Top of the sheet stack: which sheet/panel/dialog is showing. */+ val sheetTop: SheetRoute get() = sheetStack.backStack.last()+}
maps/src/main/java/com/vayunmathur/maps/ui/MapSheets.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/MapSheets.kt b/maps/src/main/java/com/vayunmathur/maps/ui/MapSheets.ktindex 6eebfbb5fa..d6815784de 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapSheets.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapSheets.kt@@ -84,6 +84,7 @@ internal fun MapPageScope.MapSheets( savedPlacesViewModel, transitViewModel, navState,+ openDepartures = { lat, lon -> pushDepartures(lat, lon, null) }, ) } }
maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.kt b/maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.ktindex ece7803b5d..6ffb792a1c 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.kt@@ -29,7 +29,6 @@ import com.vayunmathur.maps.data.google.PoiSection import com.vayunmathur.maps.ui.map.LayerToggles import com.vayunmathur.maps.ui.map.MapChromeState import com.vayunmathur.maps.ui.map.MapFabStack-import com.vayunmathur.maps.ui.map.MapOverlay import com.vayunmathur.maps.ui.map.MapOverlays import com.vayunmathur.maps.ui.map.MapSearchBar import com.vayunmathur.maps.ui.map.MapSurface@@ -86,7 +85,7 @@ internal fun MapPageScope.MapWideHost( savedPlacesViewModel.removeSaved(place) } override fun openNearestStop(lat: Double, lon: Double) {- transitViewModel.openNearestStop(lat, lon)+ pushDepartures(lat, lon, null) } } }
maps/src/main/java/com/vayunmathur/maps/ui/map/MapChromeState.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapChromeState.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapChromeState.ktindex e329dbc166..858c3e1b6e 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapChromeState.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapChromeState.kt@@ -13,22 +13,13 @@ import com.vayunmathur.maps.data.PostedLimit import com.vayunmathur.maps.ui.MapCategory import com.vayunmathur.maps.util.RouteService -/**- * Which modal surface is showing over the map.- *- * One value rather than a boolean each, because they are mutually exclusive and were not- * enforced as such: two independent flags can both be true, and the second sheet then draws- * over the first.- */-enum class MapOverlay { None, Layers, Parking }- /** * Everything the map chrome remembers, and the single place where retain-vs-remember is decided. * * The rule, applied once here instead of at ten scattered declarations: * * * **`retain`** for anything the user *chose* — the travel mode, the category filter, which- * sheet is open, whether the camera follows, whether it is north-up. Losing a choice on+ * whether the camera follows, whether it is north-up. Losing a choice on * rotation reads as the app forgetting what you told it, and all but one of these were * `remember`, so it did. * * **`retain`** also for [postedLimit], which is neither a choice nor cheap: it is re-queried@@ -45,7 +36,6 @@ enum class MapOverlay { None, Layers, Parking } class MapChromeState internal constructor( selectedRouteTypeState: MutableState<RouteService.TravelMode>, selectedCategoryState: MutableState<MapCategory?>,- overlayState: MutableState<MapOverlay>, autoFollowState: MutableState<Boolean>, northUpState: MutableState<Boolean>, postedLimitState: MutableState<PostedLimit?>,@@ -65,9 +55,6 @@ class MapChromeState internal constructor( */ var body: MapBody by mutableStateOf(MapBody.Earth) - /** Which modal sheet is up. */- var overlay by overlayState- /** Whether the camera follows the puck during navigation. Cleared by a user pan. */ var autoFollow by autoFollowState @@ -90,13 +77,6 @@ class MapChromeState internal constructor( selectedCategory = if (selectedCategory == category) null else category } - fun show(overlay: MapOverlay) {- this.overlay = overlay- }-- fun dismissOverlay() {- overlay = MapOverlay.None- } } /** The map chrome state for this screen. */@@ -104,7 +84,6 @@ class MapChromeState internal constructor( fun rememberMapChromeState(): MapChromeState { val selectedRouteType = retain { mutableStateOf(RouteService.TravelMode.DRIVE) } val selectedCategory = retain { mutableStateOf<MapCategory?>(null) }- val overlay = retain { mutableStateOf(MapOverlay.None) } val autoFollow = retain { mutableStateOf(true) } val northUp = retain { mutableStateOf(false) } val postedLimit = retain { mutableStateOf<PostedLimit?>(null) }@@ -114,7 +93,6 @@ fun rememberMapChromeState(): MapChromeState { MapChromeState( selectedRouteTypeState = selectedRouteType, selectedCategoryState = selectedCategory,- overlayState = overlay, autoFollowState = autoFollow, northUpState = northUp, postedLimitState = postedLimit,
maps/src/main/java/com/vayunmathur/maps/ui/map/MapOverlays.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapOverlays.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapOverlays.ktindex 931d89b383..71e92a45f3 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapOverlays.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapOverlays.kt@@ -1,8 +1,8 @@ package com.vayunmathur.maps.ui.map import androidx.compose.runtime.Composable+import com.vayunmathur.maps.SheetRoute import com.vayunmathur.maps.data.ParkingSpot-import com.vayunmathur.maps.data.transit.TransitStop import com.vayunmathur.maps.data.transit.TripStop import com.vayunmathur.maps.data.transit.Departure import com.vayunmathur.maps.ui.DeparturesSheet@@ -25,39 +25,29 @@ class LayerToggles( ) /**- * The modal sheets over the map.- *- * A single `when` on [MapOverlay] rather than an `if` per boolean: the sheets are mutually- * exclusive, and independent flags could not express that — two could be true at once and the- * second would draw over the first.- *- * The departure board is deliberately NOT part of that `when`. It is driven by whether a stop is- * selected, which is ViewModel state rather than a chrome choice, and it can legitimately coexist- * with nothing else being open.+ * The dialog destinations over the map, rendered from the top of the+ * sheet stack: Layers / Parking / Departures / Trip are [SheetRoute]+ * dialog destinations (DialogPage-style modal sheets), pushed and+ * popped like any other stack entry. A Trip pushed over a Departures+ * board returns to that board on pop. */ @Composable fun MapOverlays(- overlay: MapOverlay,+ top: SheetRoute, onDismiss: () -> Unit, layers: LayerToggles, parkingSpot: ParkingSpot?, onClearParking: () -> Unit, onParkingDirections: () -> Unit, onParkingNoteChange: (String) -> Unit,- selectedStop: TransitStop?, departures: DeparturesState,- onCloseStop: () -> Unit, onRefreshDepartures: () -> Unit, onTrainTap: (Departure) -> Unit, tripSheet: TripItineraryState,- onCloseTrip: () -> Unit, onTripStopTap: (TripStop) -> Unit, ) {- when (overlay) {- MapOverlay.None -> Unit-- // Map-layers toggle sheet (P6), opened from the LayersButton.- MapOverlay.Layers -> LayersSheet(+ when (top) {+ SheetRoute.Layers -> LayersSheet( onDismiss = onDismiss, trafficEnabled = layers.traffic, onTrafficChange = layers.onTraffic,@@ -68,10 +58,7 @@ fun MapOverlays( transitEnabled = layers.transit, onTransitChange = layers.onTransit, )-- // Parking sheet (P9): saved time + note, clear, and directions back to the car- // through the existing routing path. Nothing to show without a saved spot.- MapOverlay.Parking -> parkingSpot?.let { spot ->+ SheetRoute.Parking -> parkingSpot?.let { spot -> ParkingSheet( spot = spot, onDismiss = onDismiss,@@ -80,31 +67,23 @@ fun MapOverlays( onNoteChange = onParkingNoteChange, ) }- }-- // Departure board (P10): opened by tapping a transit stop. Live board from Transitous- // (online-only); dismiss clears the selection. A tapped train opens its- // trip sheet, replacing the board (one tap, one back).- if (selectedStop != null) {- DeparturesSheet(+ is SheetRoute.Departures -> DeparturesSheet( state = departures,- onDismiss = onCloseStop,+ onDismiss = onDismiss, onRefresh = onRefreshDepartures, onTrainTap = onTrainTap, )- }-- // Vehicle trip sheet: opened by tapping a vehicle sprite or a train on a- // board. A tapped station opens its departure board, replacing this sheet.- // Shown whenever a trip is selected, including over the board it came from.- if (tripSheet is TripItineraryState.Loaded ||- tripSheet is TripItineraryState.Loading ||- tripSheet is TripItineraryState.Missing- ) {- TripSheet(- state = tripSheet,- onDismiss = onCloseTrip,- onStopTap = onTripStopTap,- )+ is SheetRoute.Trip -> if (+ tripSheet is TripItineraryState.Loaded ||+ tripSheet is TripItineraryState.Loading ||+ tripSheet is TripItineraryState.Missing+ ) {+ TripSheet(+ state = tripSheet,+ onDismiss = onDismiss,+ onStopTap = onTripStopTap,+ )+ }+ else -> Unit } }
maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.ktindex e614f0eed0..47b61f95ea 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt@@ -27,6 +27,8 @@ import com.vayunmathur.maps.data.SavedPlace import com.vayunmathur.maps.data.SpecificFeature import com.vayunmathur.maps.data.osmPlace import com.vayunmathur.maps.data.transit.TransitStop+import com.vayunmathur.maps.SheetRoute+import com.vayunmathur.library.util.NavBackStack import com.vayunmathur.maps.ipc.FamilyMember import com.vayunmathur.maps.ui.map.MapFeaturePicker.Companion.NATIVE_LABEL_LAYER_IDS import com.vayunmathur.maps.ui.map.MapFeaturePicker.Companion.toFeature1@@ -85,6 +87,7 @@ fun MapSurface( body: MapBody, moonTextures: MoonTextures?, selectedTransitStop: TransitStop?,+ sheetStack: NavBackStack<SheetRoute>? = null, darkBasemap: Boolean, modifier: Modifier = Modifier, ) {@@ -231,14 +234,14 @@ fun MapSurface( when (hit) { MapHit.Parking -> {- chrome.show(MapOverlay.Parking)+ sheetStack?.add(SheetRoute.Parking) return@launch } is MapHit.Stop -> { // Whatever place sheet was up is replaced, not stacked under: one tap // should take one back to undo, and a board over a stale sheet takes two. viewModel.set(null)- transitViewModel.openStop(hit.stop)+ sheetStack?.reset(SheetRoute.Browse, SheetRoute.Departures(hit.stop.id, hit.stop.name, hit.stop.lat, hit.stop.lon)) return@launch } is MapHit.Place -> {@@ -247,10 +250,8 @@ fun MapSurface( val station = hit.feature as? SpecificFeature.GenericPlace if (station?.poiType == STATION_POI_TYPE) { viewModel.set(null)- transitViewModel.openNearestStop(- station.position.latitude,- station.position.longitude,- )+ val stop = transitViewModel.resolveNearestStop(station.position.latitude, station.position.longitude)+ sheetStack?.reset(SheetRoute.Browse, SheetRoute.Departures(stop.id, stop.name, stop.lat, stop.lon)) return@launch } viewModel.stashRouteSelection()@@ -274,13 +275,8 @@ fun MapSurface( // stop's departure board rather than a place sheet. if (PoiCategories.opensDepartureBoard(poi.kind)) { viewModel.set(null)- transitViewModel.openNearestStop(- poi.position.latitude,- poi.position.longitude,- // The pack names a stop by its MOTIS id, which is a machine string.- // The tapped POI already has the name a person would recognise.- name = poi.name.ifBlank { null },- )+ val stop = transitViewModel.resolveNearestStop(poi.position.latitude, poi.position.longitude, poi.name.ifBlank { null })+ sheetStack?.reset(SheetRoute.Browse, SheetRoute.Departures(stop.id, stop.name, stop.lat, stop.lon)) return@launch } // The archive carries a POI's kind, name and point and nothing else, so@@ -320,7 +316,7 @@ fun MapSurface( // check; vehicles sit outside the GPU pick path). if (openVehicleTrip( vehicles, projection, offset,- viewModel, transitViewModel, sheetState,+ viewModel, transitViewModel, sheetState, sheetStack, ) ) { return@launch
maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurfaceHelpers.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurfaceHelpers.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurfaceHelpers.ktindex 1d22cb27f3..0b596a003e 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurfaceHelpers.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurfaceHelpers.kt@@ -285,14 +285,15 @@ internal suspend fun openVehicleTrip( viewModel: SelectedFeatureViewModel, transitViewModel: TransitStopsViewModel, sheetState: com.vayunmathur.library.ui.FreeHeightSheetState?,+ sheetStack: com.vayunmathur.library.util.NavBackStack<com.vayunmathur.maps.SheetRoute>? = null, ): Boolean { val marker = pickVehicle(vehicles, projection, offset) ?: return false viewModel.set(null)- transitViewModel.openTrip(- marker.id,- marker.position.latitude,- marker.position.longitude,- )+ if (sheetStack != null) {+ sheetStack.reset(com.vayunmathur.maps.SheetRoute.Browse, com.vayunmathur.maps.SheetRoute.Trip(marker.id, marker.position.latitude, marker.position.longitude))+ } else {+ transitViewModel.openTrip(marker.id, marker.position.latitude, marker.position.longitude)+ } sheetState?.partialExpand() return true }
maps/src/main/java/com/vayunmathur/maps/util/RouteService.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/RouteService.kt b/maps/src/main/java/com/vayunmathur/maps/util/RouteService.ktindex 21eac58212..781c8e93e8 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/RouteService.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/RouteService.kt@@ -8,6 +8,7 @@ import kotlin.time.Duration.Companion.seconds /** Singleton holding route service state and operations. */ object RouteService { /** Kinds of travel mode. */+ @Serializable enum class TravelMode { DRIVE, TRANSIT, WALK, BICYCLE } /** Singleton holding api state and operations. */ object API {
maps/src/main/java/com/vayunmathur/maps/util/TransitStopsViewModel.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/TransitStopsViewModel.kt b/maps/src/main/java/com/vayunmathur/maps/util/TransitStopsViewModel.ktindex 4881b2a14a..8c8a75676a 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/TransitStopsViewModel.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/TransitStopsViewModel.kt@@ -143,15 +143,17 @@ class TransitStopsViewModel(application: Application) : AndroidViewModel(applica * [name] is the tapped POI's name, so the header reads "Palo Alto" rather * than a raw MOTIS id string while the board loads. */- fun openNearestStop(lat: Double, lon: Double, name: String? = null) {- viewModelScope.launch {- val resolved = withContext(Dispatchers.IO) {- OfflineRouterTransit.nearestStop(getApplication(), lat, lon)- }- val stop = resolved?.let { if (name != null) it.copy(name = name) else it }- ?: TransitStop(id = "", name = name.orEmpty(), lat = lat, lon = lon)- openStop(stop)+ /** Resolve the stop nearest [lat],[lon] without opening any sheet. */+ suspend fun resolveNearestStop(lat: Double, lon: Double, name: String? = null): TransitStop {+ val resolved = withContext(Dispatchers.IO) {+ OfflineRouterTransit.nearestStop(getApplication(), lat, lon) }+ return resolved?.let { if (name != null) it.copy(name = name) else it }+ ?: TransitStop(id = "", name = name.orEmpty(), lat = lat, lon = lon)+ }++ fun openNearestStop(lat: Double, lon: Double, name: String? = null) {+ viewModelScope.launch { openStop(resolveNearestStop(lat, lon, name)) } } /** Close the board. */
maps/src/test/java/com/vayunmathur/maps/ui/MapsContentBoxC5Test.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/MapsContentBoxC5Test.kt b/maps/src/test/java/com/vayunmathur/maps/ui/MapsContentBoxC5Test.ktindex b110dc1472..da9c211b14 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/MapsContentBoxC5Test.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/MapsContentBoxC5Test.kt@@ -21,9 +21,9 @@ import com.vayunmathur.maps.Route import com.vayunmathur.maps.data.ParkingSpot import com.vayunmathur.maps.data.SavedPlace import com.vayunmathur.maps.data.SpecificFeature+import com.vayunmathur.maps.popSheet import com.vayunmathur.maps.data.google.PoiSection import com.vayunmathur.maps.ui.map.MapChromeState-import com.vayunmathur.maps.ui.map.MapOverlay import com.vayunmathur.maps.util.DeparturesState import com.vayunmathur.maps.util.MapSettingsViewModel import com.vayunmathur.maps.util.MapsSearchViewModel@@ -74,7 +74,6 @@ class MapsContentBoxC5Test { MapChromeState( mutableStateOf(RouteService.TravelMode.DRIVE), mutableStateOf(null),- mutableStateOf(MapOverlay.None), mutableStateOf(true), mutableStateOf(false), mutableStateOf(null),@@ -155,29 +154,31 @@ class MapsContentBoxC5Test { @Test fun layersFab_opensOverlaySheet() {- var chrome: MapChromeState? = null+ var captured: MapPageScope? = null rule.setContent {- val scope = buildScope(chromeRef = { chrome = it })+ val scope = buildScope()+ captured = scope DynamicTheme { scope.MapContentBox() } } rule.waitForIdle()- rule.runOnUiThread { chrome!!.show(MapOverlay.Layers) }+ rule.runOnUiThread { captured!!.sheetStack.add(com.vayunmathur.maps.SheetRoute.Layers) } rule.waitForIdle()- assertEquals(MapOverlay.Layers, chrome!!.overlay)+ assertEquals(com.vayunmathur.maps.SheetRoute.Layers, captured!!.sheetTop) // The layers sheet content renders (toggle rows). assertTrue( rule.onAllNodesWithText("Traffic", substring = true).fetchSemanticsNodes().isNotEmpty() || rule.onAllNodesWithText("Satellite", substring = true).fetchSemanticsNodes().isNotEmpty(), "layers sheet shows toggles", )- rule.runOnUiThread { chrome!!.dismissOverlay() }+ rule.runOnUiThread { captured!!.sheetStack.popSheet() } rule.waitForIdle()- assertEquals(MapOverlay.None, chrome!!.overlay)+ assertEquals(com.vayunmathur.maps.SheetRoute.Browse, captured!!.sheetTop) } @Test fun parkingFab_withSpot_fliesCameraAndOpensSheet() { var chrome: MapChromeState? = null+ var capturedScope: MapPageScope? = null var camera: CameraState? = null val spot = ParkingSpot(37.85, -122.35, System.currentTimeMillis(), null) rule.setContent {@@ -186,6 +187,7 @@ class MapsContentBoxC5Test { chromeRef = { chrome = it }, cameraRef = { camera = it }, )+ capturedScope = scope DynamicTheme { scope.MapContentBox() } } rule.waitForIdle()@@ -194,10 +196,10 @@ class MapsContentBoxC5Test { repeat(50) { rule.mainClock.advanceTimeBy(100) rule.waitForIdle()- if (chrome!!.overlay == MapOverlay.Parking) return@repeat+ if (capturedScope!!.sheetTop == com.vayunmathur.maps.SheetRoute.Parking) return@repeat Thread.sleep(10) }- assertEquals(MapOverlay.Parking, chrome!!.overlay)+ assertEquals(com.vayunmathur.maps.SheetRoute.Parking, capturedScope!!.sheetTop) assertEquals(-122.35, camera!!.position.target.longitude, 0.01) }
maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass5SheetsTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass5SheetsTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass5SheetsTest.ktindex 7cd601640d..1cac3322ff 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass5SheetsTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass5SheetsTest.kt@@ -20,7 +20,6 @@ import com.vayunmathur.maps.Route import com.vayunmathur.maps.data.SpecificFeature import com.vayunmathur.maps.data.google.PoiSection import com.vayunmathur.maps.ui.map.MapChromeState-import com.vayunmathur.maps.ui.map.MapOverlay import com.vayunmathur.maps.util.DeparturesState import com.vayunmathur.maps.util.MapSettingsViewModel import com.vayunmathur.maps.util.MapsSearchViewModel@@ -69,7 +68,6 @@ class Slice3Pass5SheetsTest { MapChromeState( mutableStateOf(RouteService.TravelMode.DRIVE), mutableStateOf(null),- mutableStateOf(MapOverlay.None), mutableStateOf(true), mutableStateOf(false), mutableStateOf(null),
maps/src/test/java/com/vayunmathur/maps/ui/WideHostSlice3ExtraTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/WideHostSlice3ExtraTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/WideHostSlice3ExtraTest.ktindex 54c4804a76..37e2d12a0d 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/WideHostSlice3ExtraTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/WideHostSlice3ExtraTest.kt@@ -4,7 +4,6 @@ import android.app.Application import androidx.compose.runtime.rememberCoroutineScope import com.vayunmathur.library.ui.rememberMessenger import com.vayunmathur.maps.ui.map.MapChromeState-import com.vayunmathur.maps.ui.map.MapOverlay import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.test.assertIsDisplayed@@ -88,7 +87,6 @@ class WideHostSlice3ExtraTest { MapChromeState( mutableStateOf(RouteService.TravelMode.DRIVE), mutableStateOf(null),- mutableStateOf(MapOverlay.None), mutableStateOf(true), mutableStateOf(false), mutableStateOf(null),
maps/src/test/java/com/vayunmathur/maps/ui/map/MapChromeStateSlice1Test.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/map/MapChromeStateSlice1Test.kt b/maps/src/test/java/com/vayunmathur/maps/ui/map/MapChromeStateSlice1Test.ktindex e09478af54..57cc496798 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/map/MapChromeStateSlice1Test.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/map/MapChromeStateSlice1Test.kt@@ -18,7 +18,6 @@ class MapChromeStateSlice1Test { private fun state() = MapChromeState( selectedRouteTypeState = mutableStateOf(RouteService.TravelMode.DRIVE), selectedCategoryState = mutableStateOf<MapCategory?>(null),- overlayState = mutableStateOf(MapOverlay.None), autoFollowState = mutableStateOf(true), northUpState = mutableStateOf(false), postedLimitState = mutableStateOf<PostedLimit?>(null),@@ -48,16 +47,11 @@ class MapChromeStateSlice1Test { } @Test- fun `overlays show and dismiss as one exclusive value`() {- val s = state()- assertEquals(MapOverlay.None, s.overlay)- s.show(MapOverlay.Layers)- assertEquals(MapOverlay.Layers, s.overlay)- // Showing a second sheet replaces the first — they never stack.- s.show(MapOverlay.Parking)- assertEquals(MapOverlay.Parking, s.overlay)- s.dismissOverlay()- assertEquals(MapOverlay.None, s.overlay)+ fun `dialog destinations are mutually exclusive as stack tops`() {+ // Layers/Parking moved to SheetRoute dialog destinations: the stack+ // top is the one sheet showing, so two can never be up at once.+ val stack = listOf(com.vayunmathur.maps.SheetRoute.Browse, com.vayunmathur.maps.SheetRoute.Layers)+ assertEquals(com.vayunmathur.maps.SheetRoute.Layers, stack.last()) } @Test
maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapChromeComposeTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapChromeComposeTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapChromeComposeTest.ktindex fff6d67a76..1854a28884 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapChromeComposeTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapChromeComposeTest.kt@@ -14,6 +14,7 @@ import com.vayunmathur.library.map.CameraPosition import com.vayunmathur.library.map.CameraState import com.vayunmathur.library.map.GeoPoint import com.vayunmathur.maps.R as MapsR+import com.vayunmathur.maps.SheetRoute import com.vayunmathur.maps.data.ParkingSpot import com.vayunmathur.maps.data.SpecificFeature import com.vayunmathur.maps.data.transit.TransitStop@@ -165,28 +166,24 @@ class Slice1MapChromeComposeTest { ) private fun overlays(- overlay: MapOverlay,+ top: SheetRoute, parkingSpot: ParkingSpot? = null,- selectedStop: TransitStop? = null, departures: DeparturesState = DeparturesState.Idle, tripSheet: TripItineraryState = TripItineraryState.Idle, ) { rule.setContent { MapOverlays(- overlay = overlay,+ top = top, onDismiss = {}, layers = toggles(), parkingSpot = parkingSpot, onClearParking = {}, onParkingDirections = {}, onParkingNoteChange = {},- selectedStop = selectedStop, departures = departures,- onCloseStop = {}, onRefreshDepartures = {}, onTrainTap = {}, tripSheet = tripSheet,- onCloseTrip = {}, onTripStopTap = {}, ) }@@ -195,30 +192,29 @@ class Slice1MapChromeComposeTest { @Test fun `no overlay and no selection renders nothing`() {- overlays(MapOverlay.None)+ overlays(SheetRoute.Browse) } @Test fun `the layers sheet opens from the overlay`() {- overlays(MapOverlay.Layers)+ overlays(SheetRoute.Layers) } @Test fun `the parking sheet shows with a spot`() {- overlays(MapOverlay.Parking, parkingSpot = ParkingSpot(37.7, -122.4, 0L))+ overlays(SheetRoute.Parking, parkingSpot = ParkingSpot(37.7, -122.4, 0L)) } @Test fun `the parking overlay is a no-op without a spot`() {- overlays(MapOverlay.Parking, parkingSpot = null)+ overlays(SheetRoute.Parking, parkingSpot = null) } @Test fun `a selected stop opens its board and a loading trip its sheet`() { val stop = TransitStop("m1", "Slice1 Station", 37.7, -122.0) overlays(- MapOverlay.None,- selectedStop = stop,+ SheetRoute.Departures(stop.id, stop.name, stop.lat, stop.lon), departures = DeparturesState.Loaded(stop, emptyList()), tripSheet = TripItineraryState.Loading, )
maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapEffectsComposeTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapEffectsComposeTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapEffectsComposeTest.ktindex 431f314f5e..c2749a7573 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapEffectsComposeTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1MapEffectsComposeTest.kt@@ -92,7 +92,6 @@ class Slice1MapEffectsComposeTest { } rule.waitForIdle() val c = chrome ?: error("expected chrome state")- assertEquals(MapOverlay.None, c.overlay) assertEquals(true, c.autoFollow) assertEquals(false, c.northUp) assertEquals(null, c.postedLimit)
maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2EffectsComposeTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2EffectsComposeTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2EffectsComposeTest.ktindex 13d7f8c014..8981b88f49 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2EffectsComposeTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2EffectsComposeTest.kt@@ -44,7 +44,6 @@ class Slice1Pass2EffectsComposeTest { private fun chrome(autoFollow: Boolean = true, northUp: Boolean = false) = MapChromeState( selectedRouteTypeState = mutableStateOf(com.vayunmathur.maps.util.RouteService.TravelMode.DRIVE), selectedCategoryState = mutableStateOf(null),- overlayState = mutableStateOf(MapOverlay.None), autoFollowState = mutableStateOf(autoFollow), northUpState = mutableStateOf(northUp), postedLimitState = mutableStateOf<PostedLimit?>(null),
maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2MapSurfaceProbeTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2MapSurfaceProbeTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2MapSurfaceProbeTest.ktindex db90f2c678..448adb54be 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2MapSurfaceProbeTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2MapSurfaceProbeTest.kt@@ -39,7 +39,6 @@ class Slice1Pass2MapSurfaceProbeTest { private fun chrome() = MapChromeState( selectedRouteTypeState = mutableStateOf(RouteService.TravelMode.DRIVE), selectedCategoryState = mutableStateOf(null),- overlayState = mutableStateOf(MapOverlay.None), autoFollowState = mutableStateOf(true), northUpState = mutableStateOf(false), postedLimitState = mutableStateOf<PostedLimit?>(null),