List previz in Storage and purge old playblasts (#167) #178

Merged
crowmaki merged 2 commits from issue-167-previz-storage into main 2026-10-11 06:38:18 +00:00
Owner

Closes #167. Part of #139.

What changed

Storage now lists previz, so the filmmaker can reclaim space from old playblasts.

  • Playblast rows. There is one row per previz version (1A playblast v2), with its size and the space a purge would free. It lists what uses it: the Shot while this version is its current previz, and every Take that was sent it.
  • Blender file rows. There is one row per .blend file in each Shot's previz folder. This covers scene.blend, the scene-set-aside-N.blend files that "Rebuild Blender scene" leaves, and Blender's .blend1 backups. Each row shows its size and lists its Shot as the user.
  • Purge.
    • A Playblast that a Take was sent is blocked, with the reason "1A-3 was sent it, so it is kept as provenance". This includes a version that undo took out of its Shot, which only the Take still keeps.
    • Any other Playblast can be purged. Its row stays, marked purged, and it is never the Shot's current previz again.
    • Purging the current Playblast warns "1A's previz falls back to v1." or "1A will have no playblast.".
    • When two versions share one content-hashed file, the file is deleted only once every version that keeps it is purged.
  • Missing. A Playblast file that is gone shows as missing in Storage, and the Shot falls back to its newest version that still has its file. Purging a missing Playblast marks it purged.
  • Schema. Migration V49 adds previz_version.purged_at. A purged version is kept through undo of its import, so redo brings it back purged.
  • UI.
    • The Storage view has a new Previz filter group. Playblast rows have a "sent" badge and a "used by N" badge, and both new kinds open their Shot.
    • The purge dialog and the detail panel have wording for Playblasts.
    • The Shot's previz version list shows a Purged badge.
  • CONTEXT.md: the Storage and Purge entries now cover Playblasts.

Decisions to check

  • Storage never deletes Blender files. They are Blender's workspace, so Storage lists them without an action. Only .blend* files are listed. The other files in a previz folder (playblast.mp4, scene.json, bootstrap.py, reference images) are not listed.
  • The current Playblast can be purged if no Take was sent it. The purge dialog shows the fallback first.
  • A missing file falls back only after a Storage scan. The Shot falls back once Storage has marked the file missing, the same as for Renditions. The Shot's previz panel sees a gone file at once, as it did before this change.

Tests

  • Added crates/studio-core/tests/previz.rs (section "Storage"). It covers:
    • Playblast and Blender rows with their sizes and users
    • a version a Take was sent is protected, including after its import is undone
    • an old version can be purged
    • purging the current version falls back to the one before
    • a file two versions share
    • missing, then purged
    • a purged version stays purged through undo and redo
  • Added cases to src/lib/storage/storage.test.ts for the badges and for where the new rows open.
  • All tests pass: cargo test --workspace --all-features and bun test. svelte-check is clean.
Closes #167. Part of #139. ## What changed Storage now lists previz, so the filmmaker can reclaim space from old playblasts. - **Playblast rows.** There is one row per previz version (`1A playblast v2`), with its size and the space a purge would free. It lists what uses it: the Shot while this version is its current previz, and every Take that was sent it. - **Blender file rows.** There is one row per `.blend` file in each Shot's previz folder. This covers `scene.blend`, the `scene-set-aside-N.blend` files that "Rebuild Blender scene" leaves, and Blender's `.blend1` backups. Each row shows its size and lists its Shot as the user. - **Purge.** - A Playblast that a Take was sent is blocked, with the reason "1A-3 was sent it, so it is kept as provenance". This includes a version that undo took out of its Shot, which only the Take still keeps. - Any other Playblast can be purged. Its row stays, marked purged, and it is never the Shot's current previz again. - Purging the current Playblast warns "1A's previz falls back to v1." or "1A will have no playblast.". - When two versions share one content-hashed file, the file is deleted only once every version that keeps it is purged. - **Missing.** A Playblast file that is gone shows as missing in Storage, and the Shot falls back to its newest version that still has its file. Purging a missing Playblast marks it purged. - **Schema.** Migration V49 adds `previz_version.purged_at`. A purged version is kept through undo of its import, so redo brings it back purged. - **UI.** - The Storage view has a new **Previz** filter group. Playblast rows have a "sent" badge and a "used by N" badge, and both new kinds open their Shot. - The purge dialog and the detail panel have wording for Playblasts. - The Shot's previz version list shows a **Purged** badge. - `CONTEXT.md`: the Storage and Purge entries now cover Playblasts. ## Decisions to check - **Storage never deletes Blender files.** They are Blender's workspace, so Storage lists them without an action. Only `.blend*` files are listed. The other files in a previz folder (`playblast.mp4`, `scene.json`, `bootstrap.py`, reference images) are not listed. - **The current Playblast can be purged** if no Take was sent it. The purge dialog shows the fallback first. - **A missing file falls back only after a Storage scan.** The Shot falls back once Storage has marked the file missing, the same as for Renditions. The Shot's previz panel sees a gone file at once, as it did before this change. ## Tests - Added `crates/studio-core/tests/previz.rs` (section "Storage"). It covers: - Playblast and Blender rows with their sizes and users - a version a Take was sent is protected, including after its import is undone - an old version can be purged - purging the current version falls back to the one before - a file two versions share - missing, then purged - a purged version stays purged through undo and redo - Added cases to `src/lib/storage/storage.test.ts` for the badges and for where the new rows open. - All tests pass: `cargo test --workspace --all-features` and `bun test`. `svelte-check` is clean.
Storage lists each previz version's Playblast and the Blender files in
the Shots' previz folders with their sizes and users. An unsent
Playblast can be purged: its row stays, marked purged, and the Shot's
current previz falls back to its newest other version with a file. A
Playblast a Take was sent is kept as that Take's provenance, and a file
two versions share goes only when both are purged. Blender files are
listed but never deleted.
Keep a purged previz version through undo of its import, so redo brings
it back purged rather than as a live version with no file. Leave purged
versions out of playblast_files itself, rename PlayblastRow::plays to
playable, and re-wrap two doc comments.
crowmaki deleted branch issue-167-previz-storage 2026-10-11 06:38:18 +00:00
Sign in to join this conversation.
No description provided.