feat(android): map media sidebar (viewport photos next to the map) #1177
Loading…
Reference in a new issue
No description provided.
Delete branch "ux/map-media-sidebar"
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
Ports the web map's split view to the Android map tab: a media sidebar runs parallel to the map showing the photos in the current viewport, so family can browse what's on screen instead of only tapping markers.
Split toggle — a FilterChip ("Fotos",
ViewAgendaicon) in the existing scope-chip row (MapScopeRow), next to Alle/Meine and the satellite toggle. Defaults off and persists across tab re-entry like the satellite choice (app-scoped ViewModel).Layout —
BoxWithConstraints: <600dp stacks (map ~38.2% on top, grid below); >=600dp sits side by side (map ~61.8% left, sidebar right) — the same 38.2/61.8 split the web map uses. The map keeps full osmdroid interactivity; no drawer.Sidebar — 3-column
LazyVerticalGridreusing the timeline's thumbnail-cell idiom (Coil cell-sized decodes, pending/failed handling), items =viewerItemssorted newest-first client-side (capture-time desc, id tiebreak, unparseable/missing timestamps last). Tapping a cell opens the existing media viewer. Empty ("In diesem Kartenausschnitt gibt es noch keine Fotos."), error, and loading notes included.Cluster / marker taps — in split view, a cluster tap filters the sidebar to that cluster (banner: photo count + "Auswahl aufheben") instead of zooming; a single-marker tap filters the sidebar to that photo's cluster. Non-split behaviour (zoom drill-down / bottom sheet) is unchanged. Stale cluster selection is dropped when a new viewport answer no longer contains it, on scope change, and on leaving split mode.
Per-item "Auf Karte zentrieren" — small circular pin overlay in the cell's top-end corner; flies the camera (zoom 16, animateTo), emits the viewport after the animation, then consumes the request so a recomposition can't yank the camera back.
Truncation — banner when the flattened viewport answer reaches
markerLimit=500, worded as "first N loaded".Unchanged — marker pipeline (
MarkerThumbnails.kt, rebuild loop),markerLimit=500, no API/backend/web/version-file changes.Records [ISSUE-143] (
low,open,area:android): the truncation banner infers "capped" from the de-duplicated flattened count, so a viewport whose raw rows hit the cap but carry cross-cluster duplicates shows no banner; a real total needs a count-only viewport mode server-side (related to ISSUE-131).Validation
From
apps/android/withANDROID_HOME=/home/chris/Android/Sdk:./gradlew :app:compileDebugKotlin— BUILD SUCCESSFUL./gradlew :app:testDebugUnitTest --rerun-tasks— BUILD SUCCESSFUL; full suite 410 tests, 0 failures, 0 errorsMapViewModelTest— 31 tests, 0 failures (10 new): split toggle default + persists across setScope + resets on session change; leaving split clears selection; selectCluster / re-tap clears; "Auswahl aufheben"; stale-selection dropped when new viewport lacks it; selection dropped on scope change; newest-first ordering (capture desc, unparseable last); truncation flag at cap; centerOnItem monotonic epoch + consume + missing-item no-op; removeItem syncs sidebar.origin/main(cdeb9016); no android sources changed on main since the validated base, so evidence holds.German labels throughout; accessibility: pin button carries
contentDescription = "Auf Karte zentrieren", grid imagescontentDescription = null.Adds a persistable split view to the Android map tab, porting the web map's sidebar: media in the current viewport sits beside the map instead of only behind its markers. - Split toggle is a FilterChip ('Fotos') in the existing scope-chip row; it defaults off and persists across tab re-entry like satellite mode (app-scoped ViewModel). - Layout via BoxWithConstraints: <600dp stacks (map ~38.2% top, grid below), >=600dp sits side by side (map ~61.8% left). The map keeps full osmdroid interactivity; no drawer. - Sidebar shows viewerItems in a 3-column grid, newest first client-side (capture time desc, id tiebreak, unparseable last). Cells reuse the timeline's thumbnail idiom (Coil cell-sized decodes, pending/failed states). Tap opens the existing media viewer. - In split view, a cluster tap filters the sidebar (banner: count + 'Auswahl aufheben') instead of zooming; a single-marker tap filters to its cluster. Non-split behaviour (zoom / bottom sheet) is unchanged. - Per-item 'Auf Karte zentrieren' pin drops the camera on that photo (zoom 16, animateTo, delayed viewport emit, then consumed). - Truncation notice when the flattened viewport answer reaches markerLimit=500. - New MapUiState fields (sidebarItems, isViewportTruncated, splitView, selectedClusterId, centerRequest); stale cluster selection dropped when a new viewport no longer contains it, on scope change, and on leaving split mode. - Marker pipeline (MarkerThumbnails.kt, rebuild loop) unchanged; no API, backend, web, or version-file changes. Validation: MapViewModelTest 31 tests / 0 failures (10 new: toggle default + persist + reset, leaving split clears selection, select/re-tap clear, Auswahl aufheben, stale-selection drop, scope drop, newest-first ordering, truncation flag at cap, centerOnItem epoch/consume/missing-item, removeItem sidebar sync); full android unit suite 410 tests / 0 failures; compileDebugKotlin OK. Records [ISSUE-143] (truncation inference undercount under de-dup).- Truncation notice: grounded wording ('Die ersten N Fotos sind geladen, zoome näher für weitere') instead of the double 'geladen/zu werden' tail - Cluster banner: plain count statement instead of the passive 'wird gezeigt' phrasing - Loading description moves from a hardcoded German literal into map_sidebar_loading so it stays localizable19ab0f71b67a23ab7ea4