feat(android): Phase 1 albums — list, create, add/remove photos #1121

Merged
chris merged 5 commits from ux-android-albums into main 2026-10-11 19:35:52 +02:00
Owner

What

Spec 055 T007: server albums in the Android app.

  • API client — GET/POST /api/albums, GET/PUT/DELETE /api/albums/{id}, POST/DELETE /api/albums/{id}/items in one additive block (timeline/search convention). JSON tests pin the wire shapes; suggestion-provenance fields tolerated, never rendered.
  • List screen — "Alben" card in MEHR (same whole-card pattern as "Suche"). Album cards with cover, name, count; create via FAB dialog (name required, description optional); rename + delete behind a per-album overflow menu. Delete confirmation spelled out in plain German: the album goes, the photos stay in the library.
  • Detail screen — 3-column thumbnail grid (same idiom as timeline/search); tap opens the existing full-bleed MediaViewerScreen over the album's own item list (correct start index). Rename in the top bar, delete behind a confirmation.
  • Add photos — "Hinzufügen" (top bar + empty state) reuses the day-sectioned timeline as the selection surface; tap toggles a photo, header shows the running count, confirm loops one POST per photo (no batch endpoint) and appends the server's answers so new photos appear without a refetch.
  • Remove from album — long-press selection inside the album detail; "Entfernen" loops one DELETE per photo behind a confirmation ("Nur aus dem Album entfernt — die Fotos bleiben in deiner Bibliothek.").
  • i18n — every user-visible string in values/ (de) + values-da/ + values-en/; "Memories" untranslated; plurals parity checked.

Commit structure (rebased on 4d3731b9)

  1. 23fcd424 API client + JSON tests
  2. 27cc6aee list screen
  3. 2efdf1cd detail screen + viewer entry + remove
  4. 2a3201ea timeline selection mode (isolated — the TimelineScreen.kt edit is self-contained)
  5. f17e5e0c chore: 0.1.8 / versionCode 9, KNOWN_ISSUES

Notes

  • AlbumDetailViewModel is hoisted to the app scope (like SearchViewModel) so the viewer and the add-photos picker read the same item list without refetching — this is the pattern ISSUE-121 recommends and is unaffected by that bug.
  • ISSUE-124 (low): list covers fan out one GET /api/albums/{id} per album (list endpoint carries no cover URL). Fine at family scale.
  • ISSUE-125 (low): album detail has no item cursor, so a very large album loads whole.

Verification

./gradlew :app:testDebugUnitTest :app:assembleDebug — 240 tests, 0 failures, BUILD SUCCESSFUL after rebase onto current origin/main.

## What Spec 055 T007: server albums in the Android app. - **API client** — `GET/POST /api/albums`, `GET/PUT/DELETE /api/albums/{id}`, `POST/DELETE /api/albums/{id}/items` in one additive block (timeline/search convention). JSON tests pin the wire shapes; suggestion-provenance fields tolerated, never rendered. - **List screen** — "Alben" card in MEHR (same whole-card pattern as "Suche"). Album cards with cover, name, count; create via FAB dialog (name required, description optional); rename + delete behind a per-album overflow menu. Delete confirmation spelled out in plain German: the album goes, the photos stay in the library. - **Detail screen** — 3-column thumbnail grid (same idiom as timeline/search); tap opens the existing full-bleed `MediaViewerScreen` over the album's own item list (correct start index). Rename in the top bar, delete behind a confirmation. - **Add photos** — "Hinzufügen" (top bar + empty state) reuses the day-sectioned timeline as the selection surface; tap toggles a photo, header shows the running count, confirm loops one `POST` per photo (no batch endpoint) and appends the server's answers so new photos appear without a refetch. - **Remove from album** — long-press selection inside the album detail; "Entfernen" loops one `DELETE` per photo behind a confirmation ("Nur aus dem Album entfernt — die Fotos bleiben in deiner Bibliothek."). - **i18n** — every user-visible string in `values/` (de) + `values-da/` + `values-en/`; "Memories" untranslated; plurals parity checked. ## Commit structure (rebased on `4d3731b9`) 1. `23fcd424` API client + JSON tests 2. `27cc6aee` list screen 3. `2efdf1cd` detail screen + viewer entry + remove 4. `2a3201ea` timeline selection mode (isolated — the `TimelineScreen.kt` edit is self-contained) 5. `f17e5e0c` chore: 0.1.8 / versionCode 9, KNOWN_ISSUES ## Notes - `AlbumDetailViewModel` is hoisted to the app scope (like `SearchViewModel`) so the viewer and the add-photos picker read the same item list without refetching — this is the pattern ISSUE-121 recommends and is unaffected by that bug. - **ISSUE-124** (low): list covers fan out one `GET /api/albums/{id}` per album (list endpoint carries no cover URL). Fine at family scale. - **ISSUE-125** (low): album detail has no item cursor, so a very large album loads whole. ## Verification `./gradlew :app:testDebugUnitTest :app:assembleDebug` — **240 tests, 0 failures**, BUILD SUCCESSFUL after rebase onto current `origin/main`.
Spec 055 T007. DTOs and endpoints for /api/albums in one additive block,
matching the timeline/search convention so concurrent lanes merge cleanly.
JSON tests pin the wire shapes (suggestion provenance fields tolerated,
server-relative media urls, missing optional fields).
Entry point is the new "Alben" card in the MEHR hub, same whole-card
pattern as search. Covers fan out one detail request per album after the
list lands (the list endpoint carries no cover); a failed cover keeps the
placeholder. Create via FAB dialog, rename/delete behind each card's
overflow, delete spelled out in plain language: the album goes, the photos
stay. All copy localized de/da/en.
Detail screen reuses the app's 3-column thumbnail grid and opens the existing
full-bleed MediaViewerScreen over exactly the album's item list, so the start
index always matches the tapped tile. Rename sits in the top bar, delete in an
overflow menu behind a confirmation. Long-press enters selection mode (count
in the bar) and 'Entfernen' loops one DELETE per photo — no batch endpoint —
confirming in plain German that only the album changes, the photos stay.
ViewModel is app-scoped (like search) so the viewer reads the same list
without refetching.
Isolated final commit: the day-sectioned timeline doubles as the album's
photo picker. A picker header replaces title/search/scope chips (count +
confirm); any tap or long-press toggles a photo; outside the picker the
timeline keeps its tap-to-open behavior untouched. The picker screen brings
its own TimelineViewModel and hands the selection to the album's
AlbumDetailViewModel, whose addItems loops one POST per photo (no batch
endpoint) and appends the server's answers so the new photos appear without
a refetch. Detail screen gains the "Hinzufügen" action in the top bar and
on the empty state.
chore(android): bump to 0.1.8 (versionCode 9); log album N+1 and paging notes
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 / 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 4s
Build and Deploy / Android unit tests and debug APK (push) Successful in 2m55s
f17e5e0cc2
ISSUE-124: list covers fan out one detail request per album (no cover field
on GET /api/albums). ISSUE-125: album detail has no item cursor, so a very
large album loads whole. Both low, both logged with the follow-up shape.
chris merged commit be7c347655 into main 2026-10-11 19:35:52 +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!1121
No description provided.