diff --git a/packages/studio/src/player/components/TimelineGroupHeader.tsx b/packages/studio/src/player/components/TimelineGroupHeader.tsx index 0f815eb6f..d8890ce09 100644 --- a/packages/studio/src/player/components/TimelineGroupHeader.tsx +++ b/packages/studio/src/player/components/TimelineGroupHeader.tsx @@ -141,27 +141,33 @@ export function TimelineGroupHeader({ auditionSpans={auditionSpans} onOpenRack={onOpenFxRack} /> - + + )} ); diff --git a/packages/studio/src/player/components/TimelineGroupRow.test.tsx b/packages/studio/src/player/components/TimelineGroupRow.test.tsx index 295d57321..0b89493a7 100644 --- a/packages/studio/src/player/components/TimelineGroupRow.test.tsx +++ b/packages/studio/src/player/components/TimelineGroupRow.test.tsx @@ -36,7 +36,7 @@ const GROUP: TimelineTrackGroupInfo = { hidden: false, }; -function renderRow() { +function renderRow(overrides: Partial = {}) { const onSetAudioGroupAttributeQuiet = vi.fn(); const onSetElementAttributeQuiet = vi.fn(); const host = document.createElement("div"); @@ -47,7 +47,7 @@ function renderRow() { { // The members are the point: not one write reaches them. expect(onSetElementAttributeQuiet).not.toHaveBeenCalled(); }); + + // A disclosure over nothing tells the author their group has no automation + // only AFTER they open an empty row. Track headers already gate their own + // toggle on having something to disclose; the group's did not. + it("hides the lane toggle until the group actually automates something", () => { + const laneToggle = (host: HTMLElement) => + Array.from(host.querySelectorAll("button")).find((b) => + /lanes$/.test(b.getAttribute("aria-label") ?? ""), + ); + + 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 }] }], + }), + }); + expect(laneToggle(automated.host)).toBeDefined(); + }); });