Skip to content

Add timeline track and clip creation#142

Open
jamilahmadzai wants to merge 2 commits into
jbilcke-hf:mainfrom
jamilahmadzai:bounty/clapper-10-track-clips
Open

Add timeline track and clip creation#142
jamilahmadzai wants to merge 2 commits into
jbilcke-hf:mainfrom
jamilahmadzai:bounty/clapper-10-track-clips

Conversation

@jamilahmadzai

Copy link
Copy Markdown

Summary

Closes #10.

This adds a scoped first pass for timeline track and clip authoring:

  • Adds a compact timeline toolbar with a real category dropdown, track selector, track creation, track type assignment, and clip creation.
  • Adds timeline store helpers for creating typed tracks, setting track categories, creating clips from track type, and moving clips between compatible tracks.
  • Keeps placement guarded: clips snap to the timeline grid, new clips avoid same-track overlaps, and cross-track moves reject incompatible track types or collisions.
  • Adds empty-track double-click creation and updates segment change tracking so drag/move changes redraw correctly.
  • Adds focused timeline tests for typed track/clip creation, overlap avoidance, type-safe cross-track moves, and drag snapping.

Boss.dev payout: GitHub user @jamilahmadzai.

Validation

  • bun run --cwd packages/timeline test
  • bun run build:timeline
  • bun run --cwd packages/app lint
  • Local runtime smoke: bunx next dev -p 3010, curl http://localhost:3010 returned 200, and a Chrome/Playwright DOM smoke found the new toolbar with no page errors.

@MyTH-zyxeon

Copy link
Copy Markdown

Maintainer-facing review assist for #142 / #10. I am not claiming this bounty here; I reviewed the visible PR diff and issue context only, without running the app, installing dependencies, using Boss.dev payment flows, or asking maintainers to prefer a specific submitter.

This is one of the more focused #10 attempts, but I would tighten these before using it as the canonical landing PR:

  1. Track ids and array indexes are mixed. Several paths use tracks[track] while other paths update by existing.id === track. If tracks can be deleted, reordered, or restored with non-contiguous ids, create/set/move can read one track and update another. Prefer tracks.find(t => t.id === track) consistently and add a regression with non-contiguous/reordered track ids.
  2. createTrack() uses reusableTrack?.id ?? tracks.length. After deletion/reordering, tracks.length can collide with an existing track id. A monotonic/max-id-plus-one id source would make the new track identity safer.
  3. createClip() mutates an empty track category through setTrackCategory() before placement is guaranteed. If placement fails after the overlap search, the user can be left with a typed track but no clip. Either preflight placement before mutating the track, or roll back the type change on failure.
  4. The new double-click TrackClipZones should be verified under scroll/zoom/camera offsets and should not swallow double-clicks intended for existing segments or timeline controls. The helper tests cover store behavior, but not the R3F event routing.
  5. Toolbar coverage is still mostly implicit. Please add a focused UI/state test for: select category, create track, set existing track type, create clip at cursor, and disabled behavior when no track is selected.
  6. The issue has several open attempts (feat: Add timeline track and clip creation functionality (Issue #10) #134, feat: Add timeline track and clip creation (Issue #10) #136, feat(timeline): create typed tracks and clips directly from editor(Issue #10) #139, feat(timeline): add track/clip management with drag-and-drop #140, Add timeline track and clip creation #142, Add timeline track and clip authoring #145). Before merge/payout, it would help if maintainers pick one canonical PR or ask for a narrow follow-up patch against the selected branch, otherwise the bounty stays hard to adjudicate.

Suggested acceptance bar for #10 remains: typed track creation, explicit track type selection, typed clip creation, horizontal drag persistence/clamping, compatible-only cross-track moves, overlap policy consistency, focused regression evidence, and no entity/content-editor scope creep.

@jamilahmadzai

Copy link
Copy Markdown
Author

Follow-up pushed in 2d0698d to tighten the timeline store helpers before review:

  • Track lookup now consistently uses track ids instead of array positions in setTrackCategory, canPlaceSegment, createClip, and moveSegmentToTrack.
  • New track ids now use max-id-plus-one when there is no reusable empty track, avoiding collisions after deletion or restore scenarios.
  • createClip now checks placement before typing an empty track, so a failed placement does not leave the track retagged without a clip.
  • Added regressions for non-contiguous track ids and failed empty-track placement.

Latest focused validation:

  • bun run --cwd packages/timeline test -> 6 passed
  • git diff --check -> clean

GitHub Actions currently shows the workflow as action_required on this head, so there are no completed CI results to report yet.

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.

Timeline - Create new Tracks and Clips

2 participants