Repository navigation
fix(timeline): MATCH-snap on cam-track drag - #35
Merged
Merged
Conversation
Introduced in PR #29 alongside `cam-track-move` (the MATCH snap-mode body-drag), but the candidate-snap step never landed: the handler just applied the raw arr-delta to all of the cam's pills, which is free movement in any snap mode. Pre-refactor (b382cbc) `clip-move` had the proper snap-to-nearest-candidate path; PR #29 dropped it when it swapped clip-move out for cam-track-move. Plus a second, deeper bug: pills are authoritative for source-time post pill-refactor, so changing `clip.syncOffsetMs` (what the candidate switch does) had no visible effect — pills kept playing the old candidate's frames at the same arr-positions. Fix: - store.setSelectedCandidateIdx mirrors the offsetMs delta into every pill of the cam (live + originals), the same way setClipSyncOverride mirrors syncOverrideMs nudges. Now a candidate switch actually slides the cam-content visually. - Timeline cam-track-move handler in MATCH mode (non-shift): compute the drag-target master-startS from the cam's frozen origMasterStartS + arr-delta, find the nearest candidate-implied startS via buildClipMatchPositions / candidateIdxNearestStart, fire setSelectedCandidateIdx if it changed. No threshold — every candidate is a valid lock-target. Free-drag pills only when MATCH is off or shift is held. - New `origMasterStartS` field on the cam-track-move drag state freezes the cam-anchor at drag-start so candidate positions stay stable across mid-drag switches (otherwise middle candidates become unreachable as the math cascades). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In MATCH snap-mode, dragging a pill body promotes to a "cam-track-move" — the whole cam shifts in lockstep against a candidate-implied anchor. Two bugs combined to make this snap silently do nothing:
User-reported: "snappt nicht zu den alternativen Soundmatches".
Fix
Test plan
🤖 Generated with Claude Code