Web: Media Browser reports a picked file it can't read (#226)

Add Files... and Upload Folder... read every picked file in one go and
rejected on the first file the browser couldn't read; the Media
Browser dropped that rejection, so nothing was added and nothing said
why. Each file is now read on its own: the readable ones are added and
the status bar names the unreadable ones with the browser's reason and
suggests picking them again. Cancelling the picker is not reported.

Test: apps/effectcraft-web/tests/page.mjs (Node, fake DOM).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-08 12:38:11 +07:00
co-authored by Claude Opus 5.5
parent 7612b220ef
commit 82a1862fa1
5 changed files with 122 additions and 19 deletions
+6 -1
View File
@@ -230,7 +230,8 @@ Window ▸ Media Browser browses a virtual tree (`src/browse.rs`):
- **Browser Storage**: every file in browser storage (imported media, saved projects, files added
with **Add Files…** or **Upload Folder…**, plain file inputs that work in every browser). This is
the persistent recent list where folders can't be opened.
the persistent recent list where folders can't be opened. A picked file that can't be read is
named in the status bar with the browser's reason, and the others are still added.
- **Folders**: **Open Folder…** (File System Access API, `showDirectoryPicker`, Chromium) lists a
folder from the user's disk; only the listing is read, and a file's bytes are read when it is
imported (then kept in browser storage). The folder handles are remembered in IndexedDB; after
@@ -418,6 +419,10 @@ node apps/effectcraft-web/tests/smoke.mjs --url http://127.0.0.1:8765/ --out tar
reused worker again even at the same size, and a worker that fails to start fails its job and is
terminated (`node apps/effectcraft-web/tests/workers.mjs`).
`apps/effectcraft-web/tests/page.mjs` checks page-side helpers of `js/host.js` the same way with
a fake DOM: a picked file that can't be read is reported while the others are added
(`node apps/effectcraft-web/tests/page.mjs`).
It also checks the M13.10 paths: viewer frames rendered in frame workers while scrubbing with the
CPU renderer (project synced as diffs, event-loop gaps under 400 ms), a `wait: true` render that
replies when done while the page keeps running, and the Media Browser over browser storage; and