From e4975aafb597a9d1e57f8910b959a898740f2829 Mon Sep 17 00:00:00 2001 From: Iu Date: Mon, 12 Oct 2026 12:14:48 +0300 Subject: [PATCH] fix(ui): propagate photo tag edits to grid and viewer Add a shared photo-updates signal the panel publishes on rename or tag add/remove; the album grid and viewer subscribe and patch the changed photo into their lists, so the 360 badge and panorama mode update without a reload. --- frontend/src/lib/components/AlbumPanel.svelte | 2 + .../src/lib/stores/photo-updates.svelte.ts | 11 +++ .../src/routes/(app)/albums/[id]/+page.svelte | 15 +++- .../albums/[id]/photos/[photoId]/+page.svelte | 14 ++++ .../changes/fix-photo-tag-sync/.openspec.yaml | 2 + openspec/changes/fix-photo-tag-sync/design.md | 73 +++++++++++++++++++ .../changes/fix-photo-tag-sync/proposal.md | 38 ++++++++++ .../specs/ui-workspace/spec.md | 16 ++++ openspec/changes/fix-photo-tag-sync/tasks.md | 20 +++++ 9 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 frontend/src/lib/stores/photo-updates.svelte.ts create mode 100644 openspec/changes/fix-photo-tag-sync/.openspec.yaml create mode 100644 openspec/changes/fix-photo-tag-sync/design.md create mode 100644 openspec/changes/fix-photo-tag-sync/proposal.md create mode 100644 openspec/changes/fix-photo-tag-sync/specs/ui-workspace/spec.md create mode 100644 openspec/changes/fix-photo-tag-sync/tasks.md diff --git a/frontend/src/lib/components/AlbumPanel.svelte b/frontend/src/lib/components/AlbumPanel.svelte index c9656ac..cd1c5b4 100644 --- a/frontend/src/lib/components/AlbumPanel.svelte +++ b/frontend/src/lib/components/AlbumPanel.svelte @@ -9,6 +9,7 @@ import PhotoPanel from './PhotoPanel.svelte'; import { albums } from '$lib/stores/albums.svelte'; import { selection } from '$lib/stores/selection.svelte'; + import { photoUpdates } from '$lib/stores/photo-updates.svelte'; import { transfer } from '$lib/stores/transfer.svelte'; import type { Album, Photo } from '$lib/types'; @@ -52,6 +53,7 @@ function onRenamed(updated: Photo) { photo = updated; if (selectedItems.some((p) => p.id === updated.id)) selection.replace(updated); + photoUpdates.publish(updated); } function onDeleted() { diff --git a/frontend/src/lib/stores/photo-updates.svelte.ts b/frontend/src/lib/stores/photo-updates.svelte.ts new file mode 100644 index 0000000..134179d --- /dev/null +++ b/frontend/src/lib/stores/photo-updates.svelte.ts @@ -0,0 +1,11 @@ +import type { Photo } from '$lib/types'; + +class PhotoUpdatesStore { + latest = $state(null); + + publish(photo: Photo) { + this.latest = photo; + } +} + +export const photoUpdates = new PhotoUpdatesStore(); diff --git a/frontend/src/routes/(app)/albums/[id]/+page.svelte b/frontend/src/routes/(app)/albums/[id]/+page.svelte index 04accee..baa8b41 100644 --- a/frontend/src/routes/(app)/albums/[id]/+page.svelte +++ b/frontend/src/routes/(app)/albums/[id]/+page.svelte @@ -1,7 +1,7 @@