From a8533fbf8f19dca3e52c64f22199136347027bef Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Mon, 20 Jul 2026 23:33:16 +0200 Subject: [PATCH] fix(studio): scope timeline ease focus lifecycle --- .../src/components/StudioRightPanel.tsx | 2 +- .../editor/GsapAnimationSection.test.tsx | 92 ++++++++++++-- .../editor/GsapAnimationSection.tsx | 34 ++++-- .../src/components/editor/PropertyPanel.tsx | 2 +- .../components/editor/PropertyPanelFlat.tsx | 63 +++++----- .../editor/gsapAnimationCallbacks.test.ts | 2 +- .../editor/propertyPanelFlatDescriptors.ts | 23 ++++ .../propertyPanelFlatMotionSection.test.tsx | 113 +++++++++--------- .../editor/propertyPanelFlatMotionSection.tsx | 21 +++- .../components/editor/propertyPanelTypes.ts | 2 +- .../studio/src/contexts/DomEditContext.tsx | 2 +- .../src/hooks/useDomEditSession.test.tsx | 2 +- .../studio/src/hooks/useDomEditSession.ts | 2 +- .../src/player/components/Timeline.test.ts | 5 +- .../useTimelineKeyframeHandlers.test.tsx | 4 +- .../studio/src/player/store/keyframeSlice.ts | 74 +++++++++--- .../src/player/store/playerStore.test.ts | 76 ++++++++++++ .../studio/src/player/store/playerStore.ts | 20 ++-- 18 files changed, 390 insertions(+), 149 deletions(-) create mode 100644 packages/studio/src/components/editor/propertyPanelFlatDescriptors.ts diff --git a/packages/studio/src/components/StudioRightPanel.tsx b/packages/studio/src/components/StudioRightPanel.tsx index baf7d1fb3b..66c391be7b 100644 --- a/packages/studio/src/components/StudioRightPanel.tsx +++ b/packages/studio/src/components/StudioRightPanel.tsx @@ -399,8 +399,8 @@ export function StudioRightPanel({ onUpdateArcSegment={handleUpdateArcSegment} onUnroll={handleUnroll} onUpdateKeyframeEase={handleUpdateKeyframeEase} - onSetAllKeyframeEases={handleSetAllKeyframeEases} onUpdateSegmentEase={handleUpdateSegmentEase} + onSetAllKeyframeEases={handleSetAllKeyframeEases} recordingState={recordingState} recordingDuration={recordingDuration} onToggleRecording={onToggleRecording} diff --git a/packages/studio/src/components/editor/GsapAnimationSection.test.tsx b/packages/studio/src/components/editor/GsapAnimationSection.test.tsx index 8517860d1f..240ae98625 100644 --- a/packages/studio/src/components/editor/GsapAnimationSection.test.tsx +++ b/packages/studio/src/components/editor/GsapAnimationSection.test.tsx @@ -5,11 +5,15 @@ import { createRoot } from "react-dom/client"; import { afterEach, describe, expect, it, vi } from "vitest"; import type { GsapAnimation } from "@hyperframes/core/gsap-parser"; import { DesignPanelInputProvider } from "../../contexts/DesignPanelInputContext"; -import { usePlayerStore } from "../../player"; +import { usePlayerStore } from "../../player/store/playerStore"; import { GsapAnimationSection } from "./GsapAnimationSection"; (globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true; +const animationCardMock = vi.hoisted(() => ({ + consumers: [] as Array<{ tweenPercentage: number | null; consume: () => void }>, +})); + vi.mock("./AnimationCard", () => ({ AnimationCard: ({ animation, @@ -19,20 +23,27 @@ vi.mock("./AnimationCard", () => ({ animation: GsapAnimation; focusedSegment: { tweenPercentage: number } | null; onFocusSegmentConsumed: () => void; - }) => ( -