Skip to content

Auto-slice the focused clip to the dragged in-clip selection #684

@ChuxiJ

Description

@ChuxiJ

User Story

As a user and AI agent, I want dragging a region inside the focused clip to isolate that region immediately, so that phrase-level edits are one gesture.

Problem

Select windows and clip splits are separate workflows. Users can mark timeline regions and they can split clips, but they cannot drag inside one clip and immediately isolate the selected phrase.

Root Cause

src/components/timeline/Timeline.tsx writes selectWindow only for empty-lane drags, while src/components/timeline/ClipBlock.tsx only supports move, resize, slip, and single-point scissor splitting. src/store/projectStore.ts has no atomic range-slice action for a focused clip.

Solution

Add a store action such as sliceClipToRange(clipId, startTime, endTime) that slices one focused clip into left / selected / right segments. Update clip-body drag handling so mouse-up immediately commits the range slice, selects the middle segment, and keeps agent access available through window.__store.

Verification

  • Add store tests for boundary handling and zero-cross snapping
  • Add component coverage for clip-body drag preview and commit
  • Verify browser workflow with a real audio clip
  • Verify window.__store.getState().sliceClipToRange(...) returns the isolated segment id
  • Run npx tsc --noEmit
  • Run npm run build

Notes

Scope is the focused clip only. Immediate mouse-up commit is the expected default behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions