Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Audio: Clean up voice is the first mode and /audio opens on it

Adarsh5606ef72b4a3
diff --git a/src/components/audio-tools/clean-voice-tool.tsx b/src/components/audio-tools/clean-voice-tool.tsx
index a5452f35..dfbaedd3 100644
--- a/src/components/audio-tools/clean-voice-tool.tsx
+++ b/src/components/audio-tools/clean-voice-tool.tsx
@@ -467,7 +467,7 @@ export function CleanVoiceTool({ app }: { app?: { name: string; description: str
</Link>
</Button>
<Button variant="outline" size="sm" className="rounded-full" asChild>
- <Link href={`/audio?voice=${encodeURIComponent(out.url)}`}>
+ <Link href={`/audio/speech?voice=${encodeURIComponent(out.url)}`}>
<UserRound className="size-3.5" /> Use as a voice sample
</Link>
</Button>
diff --git a/src/components/audio-tools/design-voice-tool.tsx b/src/components/audio-tools/design-voice-tool.tsx
index aeb36461..ce09f8d9 100644
--- a/src/components/audio-tools/design-voice-tool.tsx
+++ b/src/components/audio-tools/design-voice-tool.tsx
@@ -99,7 +99,7 @@ function Take({ g, index, description, line, canSave }: { g: Generation; index:
</Button>
)}
<Button asChild size="sm" variant="ghost" className="rounded-full">
- <Link href={`/audio?voice=${encodeURIComponent(url)}`}>
+ <Link href={`/audio/speech?voice=${encodeURIComponent(url)}`}>
<Mic className="size-3.5" /> Use in Speech
</Link>
</Button>
diff --git a/src/components/studio/mode-switch-studio.tsx b/src/components/studio/mode-switch-studio.tsx
index e0edcea6..8ffc0db8 100644
--- a/src/components/studio/mode-switch-studio.tsx
+++ b/src/components/studio/mode-switch-studio.tsx
@@ -94,8 +94,10 @@ export function ModeSwitchStudio({ kind, mode }: { kind: HubKind; mode?: string
if (Tool) return <Tool />;
const config = CONFIGS[kind][current];
if (!config) notFound();
- // A composer mode's own examples ("hub:upscale", "hub:upscale/video"…), else the hub's covers that fit it.
- const examples = exampleRow(current === HUB_MODES[kind][0].id ? `hub:${kind}` : `hub:${kind}/${current}`);
+ // A composer mode's own examples ("hub:upscale", "hub:upscale/video"…), else the hub's covers that fit it. The hub's
+ // first composer mode has the hub's own row (Audio's Speech: its first mode, Clean up voice, is a tool of its own).
+ const home = HUB_MODES[kind].find((m) => !TOOLS[kind]?.[m.id])?.id;
+ const examples = exampleRow(current === home ? `hub:${kind}` : `hub:${kind}/${current}`);
return <StudioPage config={config} catalog={studioCatalog(config)} examples={examples} />;
}
diff --git a/src/lib/hubs.ts b/src/lib/hubs.ts
index da50c7ce..60a31e05 100644
--- a/src/lib/hubs.ts
+++ b/src/lib/hubs.ts
@@ -27,14 +27,15 @@ export const HUB_MODES: Record<HubKind, HubMode[]> = {
{ id: "hdr", label: "SDR to HDR" },
{ id: "export", label: "Export" },
],
+ // Clean up voice leads: /audio opens on it, and every list of Audio's modes starts with it.
audio: [
+ { id: "clean", label: "Clean up voice" },
{ id: "speech", label: "Speech" },
{ id: "dialogue", label: "Dialogue" },
{ id: "voice-change", label: "Voice change" },
{ id: "design", label: "Design a voice" },
{ id: "translate", label: "Translate", selfHostedOnly: true },
{ id: "transcribe", label: "Transcribe" },
- { id: "clean", label: "Clean up voice" },
{ id: "split", label: "Split soundtrack", selfHostedOnly: true },
{ id: "sfx", label: "Sound effects" },
{ id: "music", label: "Music" },
diff --git a/src/lib/nav-model.ts b/src/lib/nav-model.ts
index bc694704..660d84cc 100644
--- a/src/lib/nav-model.ts
+++ b/src/lib/nav-model.ts
@@ -264,10 +264,16 @@ const HUB_ORDER: HubKind[] = ["upscale", "audio", "video-tools"];
const HUB_ICON: Record<HubKind, NavIconName> = { upscale: "ZoomIn", audio: "AudioLines", "video-tools": "Layers" };
/**
- * The Sound column: the Audio studio, then its main modes in this order (voice is the studio's first mode, so the lead
- * card stands for it). These modes are in the launcher, the Studios sheet and "Every studio" as well as in search.
+ * The Sound column: the Audio studio, then its main modes in this order, Clean up voice (the studio's first mode) first.
+ * These modes are in the launcher, the Studios sheet and "Every studio" as well as in search.
*/
-const SOUND_COLUMN = ["audio", "audio-music", "audio-sfx", "audio-clean", "audio-translate"];
+const SOUND_COLUMN = ["audio", "audio-clean", "audio-music", "audio-sfx", "audio-translate"];
+
+/**
+ * A hub's first mode with a row of its own in the menus (Audio's Clean up voice): its own page (/audio/clean, the same
+ * tool as /audio), so its row and the studio's card don't share a link.
+ */
+const OWN_PAGE = new Set(["audio-clean"]);
/** Every hub mode as a tool of its studio (found by search, linked from the goal bands). */
const HUB_TOOLS: NavEntry[] = HUB_ORDER.flatMap((hub) =>
@@ -276,7 +282,7 @@ const HUB_TOOLS: NavEntry[] = HUB_ORDER.flatMap((hub) =>
const copy = TOOL_COPY[id];
return {
id,
- href: modeHref(hub, m.id),
+ href: OWN_PAGE.has(id) ? `/${hub}/${m.id}` : modeHref(hub, m.id),
label: copy?.label ?? m.label,
...(copy?.label && copy.label !== m.label && { tab: m.label }),
what: copy?.what ?? m.label,
diff --git a/src/lib/nav-search.ts b/src/lib/nav-search.ts
index dff5d907..b0e56600 100644
--- a/src/lib/nav-search.ts
+++ b/src/lib/nav-search.ts
@@ -79,7 +79,7 @@ export const INTENTS: readonly Intent[] = [
{ id: "film", triggers: ["film", "movie", "cinematic", "scene", "shot", "director", "trailer", "music video"], targets: ["cinema", "storyboard", "motions", "katana"] },
{ id: "dance", triggers: ["dance", "choreography", "pose", "moves", "tiktok dance"], targets: ["motion-control", "app-dance", "genjutsu"] },
{ id: "talk", triggers: ["talk", "talking", "speak", "lipsync", "lip sync", "avatar", "presenter", "spokesperson"], targets: ["lipsync", "app-talking-photo", "audio-speech"] },
- { id: "sound", triggers: ["sound", "audio"], targets: ["audio", "audio-sfx", "audio-music"] },
+ { id: "sound", triggers: ["sound", "audio"], targets: ["audio", "audio-clean", "audio-sfx", "audio-music"] },
{ id: "voice", triggers: ["voice", "voiceover", "voice over", "narration", "narrator", "tts", "text to speech", "read aloud"], targets: ["audio-speech", "audio", "lipsync"] },
{ id: "music", triggers: ["music", "song", "soundtrack", "beat", "jingle", "score", "background music"], targets: ["audio-music", "audio", "audio-video"] },
{ id: "sfx", triggers: ["sfx", "foley", "whoosh", "sound effect"], targets: ["audio-sfx", "audio-video", "audio"] },
diff --git a/src/lib/palette-index.ts b/src/lib/palette-index.ts
index 13b46d35..12e06947 100644
--- a/src/lib/palette-index.ts
+++ b/src/lib/palette-index.ts
@@ -50,7 +50,7 @@ const MODEL_STUDIOS: [string, StudioConfig][] = [
["/reframe", REFRAME_STUDIO],
["/upscale", UPSCALE_STUDIO],
["/upscale/video", VIDEO_UPSCALE_STUDIO],
- ["/audio", AUDIO_STUDIO],
+ ["/audio/speech", AUDIO_STUDIO],
["/audio/dialogue", DIALOGUE_STUDIO],
["/audio/voice-change", VOICE_CHANGE_STUDIO],
["/audio/transcribe", TRANSCRIBE_STUDIO],
@@ -70,7 +70,7 @@ const IN_3D = new Set([...ALL_MODELS_3D.map((m) => m.id), RIG_MODEL, ...RETEXTUR
/** The Layers editor's tools (cut-out, layers, text detection…): its project list is where they start. */
const IN_LAYERS = new Set(Object.values(TOOL_MODELS).flatMap((t) => [...t.cloud, ...t.open]));
/** Where a model no studio, app or tool offers opens: the studio of what it makes. */
-const KIND_HOME: Record<ModelDef["kind"], string> = { image: "/image", video: "/video", audio: "/audio", text: "/assist", model3d: "/image-to-3d" };
+const KIND_HOME: Record<ModelDef["kind"], string> = { image: "/image", video: "/video", audio: "/audio/speech", text: "/assist", model3d: "/image-to-3d" };
/** Tools with their own flow (and their own model choice), by operation. */
const TOOL_PAGES: [string, Operation][] = [
["/video-tools/captions", "captions"],
diff --git a/src/server/gpu/tools.ts b/src/server/gpu/tools.ts
index a73a94f2..55f00639 100644
--- a/src/server/gpu/tools.ts
+++ b/src/server/gpu/tools.ts
@@ -235,7 +235,7 @@ export const STUDIO_ROWS: StudioRowDef[] = [
// Turnaround stills · 8 views: the character from all 8 sides at eye level, drawn by QMA · 96 views (the
// turnaround dialog's Stills route; its graph loads the QMA LoRA itself). It also draws a film's missing sides when picked.
{ href: "/character-sheet?stills=1", label: "Turnaround stills · 8 views", group: "Images", steps: [{ modelId: QMA_MODEL, op: "edit" }] },
- { href: "/audio", label: "Voice", group: "Audio", config: S.AUDIO_STUDIO },
+ { href: "/audio/speech", label: "Voice", group: "Audio", config: S.AUDIO_STUDIO },
{ href: "/audio/dialogue", label: "Dialogue", group: "Audio", config: S.DIALOGUE_STUDIO },
{ href: "/audio/voice-change", label: "Voice change", group: "Audio", config: S.VOICE_CHANGE_STUDIO },
// Design a voice: Qwen3-TTS designs the takes and clones the one saved (VoxCPM2 is the other choice).
diff --git a/tests/assist-polish.test.ts b/tests/assist-polish.test.ts
index 8e163eb1..7a5a991f 100644
--- a/tests/assist-polish.test.ts
+++ b/tests/assist-polish.test.ts
@@ -67,8 +67,8 @@ describe("the 390 px sweep visits dynamic routes", () => {
}
});
- it("reads every hub mode from src/lib/hubs.ts (the first mode is the hub's own page)", () => {
- const expected = Object.entries(HUB_MODES).flatMap(([hub, modes]) => modes.slice(1).map((m) => `/${hub}/${m.id}`));
+ it("reads every hub mode from src/lib/hubs.ts (each has a path of its own; the first is also the hub's own page)", () => {
+ const expected = Object.entries(HUB_MODES).flatMap(([hub, modes]) => modes.map((m) => `/${hub}/${m.id}`));
expect((hubModePaths(root) as string[]).sort()).toEqual(expected.sort());
});
});
diff --git a/tests/clean-voice.test.ts b/tests/clean-voice.test.ts
index f26b7970..debfea6c 100644
--- a/tests/clean-voice.test.ts
+++ b/tests/clean-voice.test.ts
@@ -18,7 +18,7 @@ import {
tooLongProblem,
workRate,
} from "@/lib/av/clean-voice";
-import { HUB_MODES, modeHref } from "@/lib/hubs";
+import { HUB_MODES, modeHref, modeOfPath } from "@/lib/hubs";
import { cleanedName } from "@/components/audio-tools/clean-voice-switch";
import { outputActions } from "@/lib/output-actions";
import { APPS, getModel } from "@/lib/catalog";
@@ -208,10 +208,11 @@ describe("the report in words", () => {
});
describe("where Clean up voice opens", () => {
- it("is an Audio mode right after Transcribe, and an app that renders the same tool", () => {
- const ids = HUB_MODES.audio.map((m) => m.id);
- expect(ids.indexOf("clean")).toBe(ids.indexOf("transcribe") + 1);
- expect(modeHref("audio", "clean")).toBe("/audio/clean");
+ it("is Audio's first mode (/audio opens on it, /audio/clean too), and an app that renders the same tool", () => {
+ expect(HUB_MODES.audio[0]).toEqual({ id: "clean", label: "Clean up voice" });
+ expect(modeHref("audio", "clean")).toBe("/audio");
+ expect(modeOfPath("audio", "/audio")).toBe("clean");
+ expect(modeOfPath("audio", "/audio/clean")).toBe("clean");
const app = APPS.find((a) => a.id === "app-clean-up-voice")!;
expect(app).toMatchObject({ tool: "clean-voice", category: "Utility", cloud: null, open: { modelId: "oss-reuse-voice", op: "enhance-voice" } });
expect(app.parity).toBe("Runs on open-source models only, on your GPU or CPU. RE-USE isn't hosted on fal or Replicate.");
diff --git a/tests/command-palette.test.ts b/tests/command-palette.test.ts
index d938fbea..b53dd567 100644
--- a/tests/command-palette.test.ts
+++ b/tests/command-palette.test.ts
@@ -166,7 +166,7 @@ describe("palette index", () => {
});
it("opens a model nothing else runs in the studio of what it makes", () => {
- const home: Record<string, string> = { image: "/image", video: "/video", audio: "/audio", text: "/assist", model3d: "/image-to-3d" };
+ const home: Record<string, string> = { image: "/image", video: "/video", audio: "/audio/speech", text: "/assist", model3d: "/image-to-3d" };
const fallback = index.models.filter((m) => !m.href.includes("?") && Object.values(home).includes(m.href));
expect(fallback.length).toBeLessThan(40);
for (const m of fallback) expect(m.href, m.id).toBe(home[getModel(m.id)!.kind]);
diff --git a/tests/composer-fixes.test.ts b/tests/composer-fixes.test.ts
index a6608f6f..7a83e192 100644
--- a/tests/composer-fixes.test.ts
+++ b/tests/composer-fixes.test.ts
@@ -168,7 +168,8 @@ describe("best for this studio", () => {
describe("studio hubs", () => {
it("give every mode its own path; the hub's path is its first mode", () => {
- expect(modeHref("audio", "speech")).toBe("/audio");
+ expect(modeHref("audio", "clean")).toBe("/audio");
+ expect(modeHref("audio", "speech")).toBe("/audio/speech");
expect(modeHref("audio", "music")).toBe("/audio/music");
expect(modeHref("upscale", "video", { video: "/v.mp4" })).toBe("/upscale/video?video=%2Fv.mp4");
for (const modes of Object.values(HUB_MODES)) expect(new Set(modes.map((m) => m.id)).size).toBe(modes.length);
diff --git a/tests/e2e/_routes.mjs b/tests/e2e/_routes.mjs
index 0cf54cc6..15608959 100644
--- a/tests/e2e/_routes.mjs
+++ b/tests/e2e/_routes.mjs
@@ -28,8 +28,8 @@ export function hubModePaths(root) {
const out = [];
for (const m of block.matchAll(/["']?([\w-]+)["']?:\s*\[([\s\S]*?)\]/g)) {
const ids = [...m[2].matchAll(/id:\s*"([\w-]+)"/g)].map((x) => x[1]);
- // The first mode is the hub's own page; the others have their own path.
- for (const id of ids.slice(1)) out.push(`/${m[1]}/${id}`);
+ // Every mode has a path of its own (the first one is also the hub's own page).
+ for (const id of ids) out.push(`/${m[1]}/${id}`);
}
return out;
}
diff --git a/tests/e2e/audio-first.mjs b/tests/e2e/audio-first.mjs
new file mode 100644
index 00000000..5714c1e0
--- /dev/null
+++ b/tests/e2e/audio-first.mjs
@@ -0,0 +1,152 @@
+// Audio opens on Clean up voice, in a real browser (a production build: `pnpm build && pnpm start`).
+// Usage: node tests/e2e/audio-first.mjs [appUrl] [shotsDir] Exits 1 if any check fails.
+//
+// At 390 and 1440, as a guest:
+// 1. /audio: the Modes row starts with Clean up voice and it is the selected tab; the page is its demo ("Hear her, not
+// the room."); nothing shifts while it loads; the only pictures and sounds it loads are the demo's (no other mode's
+// covers or clips).
+// 2. The other tabs still open their own pages (Speech at /audio/speech, Music), and Clean up voice brings /audio back.
+// 3. Old links: /audio/clean is the same tool with its tab selected; /audio?mode=speech and ?mode=music land on their
+// pages; /audio/speech?voice=… keeps the voice for the composer.
+// 4. The Studios menu (desktop launcher, phone sheet's Sound chip) lists Clean up voice right after the Audio studio,
+// and search for "audio" shows Audio, then Clean up voice.
+import fs from "node:fs";
+import path from "node:path";
+import { DESKTOP, ENGINE, launch, openRoute, PHONE } from "./_browser.mjs";
+
+const args = process.argv.slice(2).filter((a) => !a.startsWith("--"));
+const app = (args[0] ?? "http://localhost:3000").replace(/\/$/, "");
+const shots = args[1];
+if (shots) fs.mkdirSync(shots, { recursive: true });
+const browser = await launch();
+const failures = [];
+const check = (ok, what, detail = "") => {
+ console.log(`${ok ? "✓" : "✗"} ${what}${detail ? ` (${detail})` : ""}`);
+ if (!ok) failures.push(what);
+};
+const shot = async (p, name) => shots && (await p.screenshot({ path: path.join(shots, `${name}.png`) }));
+
+/** The Modes row's tabs, in order: mode id, words, selected. */
+const tabs = (p) =>
+ p.locator('nav[aria-label="Modes"] [data-tab-row] a[data-mode]').evaluateAll((els) =>
+ els.filter((a) => a.checkVisibility()).map((a) => ({ id: a.dataset.mode, name: a.textContent.trim(), on: a.hasAttribute("data-on") || a.getAttribute("aria-current") === "page" })),
+ );
+const path_ = (p) => new URL(p.url()).pathname + new URL(p.url()).search;
+
+for (const [label, device] of [
+ ["390", PHONE],
+ ["1440", DESKTOP],
+]) {
+ const ctx = await browser.newContext(device);
+ const p = await ctx.newPage();
+ const errors = [];
+ p.on("pageerror", (e) => errors.push(e.message.split("\n")[0]));
+ // Pictures and sounds the page asks for (the bar's own icons are inline SVG).
+ const media = [];
+ p.on("request", (r) => ["image", "media"].includes(r.resourceType()) && media.push(new URL(r.url()).pathname));
+ if (ENGINE === "chromium") {
+ await p.addInitScript(() => {
+ window.__cls = 0;
+ new PerformanceObserver((list) => {
+ for (const e of list.getEntries()) if (!e.hadRecentInput) window.__cls += e.value;
+ }).observe({ type: "layout-shift", buffered: true });
+ });
+ }
+
+ // 1. /audio opens on Clean up voice.
+ await openRoute(p, `${app}/audio`, { settleMs: 2500 });
+ const row = await tabs(p);
+ check(row[0]?.id === "clean" && row[0]?.name === "Clean up voice", `${label}: Clean up voice is the first tab`, row.slice(0, 4).map((t) => t.name).join(" › "));
+ check(row.filter((t) => t.on).map((t) => t.id).join() === "clean", `${label}: on /audio, Clean up voice is the selected tab`);
+ check(row[1]?.id === "speech", `${label}: Speech comes next (the old default, still a tab)`);
+ check(await p.getByRole("heading", { name: "Hear her, not the room." }).first().isVisible(), `${label}: /audio shows the Clean up voice demo`);
+ check((await p.title()).startsWith("Audio"), `${label}: the page title is Audio`, await p.title());
+ if (ENGINE === "chromium") {
+ const cls = await p.evaluate(() => window.__cls);
+ check(cls < 0.05, `${label}: nothing shifts while /audio loads`, `CLS ${cls.toFixed(3)}`);
+ }
+ // Another mode's covers and clips (Speech's "More to try" row, the examples); the shell's own pictures are on every page.
+ const other = [...new Set(media)].filter((u) => !u.startsWith("/samples/clean-voice/") && /^\/(examples|previews\/presets)\/|\.(mp4|webm|m4a|wav|mp3)$/.test(u));
+ check(media.some((u) => u.startsWith("/samples/clean-voice/")), `${label}: the demo's media load`, [...new Set(media)].filter((u) => u.startsWith("/samples/")).join(", "));
+ check(other.length === 0, `${label}: no other mode's pictures or clips load on /audio`, other.slice(0, 6).join(", "));
+ const overflow = await p.evaluate(() => document.documentElement.scrollWidth - innerWidth);
+ check(overflow <= 0, `${label}: no sideways scroll`, String(overflow));
+ await shot(p, `audio-${label}`);
+
+ // 2. The other tabs still work, and Clean up voice brings /audio back.
+ for (const [name, to, heading] of [
+ ["Speech", "/audio/speech", "Give it a voice"],
+ ["Music", "/audio/music", null],
+ ["Clean up voice", "/audio", "Hear her, not the room."],
+ ]) {
+ const tab = p.locator('nav[aria-label="Modes"] a[data-mode]').filter({ hasText: new RegExp(`^${name}$`) }).first();
+ await tab.scrollIntoViewIfNeeded();
+ await tab.click();
+ const went = await p.waitForURL((u) => new URL(u).pathname === to, { timeout: 20_000 }).then(() => true, () => false);
+ if (heading) await p.getByRole("heading", { name: heading }).first().waitFor({ timeout: 15_000 }).catch(() => {});
+ const now = await tabs(p);
+ check(went && now.find((t) => t.on)?.name === name && (!heading || (await p.getByRole("heading", { name: heading }).first().isVisible())), `${label}: the ${name} tab opens ${to}`, path_(p));
+ }
+
+ // 3. Old links.
+ await openRoute(p, `${app}/audio/clean`);
+ check((await tabs(p)).find((t) => t.on)?.id === "clean" && (await p.getByRole("heading", { name: "Hear her, not the room." }).first().isVisible()), `${label}: /audio/clean is the same tool, its tab selected`);
+ for (const [from, to] of [
+ ["/audio?mode=speech", "/audio/speech"],
+ ["/audio?mode=music", "/audio/music"],
+ ["/audio?mode=clean", "/audio"],
+ ]) {
+ await openRoute(p, `${app}${from}`);
+ check(new URL(p.url()).pathname === to, `${label}: ${from} lands on ${to}`, path_(p));
+ }
+ await openRoute(p, `${app}/audio/speech`);
+ check(await p.getByRole("heading", { name: "Give it a voice" }).first().isVisible(), `${label}: /audio/speech is the Speech composer`);
+
+ // 4. The menus and search.
+ if (label === "1440") {
+ await openRoute(p, `${app}/image`);
+ await p.locator("[data-top-bar]").getByRole("button", { name: /^Studios/ }).click();
+ const panel = p.locator("#studios-launcher");
+ await panel.waitFor({ state: "visible" });
+ await panel.getByRole("link", { name: /^Clean up/ }).first().waitFor({ timeout: 10_000 }).catch(() => {});
+ const column = await panel.evaluate((el) => {
+ const audio = [...el.querySelectorAll("a[data-col]")].find((a) => new URL(a.href).pathname === "/audio");
+ if (!audio) return [];
+ // The column's card and rows (each with a picture), not the studio's sub-links under its card.
+ return [...el.querySelectorAll(`a[data-col="${audio.dataset.col}"]`)].filter((a) => a.checkVisibility() && a.querySelector("img")).map((a) => new URL(a.href).pathname);
+ });
+ check(column[0] === "/audio" && column[1] === "/audio/clean", "1440: the Studios menu's Sound column: Audio, then Clean up voice", column.join(" › "));
+ await shot(p, "studios-menu-1440");
+ await p.keyboard.press("Escape");
+ await p.keyboard.press("ControlOrMeta+k");
+ } else {
+ await openRoute(p, `${app}/image`);
+ const bar = p.locator("[data-phone-tabs]");
+ await bar.getByRole("button", { name: "Studios" }).tap();
+ const sheet = p.locator("#phone-sheet");
+ await sheet.waitFor({ state: "visible" });
+ await sheet.getByRole("button", { name: /^Sound/ }).tap();
+ await p.waitForTimeout(400);
+ const tiles = await sheet.locator("ul").first().getByRole("link").evaluateAll((els) => els.map((a) => new URL(a.href).pathname));
+ check(tiles[0] === "/audio" && tiles[1] === "/audio/clean", "390: the Studios sheet's Sound chip: Audio, then Clean up voice", tiles.join(" › "));
+ await shot(p, "studios-sheet-sound-390");
+ await p.keyboard.press("Escape");
+ await sheet.waitFor({ state: "detached", timeout: 5_000 }).catch(() => {});
+ await p.locator("main").getByRole("button", { name: "Search", exact: true }).first().tap();
+ }
+ const dialog = p.getByRole("dialog", { name: "Search Fuobe" });
+ await dialog.waitFor();
+ await p.keyboard.type("audio");
+ await p.locator('[cmdk-item][data-selected="true"]').first().waitFor();
+ await p.waitForTimeout(500);
+ const hits = await dialog.locator("[cmdk-item]").evaluateAll((els) => els.slice(0, 2).map((e) => e.textContent.trim()));
+ check(/^Audio/.test(hits[0] ?? "") && !hits[0].includes("Clean up voice") && hits[1]?.includes("Clean up voice"), `${label}: search "audio": Audio, then Clean up voice`, hits.join(" | "));
+ await shot(p, `search-audio-${label}`);
+
+ check(errors.length === 0, `${label}: no page errors`, errors.slice(0, 3).join(" | "));
+ await ctx.close();
+}
+
+await browser.close();
+console.log(failures.length ? `\n${failures.length} failed` : "\nAll passed");
+process.exit(failures.length ? 1 : 0);
diff --git a/tests/e2e/composer-flows.mjs b/tests/e2e/composer-flows.mjs
index 67922924..8d7e29a3 100644
--- a/tests/e2e/composer-flows.mjs
+++ b/tests/e2e/composer-flows.mjs
@@ -169,7 +169,7 @@ async function ready(page, url) {
for (const route of [
"/image", "/edit", "/inpaint", "/video", "/lipsync", "/motion-control", "/reframe", "/extend", "/video-edit",
// /audio/translate is the Translate & dub studio (its own steps, no composer); no-horizontal-scroll.mjs covers it.
- "/upscale", "/upscale/video", "/audio", "/audio/dialogue", "/audio/voice-change", "/audio/transcribe", "/audio/sfx", "/audio/music", "/audio/video",
+ "/upscale", "/upscale/video", "/audio/speech", "/audio/dialogue", "/audio/voice-change", "/audio/transcribe", "/audio/sfx", "/audio/music", "/audio/video",
"/video-tools", "/video-tools/relight", "/video-tools/depth", "/video-tools/join", "/video-tools/colors", "/apps/app-face-swap",
]) {
await ready(page, route);
diff --git a/tests/e2e/composer-rows.mjs b/tests/e2e/composer-rows.mjs
index 34fc43f9..3316ac47 100644
--- a/tests/e2e/composer-rows.mjs
+++ b/tests/e2e/composer-rows.mjs
@@ -49,7 +49,7 @@ const STUDIOS = [
"/motion-control",
"/reframe",
"/upscale",
- "/audio",
+ "/audio/speech",
"/audio/dialogue",
"/audio/sfx",
"/video-tools",
diff --git a/tests/e2e/examples-sweep.mjs b/tests/e2e/examples-sweep.mjs
index 2c471eeb..b06d89ca 100644
--- a/tests/e2e/examples-sweep.mjs
+++ b/tests/e2e/examples-sweep.mjs
@@ -47,7 +47,7 @@ for (const r of plan) {
if (!was || r.rank < was.rank) firstBySurface.set(r.surface, r);
}
/** Pages that show "More to try" covers until they have examples of their own. */
-const MORE = ["/video-edit", "/extend", "/reframe", "/lipsync", "/motion-control", "/upscale/video", "/video-tools", "/audio", "/audio/music", "/layers", "/genjutsu", "/katana", "/cinema", "/ads"];
+const MORE = ["/video-edit", "/extend", "/reframe", "/lipsync", "/motion-control", "/upscale/video", "/video-tools", "/audio/speech", "/audio/music", "/layers", "/genjutsu", "/katana", "/cinema", "/ads"];
const targets = [
...[...firstBySurface.values()].map((r) => ({ url: urlOf(r.surface), row: r })),
diff --git a/tests/e2e/instant-tabs.mjs b/tests/e2e/instant-tabs.mjs
index 4b893e16..81b8b261 100644
--- a/tests/e2e/instant-tabs.mjs
+++ b/tests/e2e/instant-tabs.mjs
@@ -120,7 +120,8 @@ const SWITCHES = [
{ hub: "Audio", from: "/audio", tab: "Music", to: "/audio/music" },
{ hub: "Audio", from: "/audio/music", tab: "Translate", to: "/audio/translate" },
{ hub: "Audio", from: "/audio/translate", tab: "Dialogue", to: "/audio/dialogue" },
- { hub: "Audio", from: "/audio/split", tab: "Speech", to: "/audio" },
+ { hub: "Audio", from: "/audio/split", tab: "Speech", to: "/audio/speech" },
+ { hub: "Audio", from: "/audio/music", tab: "Clean up voice", to: "/audio" },
{ hub: "Video tools", from: "/video-tools", tab: "Trim", to: "/video-tools/trim" },
{ hub: "Upscale", from: "/upscale/fps", tab: "Export", to: "/upscale/export" },
{ hub: "Upscale", from: "/upscale/export", tab: "SDR to HDR", to: "/upscale/hdr" },
@@ -222,7 +223,7 @@ try {
const header = page.locator("#content header").first();
const fresh = await header.innerText();
for (const [tab, to] of [
- ["Speech", "/audio"],
+ ["Speech", "/audio/speech"],
["Translate", "/audio/translate"],
["Music", "/audio/music"],
]) {
diff --git a/tests/instant-tabs.test.ts b/tests/instant-tabs.test.ts
index ef4a517e..1c43e8c7 100644
--- a/tests/instant-tabs.test.ts
+++ b/tests/instant-tabs.test.ts
@@ -13,7 +13,8 @@ describe("hub paths", () => {
expect(hubOfPath("/video-tools/trim")).toBe("video-tools");
expect(hubOfPath("/audiobook")).toBeUndefined();
expect(hubOfPath("/image")).toBeUndefined();
- expect(modeOfPath("audio", "/audio")).toBe("speech");
+ expect(modeOfPath("audio", "/audio")).toBe("clean");
+ expect(modeOfPath("audio", "/audio/speech")).toBe("speech");
expect(modeOfPath("audio", "/audio/music")).toBe("music");
expect(modeOfPath("audio", "/audio/nope")).toBeUndefined();
expect(modeOfPath("audio", "/audio/music/more")).toBeUndefined();
diff --git a/tests/nav-bar.test.ts b/tests/nav-bar.test.ts
index 58d354b2..fe22ec7c 100644
--- a/tests/nav-bar.test.ts
+++ b/tests/nav-bar.test.ts
@@ -174,7 +174,7 @@ describe("the launcher's columns", () => {
expect(subs("marketing")).toEqual(["Click to Ad", "Ads Studio", "Ad Multiplier"]);
expect(subs("genjutsu")).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert"]);
expect(subs("upscale")).toEqual(["Image", "Video", "FPS Boost", "SDR to HDR", "Export"]);
- expect(subs("audio")).toEqual(["Dialogue", "Voice change", "Design a voice", "See all 13"]);
+ expect(subs("audio")).toEqual(["Speech", "Dialogue", "Voice change", "See all 13"]);
expect(subs("video-tools")).toEqual(["Relight", "Captions", "Remove object", "See all 10"]);
for (const w of ["Click to Ad", "Ads Studio", "Ad Multiplier", "Motion transfer", "FPS Boost"]) expect(words(html)).toContain(w);
// Under a hairline, quieter than a row, with no picture and no line of their own (nav-subs.css: 24 px
diff --git a/tests/nav-model.test.ts b/tests/nav-model.test.ts
index 85b11b9b..7b63e684 100644
--- a/tests/nav-model.test.ts
+++ b/tests/nav-model.test.ts
@@ -104,10 +104,12 @@ describe("nav model: entries", () => {
it("has unique ids, and unique links apart from a hub's first mode (the hub's own page)", () => {
const ids = NAV_ENTRIES.map((e) => e.id);
expect(new Set(ids).size).toBe(ids.length);
- const firstModes = new Set(Object.entries(HUB_MODES).map(([hub, modes]) => `${hub}-${modes[0].id}`));
+ // Audio's first mode, Clean up voice, has a row in the Sound column: it links its own page (the same tool as /audio).
+ const firstModes = new Set(Object.entries(HUB_MODES).map(([hub, modes]) => `${hub}-${modes[0].id}`).filter((id) => id !== "audio-clean"));
const hrefs = NAV_ENTRIES.filter((e) => !firstModes.has(e.id)).map((e) => e.href);
expect(new Set(hrefs).size).toBe(hrefs.length);
for (const id of firstModes) expect(entry(id)?.href).toBe(`/${entry(id)!.parent}`);
+ expect(entry("audio-clean")?.href).toBe("/audio/clean");
});
it("links only to pages that exist (or a settings section, an action, the source)", () => {
@@ -215,9 +217,9 @@ describe("nav model: launcher", () => {
expect(launcherEntries("guest")).toHaveLength(34);
expect(launcherEntries("guest", "sell").map((e) => e.id)).toEqual(["marketing", "ads", "kinetic", "mixed-media", "moodboards", "photodump"]);
expect(launcherEntries(undefined, "finish").map((e) => e.id)).toEqual(["upscale", "image-to-3d", "apps"]);
- // Sound: the Audio studio, then voice's neighbours (music, sound effects, clean-up, translate & dub); Lipsync stays in Social.
- expect(launcherEntries(undefined, "sound").map((e) => e.href)).toEqual(["/audio", "/audio/music", "/audio/sfx", "/audio/clean", "/audio/translate"]);
- expect(launcherEntries(undefined, "sound").map((e) => e.short)).toEqual(["Audio", "Music", "Sound effects", "Clean up", "Translate"]);
+ // Sound: the Audio studio, then Clean up voice (its first mode), music, sound effects, translate & dub; Lipsync stays in Social.
+ expect(launcherEntries(undefined, "sound").map((e) => e.href)).toEqual(["/audio", "/audio/clean", "/audio/music", "/audio/sfx", "/audio/translate"]);
+ expect(launcherEntries(undefined, "sound").map((e) => e.short)).toEqual(["Audio", "Clean up", "Music", "Sound effects", "Translate"]);
expect(entry("audio-translate")?.label).toBe("Translate & dub");
expect(entry("lipsync")?.group).toBe("social");
for (const e of launcherEntries(undefined)) expect(Object.hasOwn(PRESET_COVERS, e.cover!), `${e.id}: ${e.cover}`).toBe(true);
diff --git a/tests/nav-search.test.ts b/tests/nav-search.test.ts
index 5cc38a73..0dbbf5a8 100644
--- a/tests/nav-search.test.ts
+++ b/tests/nav-search.test.ts
@@ -96,8 +96,10 @@ describe("search by what you want to make", () => {
const first = (q: string) => searchNav(q, GUEST).best[0];
expect(first("music")).toMatchObject({ label: "Music", hint: "Audio", href: "/audio/music" });
expect(first("background music").label).toBe("Music");
- expect(first("voiceover")).toMatchObject({ label: "Speech", hint: "Audio", href: "/audio" });
- expect(first("voice over for my video").href).toBe("/audio");
+ expect(first("voiceover")).toMatchObject({ label: "Speech", hint: "Audio", href: "/audio/speech" });
+ expect(searchNav("voice over for my video", GUEST).best.slice(0, 2).map((h) => h.href)).toContain("/audio/speech");
+ // "audio": the studio, then Clean up voice (the mode it opens on, its highlight).
+ expect(searchNav("audio", GUEST).best.slice(0, 2).map((h) => h.label)).toEqual(["Audio", "Clean up voice"]);
expect(first("sound effect")).toMatchObject({ label: "Sound effects", href: "/audio/sfx" });
expect(first("whoosh").label).toBe("Sound effects");
expect(searchNav("sound", GUEST).best.slice(0, 3).map((h) => h.label)).toEqual(expect.arrayContaining(["Audio", "Sound effects"]));
diff --git a/tests/split-soundtrack.test.ts b/tests/split-soundtrack.test.ts
index 675290a5..ab303669 100644
--- a/tests/split-soundtrack.test.ts
+++ b/tests/split-soundtrack.test.ts
@@ -420,10 +420,9 @@ describe("the mixer", () => {
});
describe("Split soundtrack in the Audio hub", () => {
- it("is a mode after Transcribe and Clean up voice, with its own path", () => {
+ it("is a mode after Transcribe, with its own path", () => {
const ids = HUB_MODES.audio.map((m) => m.id);
- expect(ids.indexOf("split")).toBe(ids.indexOf("clean") + 1);
- expect(ids.indexOf("clean")).toBe(ids.indexOf("transcribe") + 1);
+ expect(ids.indexOf("split")).toBe(ids.indexOf("transcribe") + 1);
expect(HUB_MODES.audio.find((m) => m.id === "split")?.label).toBe("Split soundtrack");
expect(modeHref("audio", "split")).toBe("/audio/split");
});