Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
feat(studio): a host can hide the timeline's audio effects controls (#4704)
Miguel Ángeldc61ce105bc5
diff --git a/packages/studio/src/player/components/Timeline.audioEffects.test.tsx b/packages/studio/src/player/components/Timeline.audioEffects.test.tsxnew file mode 100644index 0000000000..cb826232fd--- /dev/null+++ b/packages/studio/src/player/components/Timeline.audioEffects.test.tsx@@ -0,0 +1,80 @@+// @vitest-environment happy-dom++import React, { act } from "react";+import { createRoot } from "react-dom/client";+import { afterEach, describe, expect, it } from "vitest";+import { Timeline } from "./Timeline";+import { installTimelineMountEnv } from "./timelineMountTestEnv";+import { usePlayerStore, type TimelineElement } from "../store/playerStore";++(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;++installTimelineMountEnv();++afterEach(() => {+ document.body.innerHTML = "";+});++const voice: TimelineElement = {+ id: "vo",+ domId: "vo",+ tag: "audio",+ start: 0,+ duration: 4,+ track: 0,+};+const grouped: TimelineElement[] = ["vo-1", "vo-2"].map((id, track) => ({+ id,+ domId: id,+ tag: "audio",+ start: 0,+ duration: 4,+ track,+ audioGroup: "voiceover",+ audioGroupLabel: "Voiceover",+}));++async function mount(elements: TimelineElement[], showAudioEffects?: boolean) {+ usePlayerStore.setState({ duration: 10, currentTime: 0, timelineReady: true, elements });+ const host = document.createElement("div");+ document.body.append(host);+ const root = createRoot(host);+ await act(async () => root.render(<Timeline showAudioEffects={showAudioEffects} />));+ const labels = Array.from(host.querySelectorAll("button")).map(+ (b) => b.getAttribute("aria-label") ?? "",+ );+ act(() => root.unmount());+ return labels;+}++const effects = (labels: string[]) => labels.filter((l) => l.startsWith("Effects"));++describe("Timeline showAudioEffects", () => {+ it("shows the effects button on an audio track by default", async () => {+ expect(effects(await mount([voice]))).toHaveLength(1);+ });++ it("hides the effects button on an audio track when the host turns effects off", async () => {+ expect(effects(await mount([voice], false))).toEqual([]);+ });++ it("hides the group-these-clips effects button on a track of several clips", async () => {+ const clips: TimelineElement[] = [+ { ...voice, id: "sfx-1", domId: "sfx-1" },+ { ...voice, id: "sfx-2", domId: "sfx-2", start: 5 },+ ];+ expect(effects(await mount(clips))).toHaveLength(1);+ expect(effects(await mount(clips, false))).toEqual([]);+ });++ it("hides a group's effects button and its open-effects name when effects are off", async () => {+ const on = await mount(grouped);+ expect(effects(on).length).toBeGreaterThan(0);+ expect(on).toContain("Open Voiceover effects");++ const off = await mount(grouped, false);+ expect(effects(off)).toEqual([]);+ expect(off).not.toContain("Open Voiceover effects");+ expect(off).toContain("Select Voiceover");+ });+});diff --git a/packages/studio/src/player/components/Timeline.playheadRemount.test.tsx b/packages/studio/src/player/components/Timeline.playheadRemount.test.tsxindex a30d873a4c..2a92866e0a 100644--- a/packages/studio/src/player/components/Timeline.playheadRemount.test.tsx+++ b/packages/studio/src/player/components/Timeline.playheadRemount.test.tsx@@ -2,38 +2,14 @@import React, { act } from "react";import { createRoot } from "react-dom/client";-import { afterAll, beforeAll, describe, expect, it } from "vitest";+import { describe, expect, it } from "vitest";import { Timeline } from "./Timeline";+import { installTimelineMountEnv } from "./timelineMountTestEnv";import { liveTime, usePlayerStore } from "../store/playerStore";(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;-class MockResizeObserver {- constructor(private readonly callback: ResizeObserverCallback) {}- observe(target: Element) {- this.callback([{ target } as ResizeObserverEntry], this as unknown as ResizeObserver);- }- unobserve() {}- disconnect() {}-}--const originalResizeObserver = globalThis.ResizeObserver;-const originalClientWidth = Object.getOwnPropertyDescriptor(HTMLElement.prototype, "clientWidth");--beforeAll(() => {- globalThis.ResizeObserver = MockResizeObserver as unknown as typeof ResizeObserver;- Object.defineProperty(HTMLElement.prototype, "clientWidth", {- configurable: true,- get: () => 900,- });-});--afterAll(() => {- globalThis.ResizeObserver = originalResizeObserver;- if (originalClientWidth)- Object.defineProperty(HTMLElement.prototype, "clientWidth", originalClientWidth);- document.body.innerHTML = "";-});+installTimelineMountEnv();const clips = [{ id: "intro", tag: "div", start: 2, duration: 10, track: 0 }];const needle = (host: HTMLElement) =>diff --git a/packages/studio/src/player/components/TimelineGroupHeader.tsx b/packages/studio/src/player/components/TimelineGroupHeader.tsxindex 5f7732c0ef..1fbd53f0e8 100644--- a/packages/studio/src/player/components/TimelineGroupHeader.tsx+++ b/packages/studio/src/player/components/TimelineGroupHeader.tsx@@ -24,6 +24,7 @@ interface TimelineGroupHeaderProps {onOpenFxRack: () => void;columnWidth: number;theme: TimelineTheme;+ showAudioEffects?: boolean;}/**@@ -41,17 +42,19 @@ function GroupNameButton({label,memberCount,onOpenFxRack,+ showAudioEffects,}: {label: string;memberCount: number;onOpenFxRack: () => void;+ showAudioEffects: boolean;}) {return (<buttontype="button"tabIndex={-1}- aria-label={`Open ${label} effects`}- title="Open effects"+ aria-label={showAudioEffects ? `Open ${label} effects` : `Select ${label}`}+ title={showAudioEffects ? "Open effects" : "Select group"}// No `flex-1`: the row's control group owns the slack now (`ml-auto`), so// claiming it here would push the controls off the right edge — and the// count with them, since it rides inside this button.@@ -97,6 +100,7 @@ export function TimelineGroupHeader({onOpenFxRack,columnWidth,theme,+ showAudioEffects = true,}: TimelineGroupHeaderProps) {return (<div@@ -137,17 +141,24 @@ export function TimelineGroupHeader({▸ sits off-centre in its box because the glyph is not square. */}<span aria-hidden="true">{isExpanded ? "▾" : "▸"}</span></button>- <GroupNameButton label={label} memberCount={memberCount} onOpenFxRack={onOpenFxRack} />+ <GroupNameButton+ label={label}+ memberCount={memberCount}+ onOpenFxRack={onOpenFxRack}+ showAudioEffects={showAudioEffects}+ />{/* `ml-auto` absorbs the slack the truncating name leaves, so the controlssit on the edge whatever the name's length. */}<div className="ml-auto flex shrink-0 items-center gap-1.5">- <TimelineFxButton- fxChainRaw={fxChain}- onChainChange={onFxChainChange}- onChainPreview={onFxChainPreview}- auditionSpans={auditionSpans}- onOpenRack={onOpenFxRack}- />+ {showAudioEffects && (+ <TimelineFxButton+ fxChainRaw={fxChain}+ onChainChange={onFxChainChange}+ onChainPreview={onFxChainPreview}+ auditionSpans={auditionSpans}+ onOpenRack={onOpenFxRack}+ />+ )}{/* No lanes, no control: an author who opens it meets an empty row andlearns nothing. A track header already gates its own `∿` this way(`disclosable`); the group's was the one that still offered adiff --git a/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx b/packages/studio/src/player/components/TimelineGroupLaneLabels.tsxindex 89231d91e5..3b881a17dc 100644--- a/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx+++ b/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx@@ -63,8 +63,13 @@ export function TimelineGroupLaneLabels({tabIndex={-1}key={lane.target}data-group-lane-label={lane.target}- aria-label={`Show ${groupLabel} ${parts.name}${parts.param ? ` ${parts.param}` : ""} in the effect rack`}- className="absolute left-0 flex items-center gap-1.5 overflow-hidden border-0 px-1.5 text-left text-[10px] text-[var(--timeline-text-secondary)] hover:text-[var(--timeline-text-solid)] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)]"+ aria-label={+ onReveal+ ? `Show ${groupLabel} ${parts.name}${parts.param ? ` ${parts.param}` : ""} in the effect rack`+ : undefined+ }+ disabled={!onReveal}+ className="absolute left-0 flex items-center gap-1.5 overflow-hidden border-0 px-1.5 text-left text-[10px] text-[var(--timeline-text-secondary)] enabled:hover:text-[var(--timeline-text-solid)] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)]"style={{top: top + index * AUTOMATION_LANE_H,width: columnWidth,diff --git a/packages/studio/src/player/components/TimelineGroupRow.test.tsx b/packages/studio/src/player/components/TimelineGroupRow.test.tsxindex bf7542109b..35e53bc18e 100644--- a/packages/studio/src/player/components/TimelineGroupRow.test.tsx+++ b/packages/studio/src/player/components/TimelineGroupRow.test.tsx@@ -45,9 +45,21 @@ const GROUP: TimelineTrackGroupInfo = {hidden: false,};+const GAIN_AUTOMATED: Partial<TimelineTrackGroupInfo> = {+ fxChain: JSON.stringify({+ version: 1,+ nodes: [{ type: "peaking", id: "p1", params: { frequency: 1000, gain: -3, q: 1 } }],+ }),+ automation: JSON.stringify({+ version: 1,+ lanes: [{ target: "fx.p1.gain", points: [{ t: 0, v: 0 }] }],+ }),+};+function renderRow(overrides: Partial<TimelineTrackGroupInfo> = {},expandedLaneOwnerIds = new Set<string>(),+ showAudioEffects?: boolean,) {const onSetAudioGroupAttributeQuiet = vi.fn();const onSetElementAttributeQuiet = vi.fn();@@ -66,6 +78,7 @@ function renderRow(virtualized={false}contentOrigin={232}theme={defaultTimelineTheme}+ showAudioEffects={showAudioEffects}collapsedGroupIds={new Set()}expandedLaneOwnerIds={expandedLaneOwnerIds}toggleGroupExpanded={vi.fn()}@@ -118,19 +131,7 @@ describe("TimelineGroupRow", () => {});it("opens a group automation lane on its exact rack parameter", async () => {- const { host } = renderRow(- {- fxChain: JSON.stringify({- version: 1,- nodes: [{ type: "peaking", id: "p1", params: { frequency: 1000, gain: -3, q: 1 } }],- }),- automation: JSON.stringify({- version: 1,- lanes: [{ target: "fx.p1.gain", points: [{ t: 0, v: 0 }] }],- }),- },- new Set(["voiceover"]),- );+ const { host } = renderRow(GAIN_AUTOMATED, new Set(["voiceover"]));const laneTitle = host.querySelector<HTMLButtonElement>('[data-group-lane-label="fx.p1.gain"]');await act(async () => {@@ -147,6 +148,14 @@ describe("TimelineGroupRow", () => {});});+ it("keeps a group lane's name off the rack while audio effects are hidden", () => {+ const { host } = renderRow(GAIN_AUTOMATED, new Set(["voiceover"]), false);+ const laneTitle = host.querySelector<HTMLButtonElement>('[data-group-lane-label="fx.p1.gain"]');++ expect(laneTitle?.disabled).toBe(true);+ expect(laneTitle?.getAttribute("aria-label")).toBeNull();+ });+// C1 names this as the step's own definition of done: "opening the popover on// a GROUP and applying a preset results in exactly ONE `data-fx-chain` write,// on the group element, and zero writes on members". A group IS a bus — a@@ -180,16 +189,7 @@ describe("TimelineGroupRow", () => {expect(laneToggle(renderRow().host)).toBeUndefined();- const automated = renderRow({- fxChain: JSON.stringify({- version: 1,- nodes: [{ type: "peaking", id: "p1", params: { frequency: 1000, gain: -3, q: 1 } }],- }),- automation: JSON.stringify({- version: 1,- lanes: [{ target: "fx.p1.gain", points: [{ t: 0, v: 0 }] }],- }),- });+ const automated = renderRow(GAIN_AUTOMATED);expect(laneToggle(automated.host)).toBeDefined();});@@ -197,16 +197,7 @@ describe("TimelineGroupRow", () => {// one right-anchored group. It was two lines — name, then controls — which is// what let a stray child overflow the 48px box on the track side.it("keeps the caret, the name and every control on one line", () => {- const { host } = renderRow({- fxChain: JSON.stringify({- version: 1,- nodes: [{ type: "peaking", id: "p1", params: { frequency: 1000, gain: -3, q: 1 } }],- }),- automation: JSON.stringify({- version: 1,- lanes: [{ target: "fx.p1.gain", points: [{ t: 0, v: 0 }] }],- }),- });+ const { host } = renderRow(GAIN_AUTOMATED);const header = host.querySelector<HTMLElement>('[role="rowheader"]');// Caret, name, control group — no second line.expect(header?.children).toHaveLength(3);diff --git a/packages/studio/src/player/components/TimelineGroupRow.tsx b/packages/studio/src/player/components/TimelineGroupRow.tsxindex 192752e043..3ed097eed0 100644--- a/packages/studio/src/player/components/TimelineGroupRow.tsx+++ b/packages/studio/src/player/components/TimelineGroupRow.tsx@@ -33,6 +33,7 @@ interface TimelineGroupRowProps {virtualized: boolean;contentOrigin: number;theme: TimelineTheme;+ showAudioEffects?: boolean;rovingTargetId?: string | null;collapsedGroupIds: ReadonlySet<string>;expandedLaneOwnerIds: ReadonlySet<string>;@@ -59,6 +60,7 @@ export function TimelineGroupRow({virtualized,contentOrigin,theme,+ showAudioEffects = true,rovingTargetId = null,collapsedGroupIds,expandedLaneOwnerIds,@@ -173,6 +175,7 @@ export function TimelineGroupRow({// stays pinned there through horizontal scroll.columnWidth={contentOrigin >= LABEL_COL_W ? LABEL_COL_W : contentOrigin}theme={theme}+ showAudioEffects={showAudioEffects}/>{/* The group's OWN curves, under the strip. Selected-gated exactly like aclip's: a lane is editable once the group is selected, which clicking@@ -187,7 +190,7 @@ export function TimelineGroupRow({columnWidth={contentOrigin >= LABEL_COL_W ? LABEL_COL_W : contentOrigin}gutterBackground={theme.gutterBackground}accentColor={GROUP_LANE_ACCENT}- onReveal={openGroupFxRack}+ onReveal={showAudioEffects ? openGroupFxRack : undefined}/>)}</div>diff --git a/packages/studio/src/player/components/TimelineLanes.tsx b/packages/studio/src/player/components/TimelineLanes.tsxindex 7b7f10086a..b57bd0e003 100644--- a/packages/studio/src/player/components/TimelineLanes.tsx+++ b/packages/studio/src/player/components/TimelineLanes.tsx@@ -41,6 +41,7 @@ export function TimelineLanes({contentGutter,trackContentWidth,theme,+ showAudioEffects,displayTrackOrder,rowGeometry,virtualRows,@@ -115,11 +116,8 @@ export function TimelineLanes({// synthetic lane element spans the whole composition rather than a clip.const compositionDuration = usePlayerStore((s) => s.duration);useAutomationSelectionKeyboard({ lanes: automationLanes });- const { logicalRowsByTrack, groupByAnchor } = useTimelineLaneRowIndexes(logicalRows, groups);- const groupMemberTracks = useMemo(- () => new Set(groups.flatMap((group) => group.memberTracks)),- [groups],- );+ const rowIndexes = useTimelineLaneRowIndexes(logicalRows, groups);+ const { logicalRowsByTrack, groupByAnchor, groupMemberTracks } = rowIndexes;const {toggleRowExpanded: toggleRowExpandedTracked,toggleClipExpanded: toggleClipExpandedTracked,@@ -168,6 +166,7 @@ export function TimelineLanes({virtualized={rowsVirtualized}contentOrigin={contentOrigin}theme={theme}+ showAudioEffects={showAudioEffects}rovingTargetId={keyboard.rovingTargetId}collapsedGroupIds={collapsedGroupIds}expandedLaneOwnerIds={expandedLaneOwnerIds}@@ -292,6 +291,7 @@ export function TimelineLanes({isAudioTrack={isAudioTrack}isGroupMember={groupMemberTracks.has(trackNum)}theme={theme}+ showAudioEffects={showAudioEffects}onToggleClipExpanded={() => {const keys = els.map(getTimelineElementIdentity);if (keys.length > 0) toggleRowExpandedTracked(keys);diff --git a/packages/studio/src/player/components/TimelineTrackHeader.test.tsx b/packages/studio/src/player/components/TimelineTrackHeader.test.tsxindex ba40ffcb40..e2561a9798 100644--- a/packages/studio/src/player/components/TimelineTrackHeader.test.tsx+++ b/packages/studio/src/player/components/TimelineTrackHeader.test.tsx@@ -75,6 +75,7 @@ interface RenderHeaderOptions {isAudioTrack?: boolean;isGroupMember?: boolean;isTrackHidden?: boolean;+ showAudioEffects?: boolean;}function renderHeader(options: RenderHeaderOptions = {}): {@@ -119,6 +120,7 @@ function renderHeader(options: RenderHeaderOptions = {}): {isAudioTrack={next.isAudioTrack}isGroupMember={next.isGroupMember}theme={defaultTimelineTheme}+ showAudioEffects={next.showAudioEffects}onToggleClipExpanded={vi.fn()}onToggleTrackHidden={next.onToggleTrackHidden}onTogglePropertyGroupKeyframe={next.onTogglePropertyGroupKeyframe}@@ -583,6 +585,31 @@ describe("TimelineTrackHeader", () => {}),} as TimelineElement;+ it("offers the effect rack from an effect lane only while audio effects are shown", () => {+ const clip = { ...BED, domId: "bed" } as TimelineElement;+ const gainLabel = (showAudioEffects?: boolean) => {+ const { host, root } = renderHeader({+ keyframeClip: clip,+ animations: [],+ showAudioEffects,+ });+ const button = host+ .querySelector('[data-automation-lane-label="Peaking EQ 1.6 kHz · Gain"]')+ ?.querySelector("button");+ const state = {+ label: button?.getAttribute("aria-label") ?? null,+ disabled: button?.disabled,+ };+ act(() => root.unmount());+ return state;+ };+ expect(gainLabel()).toEqual({+ label: "Show Peaking EQ 1.6 kHz · Gain in the effect rack",+ disabled: false,+ });+ expect(gainLabel(false)).toEqual({ label: null, disabled: true });+ });+it("names every envelope in the label column", () => {const { host, root } = renderHeader({ keyframeClip: BED, animations: [] });const rows = Array.from(host.querySelectorAll<HTMLElement>("[data-automation-lane-label]"));diff --git a/packages/studio/src/player/components/TimelineTrackHeader.tsx b/packages/studio/src/player/components/TimelineTrackHeader.tsxindex eff4073c85..25e27f60b2 100644--- a/packages/studio/src/player/components/TimelineTrackHeader.tsx+++ b/packages/studio/src/player/components/TimelineTrackHeader.tsx@@ -72,6 +72,7 @@ interface TimelineTrackHeaderProps {isGroupMember?: boolean;rovingTargetId?: string | null;theme: TimelineTheme;+ showAudioEffects?: boolean;onToggleClipExpanded: () => void;onToggleTrackHidden: TimelineEditCallbacks["onToggleTrackHidden"];onTogglePropertyGroupKeyframe?: TimelineEditCallbacks["onTogglePropertyGroupKeyframe"];@@ -98,6 +99,7 @@ export function TimelineTrackHeader({isAudioTrack,isGroupMember = false,theme,+ showAudioEffects = true,onToggleClipExpanded,onToggleTrackHidden,onTogglePropertyGroupKeyframe,@@ -316,7 +318,7 @@ export function TimelineTrackHeader({// On the control line rather than a third row of its own.trailing={<>- {singleAudioClip && (+ {showAudioEffects && singleAudioClip && (<TimelineFxButtonvariant="chain"fxChainRaw={singleAudioClip.fxChain}@@ -340,7 +342,8 @@ export function TimelineTrackHeader({onOpenRack={() => openClipFxRack(singleAudioClip)}/>)}- {clipCount > 1 &&+ {showAudioEffects &&+ clipCount > 1 &&!isTrackGrouped &&(isAudioTrack ? canGroupWholeTrack : isVideoWithAudioTrack) && (<TimelineFxButton@@ -455,7 +458,7 @@ export function TimelineTrackHeader({// element, so a shared row's other envelopes belong to clips it is// not showing and there would be nothing to reveal.onReveal={- revealTarget && revealElementId && keyframeClip+ showAudioEffects && revealTarget && revealElementId && keyframeClip? () => {// Select FIRST: the rack is the property panel's view of// the selected element, so a reveal aimed at an unselecteddiff --git a/packages/studio/src/player/components/TimelineTypes.ts b/packages/studio/src/player/components/TimelineTypes.tsindex 21f7691699..8648a4ec3f 100644--- a/packages/studio/src/player/components/TimelineTypes.ts+++ b/packages/studio/src/player/components/TimelineTypes.ts@@ -33,4 +33,5 @@ export interface TimelinePropsonDuplicateClip?: () => Promise<boolean>;canPasteClip?: () => boolean;theme?: Partial<TimelineTheme>;+ showAudioEffects?: boolean;}diff --git a/packages/studio/src/player/components/timelineLaneProps.ts b/packages/studio/src/player/components/timelineLaneProps.tsindex 5c997850bf..f0299256cc 100644--- a/packages/studio/src/player/components/timelineLaneProps.ts+++ b/packages/studio/src/player/components/timelineLaneProps.ts@@ -29,6 +29,7 @@ export interface TimelineLaneBaseProps {contentGutter: number;trackContentWidth: number;theme: TimelineTheme;+ showAudioEffects?: boolean;displayTrackOrder: number[];rowHeights: readonly number[];rowGeometry: TimelineRowGeometry;diff --git a/packages/studio/src/player/components/timelineMountTestEnv.ts b/packages/studio/src/player/components/timelineMountTestEnv.tsnew file mode 100644index 0000000000..076164562b--- /dev/null+++ b/packages/studio/src/player/components/timelineMountTestEnv.ts@@ -0,0 +1,29 @@+import { afterAll, beforeAll } from "vitest";++// Mounting a whole <Timeline> in happy-dom needs a width to lay out against and a size report.+class MockResizeObserver {+ constructor(private readonly callback: ResizeObserverCallback) {}+ observe(target: Element) {+ this.callback([{ target } as ResizeObserverEntry], this as unknown as ResizeObserver);+ }+ unobserve() {}+ disconnect() {}+}++export function installTimelineMountEnv(): void {+ const originalResizeObserver = globalThis.ResizeObserver;+ const originalClientWidth = Object.getOwnPropertyDescriptor(HTMLElement.prototype, "clientWidth");+ beforeAll(() => {+ globalThis.ResizeObserver = MockResizeObserver as unknown as typeof ResizeObserver;+ Object.defineProperty(HTMLElement.prototype, "clientWidth", {+ configurable: true,+ get: () => 900,+ });+ });+ afterAll(() => {+ globalThis.ResizeObserver = originalResizeObserver;+ if (originalClientWidth)+ Object.defineProperty(HTMLElement.prototype, "clientWidth", originalClientWidth);+ document.body.innerHTML = "";+ });+}diff --git a/packages/studio/src/player/components/useTimelineLabelColumn.ts b/packages/studio/src/player/components/useTimelineLabelColumn.tsnew file mode 100644index 0000000000..725f76268a--- /dev/null+++ b/packages/studio/src/player/components/useTimelineLabelColumn.ts@@ -0,0 +1,18 @@+import { useMemo } from "react";+import type { GsapAnimation } from "@hyperframes/core/gsap-parser";+import type { TimelineElement } from "../store/playerStore";+import { GUTTER, LABEL_COL_W, TRACKS_LEFT_PAD } from "./timelineLayout";+import { timelineNeedsLabelColumn } from "./timelineViewModel";++export function useTimelineLabelColumn(+ animationsByElement: ReadonlyMap<string, readonly GsapAnimation[]>,+ elements: readonly TimelineElement[],+) {+ const labelMode = useMemo(+ () => timelineNeedsLabelColumn(animationsByElement, elements),+ [animationsByElement, elements],+ );+ // The label column provides pre-t=0 space; otherwise keep TRACKS_LEFT_PAD after the gutter.+ const contentOrigin = labelMode ? LABEL_COL_W + GUTTER : GUTTER + TRACKS_LEFT_PAD;+ return { labelMode, contentOrigin };+}diff --git a/packages/studio/src/player/components/useTimelineLaneRowIndexes.ts b/packages/studio/src/player/components/useTimelineLaneRowIndexes.tsindex 7ef978c5c0..c51f96fa36 100644--- a/packages/studio/src/player/components/useTimelineLaneRowIndexes.ts+++ b/packages/studio/src/player/components/useTimelineLaneRowIndexes.ts@@ -34,5 +34,10 @@ export function useTimelineLaneRowIndexes([groups],);- return { logicalRowsByTrack, groupByAnchor };+ const groupMemberTracks = useMemo(+ () => new Set(groups.flatMap((group) => group.memberTracks)),+ [groups],+ );++ return { logicalRowsByTrack, groupByAnchor, groupMemberTracks };}diff --git a/packages/studio/src/player/components/useTimelineProviderState.tsx b/packages/studio/src/player/components/useTimelineProviderState.tsxindex 98408d255b..b86cc78835 100644--- a/packages/studio/src/player/components/useTimelineProviderState.tsx+++ b/packages/studio/src/player/components/useTimelineProviderState.tsx@@ -19,7 +19,8 @@ import { useTimelineEditPinning } from "./useTimelineEditPinning";import { useTimelineStackingSync } from "./useTimelineStackingSync";import { useTimelineGeometry } from "./useTimelineGeometry";import { useAutoExpandKeyframedClips } from "./useAutoExpandKeyframedClips";-import { GUTTER, LABEL_COL_W, TRACKS_LEFT_PAD } from "./timelineLayout";+import { GUTTER, LABEL_COL_W } from "./timelineLayout";+import { useTimelineLabelColumn } from "./useTimelineLabelColumn";import { useTimelineScrollViewport } from "./useTimelineScrollViewport";import { ClipContentOnceShown } from "./timelineClipChildren";import { useResolvedTimelineEditCallbacks } from "./useResolvedTimelineEditCallbacks";@@ -33,11 +34,7 @@ import { useTimelineKeyframeHandlers } from "./useTimelineKeyframeHandlers";import { useTimelineGapHighlights } from "./useTimelineGapHighlights";import { TimelineRazorGuideOverlay, useTimelineRazorInteraction } from "./TimelineRazorInteraction";import { useTimelinePerformanceTelemetry } from "./useTimelinePerformanceTelemetry";-import {- getEffectiveTimelineDuration,- getTimelinePreviewElement,- timelineNeedsLabelColumn,-} from "./timelineViewModel";+import { getEffectiveTimelineDuration, getTimelinePreviewElement } from "./timelineViewModel";import { useTimelineShiftModifier } from "./useTimelineShiftModifier";import { useTimelineTicks } from "./useTimelineTicks";import { getTimelineElementIdentity } from "../lib/timelineElementHelpers";@@ -70,6 +67,7 @@ export function useTimelineProviderState({onDuplicateClip,canPasteClip,theme: themeOverrides,+ showAudioEffects = true,sessionEpoch = 0,previewIframeRef,onZIndexReorder,@@ -107,12 +105,7 @@ export function useTimelineProviderState({const selectedElementIds = usePlayerStore((s) => s.selectedElementIds);const focusedEaseSegment = usePlayerStore((s) => s.focusedEaseSegment);const gsapAnimations = usePlayerStore((s) => s.gsapAnimations);- const labelMode = useMemo(- () => timelineNeedsLabelColumn(gsapAnimations, timelineElements),- [gsapAnimations, timelineElements],- );- // The label column provides pre-t=0 space; otherwise keep TRACKS_LEFT_PAD after the gutter.- const contentOrigin = labelMode ? LABEL_COL_W + GUTTER : GUTTER + TRACKS_LEFT_PAD;+ const { labelMode, contentOrigin } = useTimelineLabelColumn(gsapAnimations, timelineElements);const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);const currentTime = usePlayerStore((s) => s.currentTime);const beatDragging = usePlayerStore((s) => s.beatDragging);@@ -448,6 +441,7 @@ export function useTimelineProviderState({laneGapStrips,dropPreview: assetDrop.dropPreview,theme,+ showAudioEffects,displayTrackOrder: displayLayout.displayTrackOrder,rowHeights: displayLayout.displayRowHeights,rowGeometry: displayLayout.rowGeometry,