Setups and Shots (#40) #90

Merged
crowmaki merged 2 commits from issue-40-setups-and-shots into main 2026-10-08 06:29:21 +00:00
Owner

Closes #40

What

A filmmaker can plan coverage: Setups per Scene, and Shots that cover runs of Lines (User Stories 67–72).

  • Schema v12:
    • scene.setup_letters_used counts the letters a Scene has handed out.
    • New tables: setup(scene, letter, setup_order, location_angle_tile_id, framing_note, blocking_plan), setup_subject(setup, character, position) and shot(setup, first_line_id, last_line_id).
  • Setups (studio-core/src/setups.rs):
    • Setups are lettered A…Z, then AA, AB…. Letters are never reused. Neither deleting a Setup nor undoing its creation gives the letter back. Redo restores the same letter.
    • reorder_setups changes the Scene's Setup order and leaves the letters alone.
    • The location angle must be a live Tile of the Scene's Location set for its Lighting. setup_angle_choices(scene) lists those Tiles.
    • If the Scene's Lighting or Location changes later, the Setup keeps its angle, and the view flags it with fits_scene: false ("Not this scene's set").
    • The framing note is trimmed, and empty text clears it.
    • blocking_plan is a reserved placeholder that is always empty. The UI shows a "later" slot for it.
  • Subjects:
    • Subjects come from the Scene's cast. They are ordered, and can be reordered and removed.
    • Removing a subject from the cast is refused, and so is deleting a Character who is a subject.
    • A Character merge moves subjects to the survivor. If a Setup already frames the survivor, it drops the absorbed Character's row. Undo restores everything.
  • Shots:
    • A Shot covers a contiguous run of whole Lines in its Scene.
    • It cannot start or end on a transition or shot direction, and those Lines are left out of the Lines it counts.
    • It takes a dual-dialogue pair whole, matching the spec's treatment of simultaneous groups as units in the Cut and in length checks.
    • It cannot overlap another Shot of the same Setup. Shots of different Setups may cover the same Lines.
    • Labels: 12A for a Setup's only Shot, otherwise 12B·1, 12B·2 in script order.
  • Guards: a Tile used as an angle cannot be removed.
  • Undo and deletion: every edit is undoable. No Take can consume a Setup or Shot yet, so deletes are hard deletes (ADR-0004), and undo puts the rows back exactly.
  • Adapter and UI:
    • 12 new commands, and SceneDto.setups.
    • The Scenes view gets a Setups block with add, delete and reorder, an angle picker, the framing note, subjects, the blocking placeholder, and Shots with a line-range picker.
    • The Scenes list gets a Setups count.

Decisions to check

  • The Shot number is derived from script order, not stored. Spec #24 lists shot(setup, index, next_take_number). With no Takes yet, a stored index would only add renumbering work. Once Takes exist (#41 split, #51 queuing), an earlier Shot added later would renumber 12B·1 → 12B·2. #41/#51 should store or freeze the number at that point, together with next_take_number.
  • No deleted_at on setup and shot yet. This follows the existing require_deletable stub. The soft-delete path belongs with the first Take that consumes them.

Testing

  • crates/studio-core/tests/setups.rs (28 tests) covers:
    • lettering: order, past Z, never reused after delete or undo, persistence across reopen
    • reordering
    • framing note and angle rules, including the stale-angle flag
    • subjects, cast and delete guards, and the merge
    • coverage: read-only endpoints, direction, scene, dual dialogue, overlap, labels, moving and deleting Shots
  • Adapter smoke test setups_and_shots_go_through_the_adapter. Bun tests for src/lib/scenes/setups.ts.
  • The full workspace suite, bun tests and svelte-check pass. Clippy's only warning is the existing one in api.rs.
  • The UI was type-checked but not clicked through in the running app.
Closes #40 ## What A filmmaker can plan coverage: Setups per Scene, and Shots that cover runs of Lines (User Stories 67–72). - **Schema v12**: - `scene.setup_letters_used` counts the letters a Scene has handed out. - New tables: `setup(scene, letter, setup_order, location_angle_tile_id, framing_note, blocking_plan)`, `setup_subject(setup, character, position)` and `shot(setup, first_line_id, last_line_id)`. - **Setups** (`studio-core/src/setups.rs`): - Setups are lettered A…Z, then AA, AB…. Letters are never reused. Neither deleting a Setup nor undoing its creation gives the letter back. Redo restores the same letter. - `reorder_setups` changes the Scene's Setup order and leaves the letters alone. - The location angle must be a live Tile of the Scene's Location set for its Lighting. `setup_angle_choices(scene)` lists those Tiles. - If the Scene's Lighting or Location changes later, the Setup keeps its angle, and the view flags it with `fits_scene: false` ("Not this scene's set"). - The framing note is trimmed, and empty text clears it. - `blocking_plan` is a reserved placeholder that is always empty. The UI shows a "later" slot for it. - **Subjects**: - Subjects come from the Scene's cast. They are ordered, and can be reordered and removed. - Removing a subject from the cast is refused, and so is deleting a Character who is a subject. - A Character merge moves subjects to the survivor. If a Setup already frames the survivor, it drops the absorbed Character's row. Undo restores everything. - **Shots**: - A Shot covers a contiguous run of whole Lines in its Scene. - It cannot start or end on a transition or shot direction, and those Lines are left out of the Lines it counts. - It takes a dual-dialogue pair whole, matching the spec's treatment of simultaneous groups as units in the Cut and in length checks. - It cannot overlap another Shot of the same Setup. Shots of different Setups may cover the same Lines. - Labels: `12A` for a Setup's only Shot, otherwise `12B·1`, `12B·2` in script order. - **Guards**: a Tile used as an angle cannot be removed. - **Undo and deletion**: every edit is undoable. No Take can consume a Setup or Shot yet, so deletes are hard deletes (ADR-0004), and undo puts the rows back exactly. - **Adapter and UI**: - 12 new commands, and `SceneDto.setups`. - The Scenes view gets a Setups block with add, delete and reorder, an angle picker, the framing note, subjects, the blocking placeholder, and Shots with a line-range picker. - The Scenes list gets a Setups count. ## Decisions to check - **The Shot number is derived from script order, not stored.** Spec #24 lists `shot(setup, index, next_take_number)`. With no Takes yet, a stored index would only add renumbering work. Once Takes exist (#41 split, #51 queuing), an earlier Shot added later would renumber `12B·1` → `12B·2`. #41/#51 should store or freeze the number at that point, together with `next_take_number`. - **No `deleted_at` on `setup` and `shot` yet.** This follows the existing `require_deletable` stub. The soft-delete path belongs with the first Take that consumes them. ## Testing - `crates/studio-core/tests/setups.rs` (28 tests) covers: - lettering: order, past Z, never reused after delete or undo, persistence across reopen - reordering - framing note and angle rules, including the stale-angle flag - subjects, cast and delete guards, and the merge - coverage: read-only endpoints, direction, scene, dual dialogue, overlap, labels, moving and deleting Shots - Adapter smoke test `setups_and_shots_go_through_the_adapter`. Bun tests for `src/lib/scenes/setups.ts`. - The full workspace suite, bun tests and `svelte-check` pass. Clippy's only warning is the existing one in `api.rs`. - The UI was type-checked but not clicked through in the running app.
Setups per Scene, lettered A, B, C and never reused, with an order separate
from the letters, a hand-picked location angle, a framing note, ordered
subjects from the Scene cast and a blocking-plan placeholder. Shots cover a
contiguous run of whole Lines, skip read-only Lines, take dual dialogue whole
and do not overlap within a Setup. All edits are undoable; character merges
move Setup subjects.
Flag a location angle that no longer fits the Scene after its Location or
Lighting changes, and move the angle choices into the core so the frontend
no longer works them out. Share the Setup label and Shot row helpers, make
the Setup lifecycle's add/delete explicit, and lowercase error messages.
crowmaki deleted branch issue-40-setups-and-shots 2026-10-08 06:29:21 +00:00
Sign in to join this conversation.
No description provided.