feat(web): add photos to existing album from selection + viewer (Spec 064) #1279
Loading…
Reference in a new issue
No description provided.
Delete branch "spec/064-web"
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
Spec 064 Web-Lane. Nach PR #1278 (API-Batch-Endpoint) mergen — siehe ISSUE-168.
AddToAlbumDialoggeneralisiert:mediaItemId: string→mediaItemIds: string[], count-aware Header, beide Pfade (bestehend/neu) über Batch, Album-Liste aufreviewState === 'accepted'gefiltert,completed-Event + Toast + Selbstschlusslib/api/albums.ts: neuaddAlbumItems(albumId, ids)→POST /items/batch, Body{ mediaItemId: [...] }, Response{ added, skipped }; leeres Array = No-OpMediaViewer.svelte: nur auf das Array-Prop migriert ([mediaItemId])Verification
npm run check→ 0 errors / 20 warnings (bestehende a11y-Backdrop-Warnings)npm run test:unit→ 274/274 grünnpm run build→ okMerge-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
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.