Import a Source sheet and crop Tiles (#35) #80
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!80
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-35-source-sheet-crop"
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 #35. Part of #24.
What
source_sheet,tileandreference_version.add_tile, undoable until a version exists). Voice sets have none.studio-core(references.rs,sheet_image.rs):import_source_sheet,source_sheets,reference_set_view,add_tile.preview_crop_sessionandcommit_crop_sessionshare one plan, so the UI's "new / changed / unchanged" comes from the same rule that commit uses.imagecrate (same sheet and box always give the same PNG bytes) and makes a version only for crops that differ from the Tile's current version (different sheet or box). Re-cropping to match an older version still makes the next number. A Tile left out of the session is skipped. A bad session (voice set, unknown set or sheet, Tile from another set or cropped twice, empty or out-of-bounds box) writes nothing. Commit never locks.Edit, reported with the newChangeKind::Reference. Committing leaves the undo history alone.studio_core::ATLAS_CELL(4, 9) names the Atlas cell shape; the UI'sCELL_ASPECTpoints to it.studio:custom scheme (blob/<id>) that serves blobs to the webview.src/lib/references/, ported fromprototype/crop-sheet): each Look, Wardrobe item and Prop gets a collapsible references panel.describemoved from+page.sveltetosrc/lib/commandError.tsso the new components share it.cargo fmtalso reformatted two spots left over insrc-tauri/src/lib.rsandsrc-tauri/tests/smoke.rs.Tests
crates/studio-core/tests/source_sheets.rs(26 tests): import as-is and dedupe, non-images refused, fixed roles for turnaround and mannequin sets, labelled Tiles, version creation only on change (same box, moved box, same box on another sheet, left-out Tiles, re-crop to an older box), provenance, crop pixels checked pixel-for-pixel against the sheet, one sheet feeding two sets, preview matching commit, atomic refusal of bad sessions, change events, the undo history surviving a commit, delete-with-versions with undo and redo for a Look, Wardrobe item, Prop and Character, undo of a labelled Tile that has versions, undo of an owner's creation after a commit, a direct DELETE or UPDATE of a version row being rejected, tile ids stable across undo and redo, and persistence across close and reopen.crates/studio-core/tests/migrations.rs: sets from before V8 get their fixed Tiles.src-tauri/tests/source_sheets.rs: import, preview, commit andstudio:blob serving through the adapter.Checks
cargo test --workspace --all-features,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo fmt --checkandbun run checkpass.studio:image URLs in the webview are untested.Open questions
location_lighting), so labelled Tiles are exercised on Prop sets only.add_tilealready accepts location sets.statusandrolestay plain strings, like the existingkindfields.