Skip to content

feat: drag-and-drop timeline trim markers — replace number inputs with an interactive scrubber #666

@magic-peach

Description

@magic-peach

The current trim control uses number inputs for start/end time. While functional, it is slow to use — users must type exact seconds instead of dragging. A visual timeline with draggable handles is the standard UX for video editors.

What to build

Replace (or augment) the trim start/end inputs with an interactive timeline scrubber:

  • A horizontal bar representing the full video duration
  • Two draggable handles: left = trim start, right = trim end
  • A shaded region between handles shows the selected clip
  • Clicking anywhere on the timeline seeks the video preview to that position
  • The existing numeric inputs remain as fine-tuning controls below the scrubber

Technical approach

  • Pure CSS + mouse/touch event handlers — no new dependencies
  • Represent time as a percentage of duration for positioning (trimStart / duration * 100)
  • Clamp values: start ≥ 0, end ≤ duration, start < end

Files to modify

  • src/components/TrimControl.tsx — add timeline scrubber above existing inputs

Acceptance criteria

  • Handles can be dragged to set trim start and end
  • Touch events work on mobile
  • Numeric inputs below stay in sync with the drag handles
  • Scrubber is keyboard-accessible (Tab to focus, arrow keys to adjust by 0.1 s)
  • Works in light and dark mode

Screen Recording Required

Your PR for this issue must include a screen recording showing the feature working on your local machine (bun run devhttp://localhost:3000). PRs without a recording will not be merged.

See CONTRIBUTING.md for how to record.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions