Skip to content

feat(documents): delete original images and show real storage usage - #711

Draft
farfromrefug wants to merge 2 commits into
mainfrom
feat/706-delete-original-images
Draft

feat(documents): delete original images and show real storage usage#711
farfromrefug wants to merge 2 commits into
mainfrom
feat/706-delete-original-images

Conversation

@farfromrefug

Copy link
Copy Markdown
Collaborator

Summary

  • New keep original images setting (image settings, on by default). When off, the copy of the source image is no longer stored when a page is created, halving the storage of a kept document.
  • Manual delete original images action on selected documents (main list), selected pages and whole document (document view), with confirmation and the freed space reported.
  • New documents storage view under settings › storage: total + originals, documents sorted by size, tap to open, selection with delete originals / delete documents, and a "delete all original images" action.
  • Lists now show what a document really uses: 1.2 MB (2.4 MB total) — processed images first (what an export weighs), total including originals in parentheses. Backed by a new Page.sourceSize column, backfilled by a migration.
  • A page without its original can't be re-cropped or re-transformed: the crop button and the transform rows are hidden, color filters / brightness / contrast stay available. Sync and backup restore handle pages with no original.

Storage location settings moved from the Android-only data section into the new storage section, now visible on both platforms.

Testing

  • npx vitest run — 273 pass, including new unit tests for app/utils/originals.ts
  • yarn svelte-check clean (same 2 pre-existing errors as main), npx eslint clean on changed files
  • ⚠️ Visual check still required — not run on device/emulator. Worth verifying: capture a page with the setting off (page folder should only hold image.jpg), the manual action + freed size snack, the storage view layout/selection, and a sync round-trip of a document whose originals were deleted. The addPageSourceSize migration should also be checked on a large library (it stats every original once).

Refs #706

farfromrefug and others added 2 commits August 15, 2026 16:58
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant