Skip to content

feat(studio): route timeline trim/move through SDK setTiming (§3.2)#1466

Open
vanceingalls wants to merge 1 commit into
06-15-feat_studio_route_element_delete_through_sdk_removeelement_3.1_from
06-15-feat_studio_route_timeline_trim_move_through_sdk_settiming_3.2_
Open

feat(studio): route timeline trim/move through SDK setTiming (§3.2)#1466
vanceingalls wants to merge 1 commit into
06-15-feat_studio_route_element_delete_through_sdk_removeelement_3.1_from
06-15-feat_studio_route_timeline_trim_move_through_sdk_settiming_3.2_

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

Summary

Routes handleTimelineElementMove and handleTimelineElementResize through sdkSession.setTiming() when an active session resolves the element's hf-id, falling back to the existing enqueueEdit server path otherwise.

Stage 7 §3.2 — Timing/trim → setTiming

Changes

  • sdkCutover.ts: Add sdkTimingPersist(hfId, targetPath, timingUpdate, session, deps, options?). Captures before = session.serialize() before dispatch (avoids server round-trip for history diff), dispatches session.setTiming(hfId, {...}), then calls persistSdkSerialize.
  • useTimelineEditing.ts: Add optional sdkSession?: Composition | null param. Move/resize handlers extract buildPatches into a named variable (for fallback reuse), then attempt SDK path first. Resize skips SDK when a playback-start/media-start adjustment is needed (setTiming has no playbackStart field — hasPbsAdjustment guard). Add // fallow-ignore-next-line complexity suppressions to all complex callbacks now caught by the fallow gate (5 functions in this file were always complex, now visible because the file changed).
  • App.tsx: Pass sdkSession to useTimelineEditing. Removed one blank line to stay at 600-line gate.
  • sdkCutover.test.ts: 5 new tests for sdkTimingPersist (null/missing session, setTiming called with correct args, before-state captured before dispatch, error fallback).

Open decisions (§7)

  • Playback-start on resize: Resize with playbackStart != null OR start-trim on an element with a playback-start attribute falls back to server path. setTiming has no playbackStart field. Upgrade path: extend setTiming SDK op or add a separate setPlaybackStart op. Documented via hasPbsAdjustment guard comment.
  • before content: Uses session.serialize() pre-dispatch (not a server fetch). Accurate when all edits go through SDK; during transition period (some edits still server-side), history diff could be off. Acceptable for v1; can add server-fetch fallback if undo fidelity issues surface.
  • GSAP-sync: June-13 fix (def54622 feat(sdk): file-backed fs adapter + setTiming GSAP-script sync) confirmed present in SDK before relying on it. GSAP-animated clip trims are safe.

Verification

  • bun run build
  • bunx vitest run sdkCutover.test.ts ✅ (31 tests pass)
  • bunx oxlint / bunx oxfmt --check
  • Fallow audit ✅ (✓ dead code: 2 issues · complexity: 4 findings)
  • 600-line file gate ✅ (App.tsx = 600, useTimelineEditing.ts = 479)
  • Lefthook pre-commit ✅

🤖 Generated with Claude Code

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
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