feat(web): add photos to existing album from selection + viewer (Spec 064) #1279

Merged
chris merged 2 commits from spec/064-web into main 2026-10-17 09:24:34 +02:00
Owner

Summary

Spec 064 Web-Lane. Nach PR #1278 (API-Batch-Endpoint) mergen — siehe ISSUE-168.

  • AddToAlbumDialog generalisiert: mediaItemId: string → mediaItemIds: string[], count-aware Header, beide Pfade (bestehend/neu) über Batch, Album-Liste auf reviewState === 'accepted' gefiltert, completed-Event + Toast + Selbstschluss
  • lib/api/albums.ts: neu addAlbumItems(albumId, ids) → POST /items/batch, Body { mediaItemId: [...] }, Response { added, skipped }; leeres Array = No-Op
  • Timeline-SelectionToolbar: neuer Button „Zu bestehendem Album" neben „Album erstellen"; Auswahl danach leeren + Bestätigung
  • MediaViewer.svelte: nur auf das Array-Prop migriert ([mediaItemId])
  • i18n: 10 neue Keys (Plural-ICU) in en/de/da, Key-Sets symmetrisch (2415 Keys)
  • Tests: API-Client-Vertrag, Dialog-SSR, Playwright-Flow (Auswahl → Batch-POST-Body → Auswahl geleert)

Verification

  • npm run check → 0 errors / 20 warnings (bestehende a11y-Backdrop-Warnings)
  • npm run test:unit → 274/274 grün
  • npm run build → ok
  • Playwright desktop: 55 passed, 8 skipped, 0 failed

Merge-Reihenfolge

Nicht vor #1278 mergen (Batch-Endpoint existiert auf main noch nicht). createAlbumWithItems („Album erstellen") läuft weiterhin Single-Requests und ist ohne #1278 funktionsfähig.

Refs: spec 064, S064T002

## Summary Spec 064 Web-Lane. Nach PR #1278 (API-Batch-Endpoint) mergen — siehe ISSUE-168. - `AddToAlbumDialog` generalisiert: `mediaItemId: string` → `mediaItemIds: string[]`, count-aware Header, beide Pfade (bestehend/neu) über Batch, Album-Liste auf `reviewState === 'accepted'` gefiltert, `completed`-Event + Toast + Selbstschluss - `lib/api/albums.ts`: neu `addAlbumItems(albumId, ids)` → `POST /items/batch`, Body `{ mediaItemId: [...] }`, Response `{ added, skipped }`; leeres Array = No-Op - Timeline-SelectionToolbar: neuer Button „Zu bestehendem Album" neben „Album erstellen"; Auswahl danach leeren + Bestätigung - `MediaViewer.svelte`: nur auf das Array-Prop migriert (`[mediaItemId]`) - i18n: 10 neue Keys (Plural-ICU) in en/de/da, Key-Sets symmetrisch (2415 Keys) - Tests: API-Client-Vertrag, Dialog-SSR, Playwright-Flow (Auswahl → Batch-POST-Body → Auswahl geleert) ## Verification - `npm run check` → 0 errors / 20 warnings (bestehende a11y-Backdrop-Warnings) - `npm run test:unit` → 274/274 grün - `npm run build` → ok - Playwright desktop: 55 passed, 8 skipped, 0 failed ## Merge-Reihenfolge Nicht vor #1278 mergen (Batch-Endpoint existiert auf main noch nicht). `createAlbumWithItems` („Album erstellen") läuft weiterhin Single-Requests und ist ohne #1278 funktionsfähig. Refs: spec 064, S064T002
feat(web): add photos to existing album from selection and viewer
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 4s
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 Android CI 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 / Android unit tests and debug APK (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 10m54s
abcd0d3da1
Spec 064 / S064T002: generalise AddToAlbumDialog to a mediaItemIds
selection snapshot and add a 'add to existing album' action to the
timeline SelectionActionBar.

- albums.ts: new addAlbumItems(albumId, ids) -> POST /items/batch
  ({ mediaItemId: [...] } -> { added, skipped }); empty list is a
  client-side no-op. addAlbumItem (single) and createAlbumWithItems
  stay untouched for compatibility.
- AddToAlbumDialog: mediaItemId -> mediaItemIds[]; count-aware plural
  header/buttons/toasts (new paraglide keys en/de/da); existing-album
  picker filtered to reviewState === 'accepted' (mirrors the album-page
  move picker); both paths (existing album, create new) go through the
  batch endpoint; success shows a toast, dispatches completed with
  {albumId, albumName, added, skipped, message} and closes the dialog.
  Pre-existing hardcoded 'Add'/'Name'/'optional' labels extracted.
- Timeline (+page.svelte): new album-icon button next to 'Create album'
  opens the dialog with a snapshot of the owner-selected ids; on
  completed the selection is cleared and the localized confirmation is
  shown inline. Tiles deliberately get no '...' menu (out of scope).
- MediaViewer: passes [mediaItemId]; behaviour otherwise unchanged.
- i18n: removed now-unused singular keys (addToAlbumTitle/Toast/
  CreatedToast/CreateThisImage); all new labels via locale files.
- Tests: albums.spec.ts (batch contract + empty no-op + single kept),
  AddToAlbumDialog.spec.ts (SSR count copy 1 vs N), timeline.spec.ts
  new desktop flow test (selection -> dialog -> batch POST body ->
  selection cleared) and the existing viewer album test migrated to
  the batch endpoint, accepted-only list and self-closing dialog.

Note: depends on the parallel API worktree's POST /items/batch
(ISSUE-168) — merge after the API side.
Merge remote-tracking branch 'origin/main' into spec/064-web
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 Android CI 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 / Android unit tests and debug APK (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 8m26s
09e2698ef6
# Conflicts:
#	KNOWN_ISSUES.md
chris merged commit 8475f4b58f into main 2026-10-17 09:24:34 +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!1279
No description provided.