Skip to content

Commit 3ac1da4

Browse files
fix(studio): ignore keyframe re-drag during the optimistic-hold window
After a drop, the diamond is held at its dropped position (via effPct) until the file round-trip lands, but `pct` passed to handlePointerDown still comes from props (the pre-drop position). Re-grabbing the same keyframe in that window would track the drag from a stale origin and commit against the wrong tween (or no-op via the stale-cache guard). Skip starting a drag while a hold is pending; it clears on the cache match (≤2s fallback). Click selection is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
1 parent 2d20e42 commit 3ac1da4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/studio/src/player/components/TimelineClipDiamonds.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ export const TimelineClipDiamonds = memo(function TimelineClipDiamonds({
124124
const handlePointerDown = (e: React.PointerEvent, pct: number) => {
125125
if (e.button !== 0) return;
126126
e.stopPropagation();
127+
// Ignore a new drag while a prior drop is still settling: `pct` comes from
128+
// props (the pre-drop position) but the diamond is held at its dropped spot
129+
// via effPct(), so a re-grab would track from a stale origin and commit
130+
// against the wrong tween. The hold clears on the cache round-trip (≤2s).
131+
if (pendingRef.current) return;
127132
// Select the element up front so its GSAP session loads during the drag and
128133
// the commit (which resolves the animation from the selection) isn't a no-op.
129134
onPickForDrag?.();

0 commit comments

Comments
 (0)