feat(android): map media sidebar (viewport photos next to the map) #1177

Merged
chris merged 2 commits from ux/map-media-sidebar into main 2026-10-13 00:55:22 +02:00
Owner

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", ViewAgenda icon) 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 LazyVerticalGrid reusing the timeline's thumbnail-cell idiom (Coil cell-sized decodes, pending/failed handling), items = viewerItems sorted 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/ with ANDROID_HOME=/home/chris/Android/Sdk:

  • ./gradlew :app:compileDebugKotlin — BUILD SUCCESSFUL
  • ./gradlew :app:testDebugUnitTest --rerun-tasks — BUILD SUCCESSFUL; full suite 410 tests, 0 failures, 0 errors
  • MapViewModelTest — 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.
  • Rebased onto latest 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 images contentDescription = null.

## 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", `ViewAgenda` icon) 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 `LazyVerticalGrid` reusing the timeline's thumbnail-cell idiom (Coil cell-sized decodes, pending/failed handling), items = `viewerItems` sorted 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/` with `ANDROID_HOME=/home/chris/Android/Sdk`: - `./gradlew :app:compileDebugKotlin` — BUILD SUCCESSFUL - `./gradlew :app:testDebugUnitTest --rerun-tasks` — BUILD SUCCESSFUL; full suite **410 tests, 0 failures, 0 errors** - `MapViewModelTest` — **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. - Rebased onto latest `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 images `contentDescription = null`.
feat(android): map media sidebar (viewport photos next to the map)
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 5s
Build and Deploy / Android unit tests and debug APK (push) Successful in 13m58s
a1ee5fd583
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).
ux(android): polish map sidebar copy
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 5s
Build and Deploy / Android unit tests and debug APK (push) Successful in 4m30s
19ab0f71b6
- 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 localizable
chris force-pushed ux/map-media-sidebar from 19ab0f71b6
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 5s
Build and Deploy / Android unit tests and debug APK (push) Successful in 4m30s
to 7a23ab7ea4
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 5s
Build and Deploy / Android unit tests and debug APK (push) Successful in 2m4s
2026-10-13 00:52:56 +02:00
Compare
chris merged commit ae1b071642 into main 2026-10-13 00:55:22 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1177
No description provided.