maps: show full place details on tap, drop Show details (#place-sheet)
- Commit
7bf101c2d50784d7f0a2787c068a4ef476ebd720- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-13 19:51 UTC (22 days ago)
- Parents
67efd4b
Owner request: tapping a place should show everything immediately, never a name-only card with a "Show details" button. Since e8e107ee9 the place sheet opened masked: only the name and a "Show details" TextButton, with rating, review summary, category, hours, the action row (Directions/Call/Website) and the tabs hidden until that button was tapped. The mask also gated the Google place details fetch (photos, hours, phone) on that tap. In practice it made the archive's ratings and review summaries look missing: about 73% of food and drink places have an archive rating and 69% a summary, but none of it showed on a normal tap. This reverts the mask: - SelectedFeatureViewModel: drops detailsRevealed/revealDetails; currentPoiInfo follows the selection again. It is still hard-gated on the Settings -> Google services toggle, so with Google off a tap makes no Google request at all (archive data only). - PlacePanelState/PlacePanelActions: drop detailsRevealed and revealDetails, and the three binding sites (bottom sheet, wide host, sheet header) stop forwarding it. - PlaceSheetHeader: MaskedPlaceHeader and the show_details string go. - Tests: PlaceMaskTest is deleted; header/ViewModel tests no longer opt into a revealed state (the default is the full card). User-visible: tapping any place shows its name, rating and review count, category, hours, actions and tabs at once; with Google services on, photos/hours/phone from Google fill in as before.
Diff
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 bbea1c8afc..d4348c1911 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt@@ -65,9 +65,6 @@ fun BottomSheetContent( override fun openNearestStop(lat: Double, lon: Double) { transitViewModel.openNearestStop(lat, lon) }- override fun revealDetails() {- viewModel.revealDetails()- } } } BottomSheetContent(
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 24451fa38a..ece7803b5d 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapWideHost.kt@@ -88,9 +88,6 @@ internal fun MapPageScope.MapWideHost( override fun openNearestStop(lat: Double, lon: Double) { transitViewModel.openNearestStop(lat, lon) }- override fun revealDetails() {- viewModel.revealDetails()- } } } val panelContent: (@Composable (Modifier) -> Unit)? = when {
maps/src/main/java/com/vayunmathur/maps/ui/PlaceSheetHeader.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/PlaceSheetHeader.kt b/maps/src/main/java/com/vayunmathur/maps/ui/PlaceSheetHeader.ktindex 8db27777ba..68cba943b1 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/PlaceSheetHeader.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/PlaceSheetHeader.kt@@ -34,7 +34,6 @@ import com.vayunmathur.library.ui.SecondaryTabRow import com.vayunmathur.library.ui.Surface import com.vayunmathur.library.ui.Tab import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TextButton import com.vayunmathur.maps.R import com.vayunmathur.maps.data.SavedPlace import com.vayunmathur.maps.data.SpecificFeature@@ -154,9 +153,6 @@ private fun PlaceSheetHeaderContent( override fun removeSaved(place: SavedPlace) { savedPlacesViewModel.removeSaved(place) }- override fun revealDetails() {- viewModel.revealDetails()- } } } PlaceSheetHeaderContent(@@ -185,14 +181,6 @@ private fun PlaceSheetHeaderContent( val poi = panelState.poi val selectedSection = panelState.poiSection val context = LocalContext.current- if (!panelState.detailsRevealed) {- MaskedPlaceHeader(- name = feature.name,- onReveal = { panelActions.revealDetails() },- modifier = modifier,- )- return- } // If this is a restaurant/food place, ask fooddelivery whether it's orderable // (off the main thread, null-safe). Absent/not-orderable → null → no Order button. val orderDeepLink by rememberOrderDeepLink(context, feature, poi?.category)@@ -245,25 +233,6 @@ private fun PlaceSheetHeaderContent( } } -/**- * The masked place header: the place name plus the explicit reveal action, and- * nothing else — no category, rating, hours, action row or tabs until the user- * taps through. Private: only this file's header content renders it.- */-@Composable-private fun MaskedPlaceHeader(- name: String,- onReveal: () -> Unit,- modifier: Modifier = Modifier,-) {- Column(modifier, verticalArrangement = Arrangement.spacedBy(4.dp)) {- Text(name, style = MaterialTheme.typography.titleLarge)- TextButton(onClick = onReveal) {- Text(stringResource(R.string.show_details))- }- }-}- /** * The tabs worth offering for [poi]: Details always, Photos only when the place details * actually came back with photos. There is no reviews tab: the archive's rating and count
maps/src/main/java/com/vayunmathur/maps/util/PlacePanelState.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/PlacePanelState.kt b/maps/src/main/java/com/vayunmathur/maps/util/PlacePanelState.ktindex 641cfe7fcc..5d65baefe3 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/PlacePanelState.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/PlacePanelState.kt@@ -22,7 +22,6 @@ data class PlacePanelState( val poiSection: PoiSection = PoiSection.DETAILS, val saved: List<SavedPlace> = emptyList(), val userPosition: com.vayunmathur.library.map.GeoPoint? = null,- val detailsRevealed: Boolean = false, ) { /** True when [feature] is already in the flat starred list. */ fun isSaved(feature: SpecificFeature.RoutableFeature): Boolean =@@ -43,7 +42,6 @@ interface PlacePanelActions { fun addSaved() {} fun removeSaved(place: SavedPlace) {} fun openNearestStop(lat: Double, lon: Double) {}- fun revealDetails() {} companion object { val Noop: PlacePanelActions = object : PlacePanelActions {}@@ -66,12 +64,10 @@ fun rememberPlacePanelState( val poiSection by viewModel.poiSection.collectAsState() val saved by savedPlacesViewModel.saved.collectAsState() val userPosition by viewModel.userPosition.collectAsState()- val detailsRevealed by viewModel.detailsRevealed.collectAsState() return PlacePanelState( poi = poi, poiSection = poiSection, saved = saved, userPosition = userPosition,- detailsRevealed = detailsRevealed, ) }
maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt b/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.ktindex 5d0737eae2..a19eb2bce1 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt@@ -16,7 +16,6 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow-import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flowOf@@ -53,20 +52,6 @@ class SelectedFeatureViewModel(application: Application): AndroidViewModel(appli _poiSection.value = section } - /**- * Whether the user explicitly asked to see this selection's place details.- *- * False on every selection: the sheet opens masked (name only) and the- * [currentPoiInfo] enrichment stays parked at null until [revealDetails]- * runs. One tap reveals; selecting anything else re-masks.- */- private val _detailsRevealed = MutableStateFlow(false)- val detailsRevealed = _detailsRevealed.asStateFlow()-- fun revealDetails() {- _detailsRevealed.value = true- }- /** * The route tab the sheet is showing (DRIVE by default). Read once per * selection by [routes] so the visible tab's mode plans first; the flow@@ -198,7 +183,6 @@ class SelectedFeatureViewModel(application: Application): AndroidViewModel(appli private fun setDirect(feature: SpecificFeature?) { _selectedFeature.value = feature _poiSection.value = PoiSection.DETAILS- _detailsRevealed.value = false } private fun needsEnrichment(place: SpecificFeature.GenericPlace): Boolean =@@ -263,17 +247,11 @@ class SelectedFeatureViewModel(application: Application): AndroidViewModel(appli * [GooglePoiDataSource] caches and does its own IO, so a re-select is instant. * * Hard-gated on the Google services toggle: when off, emits null without- * touching the network — zero Google traffic. Also gated on the per-selection- * reveal ([detailsRevealed]): selecting a place parks this at null and starts- * no fetch; only [revealDetails] lets the enrichment run.+ * touching the network — zero Google traffic. */ @OptIn(ExperimentalCoroutinesApi::class)- val currentPoiInfo: StateFlow<GooglePoiInfo?> = combine(- selectedFeature,- detailsRevealed,- ) { feature, revealed -> feature to revealed }- .flatMapLatest { (feature, revealed) ->- if (!revealed) return@flatMapLatest flowOf(null)+ val currentPoiInfo: StateFlow<GooglePoiInfo?> = selectedFeature+ .flatMapLatest { feature -> if (!googleServicesEnabled()) return@flatMapLatest flowOf(null) val (name, pos) = when (feature) { is SpecificFeature.Restaurant -> feature.name to feature.position
maps/src/main/res/values/strings.xml
diff --git a/maps/src/main/res/values/strings.xml b/maps/src/main/res/values/strings.xmlindex 7aa8eeabfe..fc1f905a37 100644--- a/maps/src/main/res/values/strings.xml+++ b/maps/src/main/res/values/strings.xml@@ -60,9 +60,6 @@ <!-- Place detail: Label of the first tab under the action buttons, holding the description, address and opening hours. Noun, plural. --> <string name="poi_tab_details">Details</string>- <!-- Place sheet: masked header button revealing the full place details- (rating, hours, actions) for the selected place. Verb phrase. -->- <string name="show_details">Show details</string> <!-- Place detail: Photos section header. Noun. --> <string name="poi_photos_header">Photos</string> <!-- Place detail: Popular times section header. Noun phrase. -->
maps/src/test/java/com/vayunmathur/maps/ui/BottomSheetHeaderDirectionsSlice2Test.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/BottomSheetHeaderDirectionsSlice2Test.kt b/maps/src/test/java/com/vayunmathur/maps/ui/BottomSheetHeaderDirectionsSlice2Test.ktindex cc98669a49..9e9a4ba100 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/BottomSheetHeaderDirectionsSlice2Test.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/BottomSheetHeaderDirectionsSlice2Test.kt@@ -55,7 +55,7 @@ class BottomSheetHeaderDirectionsSlice2Test { var selected: SpecificFeature? = null rule.setContent { BottomSheetHeader(- panelState = PlacePanelState(detailsRevealed = true),+ panelState = PlacePanelState(), panelActions = PlacePanelActions.Noop, selectedFeature = cafe, setSelectedFeature = { selected = it },@@ -73,7 +73,7 @@ class BottomSheetHeaderDirectionsSlice2Test { val inactive = SpecificFeature.Route(listOf(null, cafe)) rule.setContent { BottomSheetHeader(- panelState = PlacePanelState(detailsRevealed = true),+ panelState = PlacePanelState(), panelActions = PlacePanelActions.Noop, selectedFeature = place, setSelectedFeature = { selected = it },@@ -87,10 +87,9 @@ class BottomSheetHeaderDirectionsSlice2Test { @Test fun `viewmodel restaurant header directions starts a fresh route`() { var selected: SpecificFeature? = null- val viewModel = SelectedFeatureViewModel(app).also { it.revealDetails() } rule.setContent { BottomSheetHeader(- viewModel = viewModel,+ viewModel = SelectedFeatureViewModel(app), selectedFeature = cafe, setSelectedFeature = { selected = it }, inactiveNavigation = null,@@ -105,10 +104,9 @@ class BottomSheetHeaderDirectionsSlice2Test { @Test fun `viewmodel place header directions appends to the inactive route`() { var selected: SpecificFeature? = null val inactive = SpecificFeature.Route(listOf(place))- val viewModel = SelectedFeatureViewModel(app).also { it.revealDetails() } rule.setContent { BottomSheetHeader(- viewModel = viewModel,+ viewModel = SelectedFeatureViewModel(app), selectedFeature = place, setSelectedFeature = { selected = it }, inactiveNavigation = inactive,
maps/src/test/java/com/vayunmathur/maps/ui/PlaceMaskTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/PlaceMaskTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/PlaceMaskTest.ktdeleted file mode 100644index 202fb66f42..0000000000--- a/maps/src/test/java/com/vayunmathur/maps/ui/PlaceMaskTest.kt+++ /dev/null@@ -1,187 +0,0 @@-package com.vayunmathur.maps.ui--import androidx.compose.runtime.LaunchedEffect-import androidx.compose.ui.test.assertIsDisplayed-import androidx.compose.ui.test.junit4.createComposeRule-import androidx.compose.ui.test.onNodeWithText-import androidx.compose.ui.test.performClick-import androidx.test.core.app.ApplicationProvider-import androidx.test.ext.junit.runners.AndroidJUnit4-import com.vayunmathur.library.map.GeoPoint-import com.vayunmathur.library.util.DataStoreUtils-import com.vayunmathur.maps.data.MapPreferences-import com.vayunmathur.maps.data.SpecificFeature-import com.vayunmathur.maps.util.PlacePanelActions-import com.vayunmathur.maps.util.PlacePanelState-import com.vayunmathur.maps.util.SavedPlacesViewModel-import com.vayunmathur.maps.util.SelectedFeatureViewModel-import kotlin.test.Test-import kotlin.test.assertEquals-import kotlin.test.assertFalse-import kotlin.test.assertNull-import kotlin.test.assertTrue-import kotlinx.coroutines.flow.drop-import kotlinx.coroutines.flow.first-import kotlinx.coroutines.runBlocking-import kotlinx.coroutines.withTimeoutOrNull-import org.junit.Rule-import org.junit.runner.RunWith--/**- * The place mask: selecting a place shows its name plus an explicit- * "Show details" action, and nothing else, until the user taps through.- * The Google enrichment ([SelectedFeatureViewModel.currentPoiInfo]) stays- * parked at null over the same window, so no place-details fetch starts- * passively on selection.- */-@RunWith(AndroidJUnit4::class)-class PlaceMaskTest {-- @get:Rule- val rule = createComposeRule()-- private val app get() = ApplicationProvider.getApplicationContext<android.app.Application>()-- private fun place(name: String = "Blue Bottle") = SpecificFeature.GenericPlace(- name = name,- phone = "555-1234",- website = null,- openingHours = null,- position = GeoPoint(-122.4, 37.8),- )-- @Test- fun `masked header shows the name and the reveal action only`() {- rule.setContent {- PlaceSheetHeader(- panelState = PlacePanelState(detailsRevealed = false),- panelActions = PlacePanelActions.Noop,- inactiveNavigation = null,- feature = place(),- requestDirections = {},- )- }- rule.onNodeWithText("Blue Bottle").assertIsDisplayed()- rule.onNodeWithText("Show details").assertIsDisplayed()- rule.onNodeWithText("Directions").assertDoesNotExist()- }-- @Test- fun `the reveal action drives revealDetails`() {- var revealed = 0- val actions = object : PlacePanelActions {- override fun revealDetails() { revealed++ }- }- rule.setContent {- PlaceSheetHeader(- panelState = PlacePanelState(detailsRevealed = false),- panelActions = actions,- inactiveNavigation = null,- feature = place(),- requestDirections = {},- )- }- rule.onNodeWithText("Show details").performClick()- assertEquals(1, revealed)- }-- @Test- fun `revealed header shows the action row`() {- rule.setContent {- PlaceSheetHeader(- panelState = PlacePanelState(detailsRevealed = true),- panelActions = PlacePanelActions.Noop,- inactiveNavigation = null,- feature = place(),- requestDirections = {},- )- }- rule.onNodeWithText("Show details").assertDoesNotExist()- rule.onNodeWithText("Directions").assertIsDisplayed()- }-- @Test- fun `a selection opens masked and one tap reveals the actions`() {- val selected = SelectedFeatureViewModel(app)- val savedVm = SavedPlacesViewModel(app)- val feature = place()- rule.runOnIdle { selected.set(feature) }- rule.setContent {- PlaceSheetHeader(- viewModel = selected,- savedPlacesViewModel = savedVm,- inactiveNavigation = null,- feature = feature,- requestDirections = {},- )- }- rule.onNodeWithText("Show details").assertIsDisplayed()- rule.onNodeWithText("Directions").assertDoesNotExist()- rule.onNodeWithText("Show details").performClick()- rule.onNodeWithText("Directions").assertIsDisplayed()- }-- @Test- fun `the reveal resets on every new selection`() {- val selected = SelectedFeatureViewModel(app)- rule.runOnIdle {- selected.set(place("First"))- assertFalse(selected.detailsRevealed.value)- selected.revealDetails()- assertTrue(selected.detailsRevealed.value)- selected.set(place("Second"))- assertFalse(selected.detailsRevealed.value)- }- }-- @Test- fun `enrichment stays parked until reveal with services on`() {- // The toggle is on, so the reveal gate is the only thing holding the- // enrichment back. Restored afterwards: other suites assume the default- // (off) and share the test app's DataStore file.- val store = DataStoreUtils.getInstance(app)- runBlocking { store.setBoolean(MapPreferences.KEY_GOOGLE_SERVICES, true) }- try {- val selected = SelectedFeatureViewModel(app)- var secondEmissionArrived = false- var flowError: Throwable? = null- var windowElapsed = false- rule.setContent {- LaunchedEffect(selected) {- try {- withTimeoutOrNull(2_000) {- selected.currentPoiInfo.drop(1).first()- secondEmissionArrived = true- }- } catch (e: Throwable) {- flowError = e- } finally {- windowElapsed = true- }- }- }- rule.runOnIdle { selected.set(place()) }- rule.waitUntil(10_000) { windowElapsed }- assertNull(flowError)- assertFalse(secondEmissionArrived)- assertFalse(selected.detailsRevealed.value)- } finally {- runBlocking { store.setBoolean(MapPreferences.KEY_GOOGLE_SERVICES, false) }- }- }-- @Test- fun `the panel state carries the reveal through the shared binder`() {- val selected = SelectedFeatureViewModel(app)- val savedVm = SavedPlacesViewModel(app)- rule.runOnIdle { selected.set(place()) }- var revealed: Boolean? = null- rule.setContent {- revealed = com.vayunmathur.maps.util.rememberPlacePanelState(selected, savedVm).detailsRevealed- }- rule.waitForIdle()- assertEquals(false, revealed)- rule.runOnIdle { selected.revealDetails() }- rule.waitUntil(10_000) { revealed == true }- }-}
maps/src/test/java/com/vayunmathur/maps/ui/PlaceSheetSlice3Test.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/PlaceSheetSlice3Test.kt b/maps/src/test/java/com/vayunmathur/maps/ui/PlaceSheetSlice3Test.ktindex b0d0032346..3a453c4354 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/PlaceSheetSlice3Test.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/PlaceSheetSlice3Test.kt@@ -57,9 +57,7 @@ class PlaceSheetSlice3Test { position = GeoPoint(-122.4, 37.8), ) - // Header tests below exercise the revealed state; the mask itself is- // pinned in PlaceMaskTest.- private fun panel() = PlacePanelState(saved = emptyList(), detailsRevealed = true)+ private fun panel() = PlacePanelState(saved = emptyList()) // --- PlaceSheet (generic) --- @@ -170,7 +168,6 @@ class PlaceSheetSlice3Test { saved = listOf( com.vayunmathur.maps.data.SavedPlace.from(genericPlace()), ),- detailsRevealed = true, ), panelActions = PlacePanelActions.Noop, inactiveNavigation = null,
maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass3HeaderTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass3HeaderTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass3HeaderTest.ktindex acfa49b7ed..0664c9c3da 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass3HeaderTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/Slice3Pass3HeaderTest.kt@@ -94,7 +94,7 @@ class Slice3Pass3HeaderTest { rule.setContent { DynamicTheme { PlaceSheetHeader(- panelState = PlacePanelState(poi = poi, detailsRevealed = true),+ panelState = PlacePanelState(poi = poi), panelActions = actions, inactiveNavigation = null, feature = place(),@@ -115,7 +115,7 @@ class Slice3Pass3HeaderTest { rule.setContent { DynamicTheme { PlaceSheetHeader(- panelState = PlacePanelState(poi = poi, detailsRevealed = true),+ panelState = PlacePanelState(poi = poi), panelActions = PlacePanelActions.Noop, inactiveNavigation = null, feature = place(),@@ -133,7 +133,7 @@ class Slice3Pass3HeaderTest { rule.setContent { DynamicTheme { PlaceSheetHeader(- panelState = PlacePanelState(poi = poi, detailsRevealed = true),+ panelState = PlacePanelState(poi = poi), panelActions = PlacePanelActions.Noop, inactiveNavigation = null, feature = place(rating = 4.9, reviewCount = 999),@@ -151,7 +151,7 @@ class Slice3Pass3HeaderTest { rule.setContent { DynamicTheme { PlaceSheetHeader(- panelState = PlacePanelState(poi = poi, detailsRevealed = true),+ panelState = PlacePanelState(poi = poi), panelActions = PlacePanelActions.Noop, inactiveNavigation = null, feature = place(),
maps/src/test/java/com/vayunmathur/maps/util/SelectedPoiInfoSlice3ExtraTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/util/SelectedPoiInfoSlice3ExtraTest.kt b/maps/src/test/java/com/vayunmathur/maps/util/SelectedPoiInfoSlice3ExtraTest.ktindex 44186b5e9e..544fcc1844 100644--- a/maps/src/test/java/com/vayunmathur/maps/util/SelectedPoiInfoSlice3ExtraTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/util/SelectedPoiInfoSlice3ExtraTest.kt@@ -86,8 +86,6 @@ class SelectedPoiInfoSlice3ExtraTest { try { val vm = SelectedFeatureViewModel(app) vm.set(SpecificFeature.GenericPlace(name, "555", null, null, GeoPoint(-122.4, 37.8)))- // The sheet only fetches Google details once the user reveals them.- vm.revealDetails() val seen = java.util.concurrent.atomic.AtomicReference<com.vayunmathur.maps.data.google.GooglePoiInfo?>(null) val job = CoroutineScope(Dispatchers.Default).launch { vm.currentPoiInfo.collect { if (it != null) seen.set(it) }@@ -121,8 +119,6 @@ class SelectedPoiInfoSlice3ExtraTest { try { val vm = SelectedFeatureViewModel(app) vm.set(SpecificFeature.GenericPlace("Nowhere Place", "555", null, null, GeoPoint(-122.4, 37.8)))- // The sheet only fetches Google details once the user reveals them.- vm.revealDetails() val seen = java.util.concurrent.atomic.AtomicReference<com.vayunmathur.maps.data.google.GooglePoiInfo?>(null) val job = CoroutineScope(Dispatchers.Default).launch { vm.currentPoiInfo.collect { seen.set(it) }
maps/src/test/java/com/vayunmathur/maps/util/SelectedRoutesReviewsSlice3ExtraTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/util/SelectedRoutesReviewsSlice3ExtraTest.kt b/maps/src/test/java/com/vayunmathur/maps/util/SelectedRoutesReviewsSlice3ExtraTest.ktindex 7a2d63a022..009ed74031 100644--- a/maps/src/test/java/com/vayunmathur/maps/util/SelectedRoutesReviewsSlice3ExtraTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/util/SelectedRoutesReviewsSlice3ExtraTest.kt@@ -91,8 +91,6 @@ class SelectedRoutesReviewsSlice3ExtraTest { try { val vm = SelectedFeatureViewModel(app) vm.set(SpecificFeature.GenericPlace(name, "555", null, null, GeoPoint(-122.4, 37.8)))- // The sheet only fetches Google details once the user reveals them.- vm.revealDetails() val seen = java.util.concurrent.atomic.AtomicReference<com.vayunmathur.maps.data.google.GooglePoiInfo?>(null) val job = CoroutineScope(Dispatchers.Default).launch { vm.currentPoiInfo.collect { if (it != null) seen.set(it) }