Skip to content

Write HTML. Render video. Built for agents.

fix(studio): with keyframes hidden, a keyframed clip no longer opens the track-name column (#4725)

Miguel Ángelca714f10b55c
diff --git a/packages/studio/src/player/components/Timeline.rulerSeek.test.tsx b/packages/studio/src/player/components/Timeline.rulerSeek.test.tsx
index 25d2902b09..217839d489 100644
--- a/packages/studio/src/player/components/Timeline.rulerSeek.test.tsx
+++ b/packages/studio/src/player/components/Timeline.rulerSeek.test.tsx
@@ -89,16 +89,16 @@ async function seekOnFirstTick(
describe("Timeline ruler origin", () => {
it.each([
- ["keyframes shown", { showKeyframes: true }, false],
- ["keyframes hidden", { showKeyframes: false }, false],
- ["keyframes shown, arriving after mount", { showKeyframes: true }, true],
- ["keyframes hidden, arriving after mount", { showKeyframes: false }, true],
+ ["keyframes shown", { showKeyframes: true }, false, 264],
+ ["keyframes hidden", { showKeyframes: false }, false, 80],
+ ["keyframes shown, arriving after mount", { showKeyframes: true }, true, 264],
+ ["keyframes hidden, arriving after mount", { showKeyframes: false }, true, 80],
])(
"publishes where the ruler draws 0 s, and a press seeks by it (%s)",
- async (_case, props, late) => {
+ async (_case, props, late, expected) => {
const { time, tickTime, origin, published } = await seekOnFirstTick(props, late);
- expect(origin).toBe("264px");
- expect(published).toBe("264");
+ expect(origin).toBe(`${expected}px`);
+ expect(published).toBe(String(expected));
expect(time).toBeCloseTo(tickTime, 1);
},
);
diff --git a/packages/studio/src/player/components/Timeline.showKeyframes.test.tsx b/packages/studio/src/player/components/Timeline.showKeyframes.test.tsx
index 5cea10d514..cc501a60fb 100644
--- a/packages/studio/src/player/components/Timeline.showKeyframes.test.tsx
+++ b/packages/studio/src/player/components/Timeline.showKeyframes.test.tsx
@@ -84,8 +84,34 @@ describe("Timeline showKeyframes", () => {
expect((await mountKeyframed(false)).lanes).toBe(false);
});
- it("keeps each track's name in the header when keyframes are off", async () => {
+ it("opens the track-name column for a keyframed clip only while keyframes are shown", async () => {
expect((await mountKeyframed()).named).toBe(true);
- expect((await mountKeyframed(false)).named).toBe(true);
+ expect((await mountKeyframed(false)).named).toBe(false);
+ });
+
+ it("still opens the column for an audio group when keyframes are off", async () => {
+ usePlayerStore.setState({
+ duration: 10,
+ timelineReady: true,
+ gsapAnimations: new Map(),
+ elements: [
+ {
+ id: "vo",
+ label: "Voice",
+ tag: "audio",
+ start: 0,
+ duration: 4,
+ track: 0,
+ audioGroup: "g",
+ },
+ ],
+ });
+ const host = document.createElement("div");
+ document.body.append(host);
+ const root = createRoot(host);
+ await act(async () => root.render(<Timeline showKeyframes={false} />));
+ const corner = host.querySelector<HTMLElement>(".sticky.top-0.flex > div");
+ expect(corner?.style.width).toBe("264px");
+ act(() => root.unmount());
});
});
diff --git a/packages/studio/src/player/components/useTimelineProviderState.tsx b/packages/studio/src/player/components/useTimelineProviderState.tsx
index 652d0f3fcf..e02696b3c7 100644
--- a/packages/studio/src/player/components/useTimelineProviderState.tsx
+++ b/packages/studio/src/player/components/useTimelineProviderState.tsx
@@ -107,8 +107,7 @@ export function useTimelineProviderState({
const selectedElementIds = usePlayerStore((s) => s.selectedElementIds);
const focusedEaseSegment = usePlayerStore((s) => s.focusedEaseSegment);
const { gsapAnimations, keyframeCache } = useTimelineKeyframeData(showKeyframes);
- const namedAnimations = usePlayerStore((s) => s.gsapAnimations);
- const { labelMode, contentOrigin } = useTimelineLabelColumn(namedAnimations, timelineElements);
+ const { labelMode, contentOrigin } = useTimelineLabelColumn(gsapAnimations, timelineElements);
const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);
const currentTime = usePlayerStore((s) => s.currentTime);
const beatDragging = usePlayerStore((s) => s.beatDragging);