fix(studio): pass the whole keyframe identity out of the diamond menu

The context menu handed its actions loose positional arguments, so the
overlay adapters forwarded the percentage alone and dropped the property
group, tween percentage, and animation id the menu had resolved. The target
then fell back to first-match-by-percentage and deleted or retimed the wrong
animation whenever two collide at one percentage. Every action now carries a
TimelineKeyframeTarget, which leaves no adapter shape that can drop it.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-28 00:25:41 +02:00
parent f5d3c7a3d1
commit eddc5e9224
4 changed files with 92 additions and 32 deletions
@@ -520,9 +520,13 @@ export const MotionPathOverlay = memo(function MotionPathOverlay({
<KeyframeDiamondContextMenu
state={kfMenu}
onClose={() => setKfMenu(null)}
onDelete={(_elId, pct) => animId && handleGsapRemoveKeyframe(animId, pct)}
onDelete={(_elId, target) =>
animId && handleGsapRemoveKeyframe(animId, target.percentage)
}
onDeleteAll={() => animId && handleGsapRemoveAllKeyframes(animId)}
onMoveToPlayhead={(_elId, pct) => animId && handleGsapMoveKeyframeToPlayhead(animId, pct)}
onMoveToPlayhead={(_element, target) =>
animId && handleGsapMoveKeyframeToPlayhead(animId, target.percentage)
}
/>
)}
</>