fix(studio): span the clip on the remaining duration-less tween paths

Two sibling call paths still answered from GSAP's 0.5s default while the
toggle path had moved to the clip-wide fallback.

isPlayheadWithinTween now takes the selection, so the toolbar stops
promising "extends animation" on a duration-less tween whose click actually
toggles an interior keyframe. The arc drag commit resolves its replacement
duration the same way its click-path sibling does, instead of authoring
duration 0.5 and collapsing the arc window.

The flat text section drops its two marker-clearing effects: the autofocus
marker is a ref now, read and cleared by the render that consumes it.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-28 00:13:46 +02:00
parent d57039882f
commit 62e866eda6
6 changed files with 50 additions and 20 deletions
@@ -4,6 +4,7 @@ import { usePlayerStore } from "../player/store/playerStore";
import { resolveTweenStart, resolveTweenDuration } from "../utils/globalTimeCompiler";
import { roundTo3 } from "../utils/rounding";
import { computeDraggedGsapPosition } from "./draggedGsapPosition";
import { resolveEditableTweenDuration } from "./gsapShared";
import {
type GsapDragCommitCallbacks,
computeCurrentPercentage,
@@ -297,7 +298,9 @@ export async function commitGsapPositionFromDrag(
}
const tweenStart = resolveTweenStart(anim);
const tweenDuration = resolveTweenDuration(anim);
// Clip-wide, same as applyArcKeyframeAtPlayhead: authoring GSAP's 0.5s
// default here would collapse a duration-less arc's window on drag.
const tweenDuration = resolveEditableTweenDuration(anim, selection);
if (tweenStart === null || tweenDuration <= 0 || keyframes.length < 2) return;
const temporalKeyframes = buildTemporalArcKeyframes(anim, pct, { x: newX, y: newY });
await callbacks.commitMutation(