feat(documents): delete original images and show real storage usage - #711
Draft
farfromrefug wants to merge 2 commits into
Draft
feat(documents): delete original images and show real storage usage#711farfromrefug wants to merge 2 commits into
farfromrefug wants to merge 2 commits into
Conversation
basename() threw on a null sourceImagePath when importing from remote or restoring a backup, and the crop/transforms regeneration needs a local original. Refs #706 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A page keeps a copy of the image it was created from, which doubles the storage of a kept document. Add a "keep original images" setting, on by default, a manual action on selected documents/pages, and a storage view listing documents by size so the space can be reclaimed knowingly. Track the original size per page (new column, backfilled) so lists show what a document really uses. A page without its original can't be cropped or transformed anymore: hide the crop button and the transform rows, color filters stay. Refs #706 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1.2 MB (2.4 MB total)— processed images first (what an export weighs), total including originals in parentheses. Backed by a newPage.sourceSizecolumn, backfilled by a migration.Storage location settings moved from the Android-only
datasection into the newstoragesection, now visible on both platforms.Testing
npx vitest run— 273 pass, including new unit tests forapp/utils/originals.tsyarn svelte-checkclean (same 2 pre-existing errors asmain),npx eslintclean on changed filesimage.jpg), the manual action + freed size snack, the storage view layout/selection, and a sync round-trip of a document whose originals were deleted. TheaddPageSourceSizemigration should also be checked on a large library (it stats every original once).Refs #706