fix(android): split-view marker taps zoom and filter again #1195
Loading…
Reference in a new issue
No description provided.
Delete branch "ux/map-split-zoom"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
With the media sidebar open, marker taps only filtered the sidebar — the zoom was gone. Split-view taps now do both actions, non-split taps are byte-for-byte unchanged.
Cluster (count > 1) tap — split view:
handleClusterTap(...)(animated +2-level drill-in, cancelled on touch/refit, delayed viewport re-emit) andviewModel.selectCluster(cluster.id)(sidebar filter; re-tap still toggles it off through the unchanged ViewModel).Single-marker tap — split view:
viewModel.selectCluster(cluster.id)(filters the sidebar to that one-item cluster) andviewModel.selectMarker(single.id)(opens the photo card). The sheet is aModalBottomSheetpopup, so it floats above both panes and the filtered sidebar stays visible underneath.selectMarkeronly writesselectedMarkerIdandselectClusteronly writesselectedClusterId+sidebarItems, so the two coexist without clobbering each other.Non-split: unchanged — clusters zoom, singles open their sheet. The split flag now only gates the extra
selectClustercall, which is what makes the both-actions semantics fall out of a two-line branch instead of duplicated code paths.The listener's comment block was rewritten to document the new both-actions semantics.
Why this survives the zoom
MapViewModel.onViewportChangedrecomputessidebarItemsfromsidebarItemsFor(clusters, selectionSurvives)and drops a selection only when its cluster vanished from the new answer (webclearStaleClusterSelectionparity) — so the filter stays applied as the drill-in lands, and clears itself honestly if the zoomed viewport no longer contains that cluster.Not changed
MapViewModel(no behaviour or API edits — both calls already existed), non-split tap behaviour, no CHANGELOG/version edits.Validation
apps/android:./gradlew :app:compileDebugKotlin :app:testDebugUnitTest --no-daemon→ BUILD SUCCESSFUL; 422 unit tests, 0 failures / 0 errors, includingMapViewModelTest(32 tests, untouched file).MapScreen.ktonly: 12 insertions / 10 deletions.