Skip to content

Open big folders fast in the desktop app; don't sync files over 500 MB (v0.22.0) - #54

Merged
ralyodio merged 1 commit into
mainfrom
fix/desktop-big-folders-sync-cap
Oct 23, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/desktop-big-folders-sync-cap

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Follow-up to #53. ~/Desktop opened through the native dialog but the side panel never filled.

Measured on a real ~/Desktop (22k readable files, 2.6 GB, two 6 GB films): load() hit the 5,000-file cap and sent 644 MB of file bytes in one IPC message, plus 109 files over 4 MB (1.5 GB) that the page then read whole and copied into IndexedDB. Signed out it took about 60 s at about 2 GB RSS to show 75 files. Signed in, it also queued all of it for sync upload.

Changes

  • desktop/main.cjs: load() lists files (path, name, relative, size) and sends no bytes.
  • site/disk.ts: fromDesktop reads small files one at a time over readFile. For files over 4 MB it reads only the first 64 KB to classify them. Progress is reported to the status line.
  • site/blobs.ts: fromDisk(ref, read) registers a disk reader, which local() and bytes() check first. Large files, PDFs and images the desktop opened are never copied into IndexedDB. Reopening the folder reuses the stored reference (same path and size), so sync doesn't upload them again. After a restart the viewer asks you to open the folder again.
  • site/autosync.ts and site/sync.ts: a sync size limit, 500 MB by default, set per device. The Sync dialog shows "Don't sync files larger than [500] MB", and unchecking it syncs every file (limit 0). Large docs on either side stay out of the merge. The account's large docs are uploaded back unchanged and this device's are put back after applying, so a lower limit here never deletes another device's synced file. The status line says how many files were kept on this device.

Tests: typecheck clean, 198/198 unit tests, 27/27 viewer and sync specs (2 new: desktop listing with nothing copied, and the sync limit, including turning it off), 13/13 paste and sharing specs.

🤖 Generated with Claude Code

…B (v0.22.0)

Opening ~/Desktop (22k files, 2.6 GB) sent 644 MB of bytes to the page in one
IPC message and copied 1.5 GB of large files into browser storage before the
side panel showed anything; signed in, sync then uploaded it all.

- The desktop app lists a folder (names and sizes) and the page reads each
  file when it needs it, with a progress count in the status line.
- Large files, PDFs and images the desktop app opened are read from disk on
  demand (blobs.fromDisk), never copied into IndexedDB. Reopening the folder
  keeps their stored reference, so sync does not upload them again.
- Sync skips files larger than 500 MB by default. The Sync dialog has
  "Don't sync files larger than [500] MB"; unchecking it syncs everything.
  Large files on either side stay out of the merge, so a file another device
  synced with a higher limit is never deleted here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 3260dd3 into main Oct 23, 2026
14 checks passed
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