feat(discovery): surface all tags and guard folder removal

Include tags used by a single image in Explore and invalidate the tag cache after edits so changes appear immediately. Add an accessible, time-limited confirmation step before removing indexed folders from the sidebar.
This commit is contained in:
2026-06-06 19:52:05 +01:00
parent 6824dcffb3
commit 2cdab000fb
3 changed files with 71 additions and 22 deletions
+6 -1
View File
@@ -1360,15 +1360,20 @@ export const useGalleryStore = create<GalleryState>((set, get) => ({
},
addUserTag: async (imageId, tag) => {
return invoke<ImageTag>("add_user_tag", {
const result = await invoke<ImageTag>("add_user_tag", {
params: { image_id: imageId, tag },
});
// Invalidate explore tags cache so new tag appears immediately
set({ exploreTagsFolderId: undefined });
return result;
},
removeTag: async (tagId) => {
await invoke<void>("remove_tag", {
params: { tag_id: tagId },
});
// Invalidate explore tags cache so removed tag disappears immediately
set({ exploreTagsFolderId: undefined });
},
loadDuplicateScanCache: async (folderId = null) => {