Lock snapshots (#37) #87
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!87
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-37-lock-snapshots"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #37. Part of #24.
What
lock_snapshot,lock_snapshot_pick,tile.retired_at,lighting.phraseandlocation_lighting.tile_labelindex now ignores retired Tiles, so a retired Tile frees its label.studio-core(snapshots.rs,references.rs,location_sets.rs):lock_reference_setpicks each live Tile's newest version. The current snapshot is the highest number. A pick identical to the current one does nothing (created: false, no change event). A Tile with no version is left out, which is what changes the Parity. A set with nothing to pick is refused.roll_back_reference_set(set, number)locks a new snapshot that copies an older pick, or does nothing if that is the current one.Edit, reported asChangeKind::Reference, and the undo history is left alone.remove_tile(undoable): a Tile that a snapshot picks from is retired, so it drops out of the set but stays readable in the snapshot. Any other Tile is deleted with its versions. Undoing a labelled Tile's creation follows the same rule, and undo or redo restores either state.LockSnapshotView.parity). Versions list the snapshots that pick them (locked_in).import_voice_clipstores an audio clip (WAV, FLAC, Ogg or MP3, checked by its leading bytes) as a version of a labelled Tile. The same label adds a version, and the same bytes again add nothing. Clips lock, roll back and retire like Tiles.ReferenceVersionViewgainsmedia_type, andwidth/heightare optional.location_reference_setsreturns one set per Lighting in Project order and makes missing ones (first use, or after a Lighting is added).set_location_set_noteandset_lighting_phraseare undoable. The effective note is the Location's note, else the Lighting's phrase. Deleting a Location takes its sets with it, undoable. Removing a Lighting is refused while one of its Location sets has Tiles or a note, and otherwise drops the empty sets.lock_reference_set,roll_back_reference_set,remove_tile,import_voice_clip,location_reference_sets,set_location_set_note,set_lighting_phrase, plus the new DTO fields.bindings.tsis regenerated.src/lib/references/lock.ts.Tests
crates/studio-core/tests/snapshots.rs(21): numbering, per-set numbers, older pick kept, no-op, empty set refused, rollback and rollback no-op, rollback over a retired Tile, Parity, not undoable, retirement and un-retirement, label reuse, owner delete with undo and redo, persistence and trigger/FK refusals.crates/studio-core/tests/voice_clips.rs(9) andlocation_sets.rs(11).src-tauri/tests/lock_snapshots.rs(2) through the adapter, andsrc/lib/references/lock.test.ts(7).Checks
cargo test --workspace --all-features,bun run testandbun run checkpass.cargo clippy -p studio-core --all-targets --all-features -- -D warningspasses.cargo clippy --workspacefails onsrc-tauri/src/api.rs(type_complexityonHooks::open_window), andcargo fmt --checkflagssrc-tauri/src/lib.rsandtests/smoke.rs. Both are already onmainand left alone.studio:scheme in the webview is untested.Open questions