Skip to content

feat(studio): before/after diff mode for agent iterations#41

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-diff-mode
Jul 18, 2026
Merged

feat(studio): before/after diff mode for agent iterations#41
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-diff-mode

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #21.

Goal: when an agent reworks a scenario after feedback, the reviewer sees exactly what changed — and that nothing else did.

  • Pure diff_scenarios (12 TDD tests): added/removed/modified by JSON pointer with exact before→after per field (style recursed, dot-flattened), grouped by Video/Scene/Document, composition-aware. Positional matching documented: reorders surface as remove+add (different types) or same-type modifies.
  • Baseline: app-global path-keyed snapshot, captured insert-if-absent at open so watcher reloads never move it; a Camera button re-snapshots on demand (typically right before sending feedback to the agent).
  • Flip A/B at the same frame/zoom: side A renders from the baseline string (HTML retranspiled, never the edited disk state) through a content-hash-keyed scenario cache, panic-fenced like the main handler.
  • Highlights on side B only (accepted v1): modified = accent outline, added = green, via the existing hit-map; side A shows no overlay at all — current-layout hit-boxes would lie about the baseline render. Removed elements are visible via the panel and the flip.
  • Panel entries select the element and scrub to its scene (+start_at offset).

Tests: 15 new (12 diff + 3 baseline), red-first. 213 total, all green.

Verify: cargo check -p rustmotion-studio ✓ · cargo test --workspace → 213 passed ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓

- pure diff_scenarios over baseline/current raw JSON: added/removed/
  modified elements by pointer, dot-flattened field changes with exact
  before/after, scene/video/document grouping, composition-aware;
  positional matching documented (reorders read as remove+add or
  same-type modifies); annotations excluded
- baseline: app-global path-keyed snapshot captured insert-if-absent
  at open (watcher reloads are no-ops), Set-baseline button overwrites
- flip A/B in the playback bar at the same frame; side A renders from
  the baseline source string (HTML retranspiled) through a hash-keyed
  scenario cache, panic-fenced; no overlay on side A so current-layout
  hit-boxes never lie about the baseline render
- side B highlights modified (accent) and added (green) elements via
  the hit-map overlay; panel entries select and scrub to the element
@LeadcodeDev
LeadcodeDev merged commit 32914fa into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/studio-diff-mode branch July 18, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(studio): before/after diff mode for agent iterations

1 participant