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.
This commit is contained in:
iu
2026-10-12 12:14:48 +03:00
parent eef7c6c5d0
commit e4975aafb5
9 changed files with 190 additions and 1 deletions
@@ -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() {
@@ -0,0 +1,11 @@
import type { Photo } from '$lib/types';
class PhotoUpdatesStore {
latest = $state<Photo | null>(null);
publish(photo: Photo) {
this.latest = photo;
}
}
export const photoUpdates = new PhotoUpdatesStore();