Skip to content

Add timeline track and clip authoring - #145

Open
shaiananvari8 wants to merge 2 commits into
jbilcke-hf:mainfrom
shaiananvari8:clapper-timeline-authoring-10
Open

Add timeline track and clip authoring#145
shaiananvari8 wants to merge 2 commits into
jbilcke-hf:mainfrom
shaiananvari8:clapper-timeline-authoring-10

Conversation

@shaiananvari8

@shaiananvari8 shaiananvari8 commented May 31, 2026

Copy link
Copy Markdown

Closes #10.

Summary

  • Adds a compact timeline authoring toolbar for choosing a track, choosing a clip type, creating typed tracks, and creating clips on the selected track.
  • Adds store actions for track selection, track category assignment, typed clip creation, segment moving, and drag lifecycle state.
  • Keeps clips type-compatible with their destination track, avoids clip overlap on creation and moves, snaps movement to timeline steps, clamps negative starts to zero, and preserves legacy mixed-track horizontal movement.
  • Adds focused coverage for the authoring helper logic that powers overlap checks, placement, category mapping, and track hit testing.

Validation

  • npx --yes bun run --cwd packages/clap build
  • npx --yes bun test packages/timeline/src/utils/timelineAuthoring.test.ts
  • npx --yes bun run --cwd packages/timeline build:declaration
  • npx --yes bun run --cwd packages/timeline build
  • git diff --check
  • Browser smoke test against the timeline Vite demo: toolbar rendered, + Track and + Clip controls were unique/clickable, a new track appeared, and no console warnings/errors were reported.

@MyTH-zyxeon

Copy link
Copy Markdown

Review-assist pass for #10 / PR #145.

I am not claiming this bounty here and I am not asking maintainers to prefer a specific submitter. Since this is a newer #10 attempt with no visible PR comments yet, I did a static acceptance pass against the issue requirements and the existing open PR queue.

What looks strong:

  • The PR keeps the scope focused on timeline-native authoring: track creation, explicit track type selection, clip creation, horizontal drag, and same-type cross-track movement.
  • It adds a dedicated authoring helper module plus helper tests for overlap detection, next available clip start, category-to-output mapping, and vertical track picking.
  • It avoids content/entity editor work, which matches the issue's stated boundary.

Acceptance risks I would check before marking #10 complete:

  1. The new test file uses bun:test, but packages/timeline/package.json currently exposes build/dev/serve scripts and no package-level test script. If the branch is claiming regression coverage, please wire the helper tests into the package/root validation path or document the exact command maintainers should run.
  2. TimelineAuthoringToolbar is absolutely positioned at the top-left of ClapTimeline. It should be checked against the existing timeline camera/scale controls and the first track row so the toolbar does not hide the controls or make the first row hard to interact with.
  3. Cross-track drag uses event.point.y plus getTrackAtPointY() with a top-origin negative-Y track model. Please verify this under timeline scroll/zoom/camera offset, not only at the default viewport, because a coordinate-space mismatch would make drops land on the wrong track.
  4. TIMELINE_AUTHORING_CATEGORIES exposes only VIDEO, IMAGE, DIALOGUE, SOUND, MUSIC, ACTION, CAMERA, and GENERIC even though outputTypeForCategory() handles more categories. If this is intentional for MVP, it is worth documenting; otherwise the dropdown may not truly cover all supported track/clip types.
  5. Rejected drag moves return false without surfacing user feedback. That may be fine, but acceptance should include a manual check that incompatible-track or overlap rejection feels deliberate rather than broken.

Suggested merge bar:

This should help keep the new PR reviewable without encouraging another duplicate implementation.

@catcherintheroad-hub

catcherintheroad-hub commented Jun 5, 2026

Copy link
Copy Markdown

Fresh local validation pass for #10 / PR #145.

Environment:

  • macOS/aarch64 local checkout
  • bun 1.3.11
  • node v22.22.2 via PATH=/opt/homebrew/opt/node@22/bin:$PATH
  • PR head: ff19518

Result:

PATH=/opt/homebrew/opt/node@22/bin:$PATH bun test packages/timeline/src/utils/timelineAuthoring.test.ts

Passed: 6 tests / 18 assertions.

PATH=/opt/homebrew/opt/node@22/bin:$PATH bun run --cwd packages/timeline build:declaration
PATH=/opt/homebrew/opt/node@22/bin:$PATH bun run --cwd packages/timeline build

Both currently stop at the same TypeScript resolution error:

src/components/controls/types.ts(1,48): error TS2307: Cannot find module 'three-stdlib' or its corresponding type declarations.

That file is unchanged between main and this PR, so this looks like a pre-existing timeline package dependency/build-environment issue rather than a #145 authoring regression.

Acceptance read after the focused test pass:

  • Track creation: covered by toolbar + store helper.
  • Track type dropdown: covered by TimelineAuthoringToolbar.
  • Clip creation based on track type: covered by createClipOnTrack and category/output mapping helper tests.
  • Horizontal drag/cross-track move path: store surface is present; the helper tests cover placement/category/track hit helpers, while a browser/manual pass would still be useful before closing.
  • Scope boundary: entity/content editing remains out of scope, matching Timeline - Create new Tracks and Clips #10.

Suggested next step before close: resolve or document the three-stdlib package resolution issue so packages/timeline declaration/build checks can run cleanly, then do one browser smoke pass for toolbar track creation, typed clip creation, horizontal drag persistence, and same-type-only cross-track movement.

@catcherintheroad-hub

Copy link
Copy Markdown

Small follow-up: I opened #146 as a separate build unblocker for the three-stdlib resolution issue noted above.

#146

It only declares three-stdlib as a direct @aitube/timeline dependency and does not claim this bounty. With that dependency present, the same local packages/timeline build command passed for me.

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

3 participants