Skip to content

feat(videos): swap-clip drawer — pick a different clip in a beat slot#458

Merged
jjackson merged 1 commit into
mainfrom
feat/swap-clip-picker
May 19, 2026
Merged

feat(videos): swap-clip drawer — pick a different clip in a beat slot#458
jjackson merged 1 commit into
mainfrom
feat/swap-clip-picker

Conversation

@jjackson
Copy link
Copy Markdown
Owner

Summary

@jjackson: "I want to be able to switch a video to a different one in the template library."

The backend op (set-clip-asset) and the frontend op type already shipped — this wires up the UI to dispatch it.

What changed

  • New ClipPickerPanel renders every alias in spec.manifest as a thumbnail-tile grid. Current alias is sorted first with a "Current" badge. Click a different one → dispatch set-clip-asset → drawer closes. Existing trim values on the slot are preserved.
  • ClipSlotWidget header gets a ↔ Swap button next to ✏ Edit trim. Both stop propagation so the card's catch-all onClick (which still opens trim) doesn't double-fire.
  • WidgetRef union extended with a clip-picker variant; EditDrawer routes to the new panel.

Tested

On chc/run-001 Field-footage clip 1:

  • 6 Swap buttons on the page (3 scene-clip + 3 product-beat slots)
  • Picker opens with the 8 manifest aliases as a 2-column grid + video thumbnails
  • Current alias has the "Current" badge
  • Clicking @mobile-learn → first slot's header updates from @field-group-around-woman to @mobile-learn (dispatched as a set-clip-asset op into the dirty buffer; saves with the next batch like any other edit)

Future

  • Browse the wider video library (more than the 8 manifest entries) and auto-add to the manifest on pick — the workspace has dozens of clips across mobile-screencast / web-screencast / field-broll; today's picker is limited to whatever a particular spec already references.
  • Hover-preview that plays the muted clip (Chrome's autoplay-on-hover heuristics are spicy; deferred).

🤖 Generated with Claude Code

The backend op (set-clip-asset) and the frontend op type already
shipped. This wires up the UI:

- New ClipPickerPanel renders every alias in spec.manifest as a
  thumbnail-tile grid. Current alias is sorted first with a "Current"
  badge. Click a different one → dispatch set-clip-asset → drawer
  closes. Existing trim values on the slot are preserved.
- ClipSlotWidget header gets a "↔ Swap" button next to "✏ Edit trim".
  Both stop propagation so the card's catch-all onClick (which still
  opens trim) doesn't double-fire.
- WidgetRef union extended with a clip-picker variant; EditDrawer
  routes to the new panel.

Tested on chc/run-001 Field-footage clip 1:

  - Swap button opens picker (6 swap buttons total — 3 scene-clip +
    3 product-beat slots)
  - 8 manifest aliases listed as 2-column grid with video thumbnails
  - Current alias has the "Current" badge
  - Clicking @mobile-learn swaps the slot's asset; card header
    updates from @field-group-around-woman to @mobile-learn

Future work (not in this PR):
- Browse the wider video library (more than the 8 manifest entries)
  and auto-add to manifest on pick.
- Hover-preview that plays the muted clip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jjackson jjackson merged commit 58d859f into main May 19, 2026
3 checks passed
@jjackson jjackson deleted the feat/swap-clip-picker branch May 19, 2026 22:12
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.

1 participant