From 94f3e5efa7ff527e91165ebb281760d3f6c651e0 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Tue, 18 Aug 2026 15:40:38 -0700 Subject: [PATCH] test(studio): keep mixing-desk words out of the group strip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The design docs live on their own branch and do not travel with this PR, so the vocabulary rule they carry has no way to reach whoever next edits this component. It was already broken once this week: the strip shipped a "Bus level" label and a "how loud this bus is playing right now" tooltip. Extends the copy test that already guards "no dB" — same idea, same file. It reads the rendered text AND every title/aria-label, because the regression it is named for was a tooltip and textContent would have missed it. Verified against the real defect: restoring the "Bus level" label fails it with `expected 'Bus level⚠ Too loud…' not to match /\b(bus|submix|fader|insert|send)s?\b/i`. Also restores the ⚠ the §5 mockup gives "Too loud" in the file's own docblock, which had drifted from the markup. --- .../components/TimelineGroupBusStrip.test.tsx | 24 +++++++++++++++++++ .../components/TimelineGroupBusStrip.tsx | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/studio/src/player/components/TimelineGroupBusStrip.test.tsx b/packages/studio/src/player/components/TimelineGroupBusStrip.test.tsx index 5f6264001..309baaf4a 100644 --- a/packages/studio/src/player/components/TimelineGroupBusStrip.test.tsx +++ b/packages/studio/src/player/components/TimelineGroupBusStrip.test.tsx @@ -156,4 +156,28 @@ describe("TimelineGroupBusStrip", () => { }); expect(container.textContent ?? "").not.toMatch(/dB/i); }); + + // The design docs live on their own branch and never reach this PR, so the + // vocabulary rule they carry has to be enforced from inside the code or it + // gets re-broken by whoever reads only the component. It already was once: + // this strip shipped a "Bus level" label and a "how loud this bus is playing" + // tooltip. Mixing-desk nouns are ours, for talking to each other — an author + // has never met a bus, a fader, an insert or a send, and will not learn them + // to put reverb on a voiceover. + it("uses no mixing-desk vocabulary in anything the author can read", () => { + vi.useFakeTimers(); + renderStrip({ volume: 0.5 }); + act(() => { + groupLevels.notify(new Map([["vo", { level: 0.9, clipped: true }]])); + vi.advanceTimersByTime(40); + }); + // Tooltips too, not just text: the regression this catches was a `title`. + const readable = [ + container.textContent ?? "", + ...Array.from(container.querySelectorAll("[title], [aria-label]")).map( + (el) => `${el.getAttribute("title") ?? ""} ${el.getAttribute("aria-label") ?? ""}`, + ), + ].join(" "); + expect(readable).not.toMatch(/\b(bus|submix|fader|insert|send)s?\b/i); + }); }); diff --git a/packages/studio/src/player/components/TimelineGroupBusStrip.tsx b/packages/studio/src/player/components/TimelineGroupBusStrip.tsx index 9944e61e5..fcfda949e 100644 --- a/packages/studio/src/player/components/TimelineGroupBusStrip.tsx +++ b/packages/studio/src/player/components/TimelineGroupBusStrip.tsx @@ -2,7 +2,7 @@ * B7: the group's own volume slider + a living level bar + "Holds …" — the * bus, not the mechanism. No dB numbers, no peak-hold readout, no routing * row (groups doc §5, casual-user section) — a slider, a bar that moves with - * the sound, and the words "Too loud" when it clips. + * the sound, and the words "⚠ Too loud" when it clips. */ import { useEffect, useRef, useState } from "react"; import { useGroupLevel } from "../../hooks/useGroupLevel";