diff --git a/docker/frontend/src/Library.tsx b/docker/frontend/src/Library.tsx index ce0a8b2..9e59cc8 100644 --- a/docker/frontend/src/Library.tsx +++ b/docker/frontend/src/Library.tsx @@ -36,6 +36,7 @@ import { remoteUrl, removeFolder, renameFolder, + resetEdit, scanAsked, scanBusy, scanQueue, @@ -1277,6 +1278,23 @@ function Catalogue({ admin }: { admin: boolean }) { go(`/app?lib=${encodeURIComponent(photo.id)}`); }, [t]); + // Put a frame back: the recipe goes, the graded tile goes with it, and the frame + // is drawn again from the negative. Everything this screen holds a copy of goes + // too — the URL it is painting and the mark that says the frame was ever touched + // — which is what makes the wall draw the tile it is about to be handed. + const resetSetting = useCallback(async (photo: LibraryPhoto) => { + const blob = await resetEdit(photo).catch(() => null); + dropThumbUrl(photo.id); + if (blob) cacheObjectUrl(photo.id, blob); + setEdited((prev) => { + if (!prev.has(photo.id)) return prev; + const next = new Set(prev); + next.delete(photo.id); + return next; + }); + setTilesAt((n) => n + 1); + }, []); + const rootFolder = useMemo(() => { if (!node) return folders[0] ?? null; const normNode = normPath(node); @@ -3163,6 +3181,24 @@ function Catalogue({ admin }: { admin: boolean }) { ) : null} + {/* The frame's own look, taken back: what the studio filed for it and the + tile it drew from it, so the shelf shows the picture the frame came in + with — the tile as it was first drawn, and the preview the file's own + develop gives. */} + +