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.

Cinema: the phone Director chip warns when a still needs its camera; plainer chip names

Claude7bb273fd75cf
diff --git a/src/components/cinema/director-panel.tsx b/src/components/cinema/director-panel.tsx
index 2c8df32b..04a38a27 100644
--- a/src/components/cinema/director-panel.tsx
+++ b/src/components/cinema/director-panel.tsx
@@ -581,7 +581,7 @@ export function EmotionChip({ settings, onChange, characters }: { settings: Dire
return (
<Popover>
<PopoverTrigger asChild>
- <DirectorChip icon={Smile} label={chipLabel} active={active.length > 0} aria-label={`${chipLabel}: emotion wheel`}>
+ <DirectorChip icon={Smile} label={chipLabel} active={active.length > 0} aria-label={first ? `Emotions: ${chipLabel}` : "Emotions"}>
{first && <span className="size-2.5 shrink-0 rounded-full" style={{ background: first.color }} />}
</DirectorChip>
</PopoverTrigger>
diff --git a/src/components/cinema/prompt-bar.tsx b/src/components/cinema/prompt-bar.tsx
index c15927c8..094e9da9 100644
--- a/src/components/cinema/prompt-bar.tsx
+++ b/src/components/cinema/prompt-bar.tsx
@@ -150,11 +150,14 @@ function DurationChip({ value, effective, onChange }: { value: number; effective
return (
<Popover>
<PopoverTrigger asChild>
- <button type="button" className={cn(chip, chipIdle)} aria-label={effective && effective !== value ? `Duration: ${value}s ${effective}s, the model makes ${effective}s` : `Duration: ${value}s`}>
- <Clock className="size-3.5" />
+ {/* Named by its content, with the words a screen reader needs hidden from sight: "Duration: 5s, the model makes 6s". */}
+ <button type="button" className={cn(chip, chipIdle)}>
+ <Clock className="size-3.5" aria-hidden />
+ <span className="sr-only">Duration: </span>
{effective && effective !== value ? (
<span>
- <span className="text-muted-foreground line-through">{value}s</span> {effective}s
+ <span className="text-muted-foreground line-through">{value}s</span>
+ <span className="sr-only">, the model makes</span> {effective}s
</span>
) : (
`${value}s`
@@ -566,6 +569,10 @@ export function PromptBar(props: PromptBarProps) {
</>
);
const picks = directorPicks(settings, draft.mode);
+ // A cinematic still needs camera, lens and focal length: the folded chip warns as the Camera chip does.
+ const cameraNeeded = draft.mode === "image" && draft.imageTool === "still" && (!settings.camera || !settings.lens || !settings.focal);
+ // Starts with what the chip shows ("Director 2"), so the spoken name contains the visible one.
+ const directorName = `Director${picks ? `: ${picks} set` : "'s Panel"}${cameraNeeded ? ", camera needed" : ""}`;
return (
<div
@@ -689,9 +696,14 @@ export function PromptBar(props: PromptBarProps) {
title="Director's Panel"
description="Film setup, camera, palette, light and emotion: every shot follows them."
trigger={
- <button type="button" className={cn(chip, picks ? chipOn : chipIdle)} aria-label={picks ? `Director's Panel: ${picks} set` : "Director's Panel"}>
+ <button
+ type="button"
+ className={cn(chip, picks ? chipOn : chipIdle, cameraNeeded && "ring-1 ring-warning/60")}
+ aria-label={directorName}
+ >
<Clapperboard className="size-3.5" /> Director
{picks > 0 && <span className="font-mono text-[11px] tabular-nums">{picks}</span>}
+ {cameraNeeded && <span className="size-1.5 rounded-full bg-warning" aria-hidden />}
</button>
}
>
diff --git a/tests/e2e/cinema-shortcuts.mjs b/tests/e2e/cinema-shortcuts.mjs
index 6ac49625..81439604 100644
--- a/tests/e2e/cinema-shortcuts.mjs
+++ b/tests/e2e/cinema-shortcuts.mjs
@@ -1,5 +1,6 @@
// Cinema Studio keyboard check: ⌘/Ctrl+Enter generates from the prompt bar only — never from a
-// dialog, the side panel or another text field behind which the bar sits.
+// dialog, the side panel or another text field behind which the bar sits. Also: a new project starts
+// named (and says inline when the name is cleared), and a phone folds the Director chips into one.
// Usage: node tests/e2e/cinema-shortcuts.mjs [appUrl] (app must be running; demo mode is fine).
// Exits 1 when a shortcut made a take it shouldn't have (or the prompt bar's didn't make one).
//
@@ -57,7 +58,50 @@ const check = async (label, act, expect) => {
};
const none = (made) => made.length === 0;
+const plain = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(52)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+};
+
try {
+ // A new project starts named, the name selected; cleared, Create says so under the field (no toast, nothing made).
+ await page.goto(`${app}/cinema`, { waitUntil: "load", timeout: 120_000 });
+ const nameBox = page.getByLabel("Project name");
+ // A click before the page hydrates does nothing: press again until the dialog opens.
+ for (let i = 0; i < 30 && !(await nameBox.count()); i++) {
+ await page.getByRole("button", { name: "New project" }).first().click();
+ await nameBox.waitFor({ timeout: 2000 }).catch(() => {});
+ }
+ await page.waitForTimeout(300);
+ const named = await nameBox.evaluate((el) => ({ value: el.value, all: el.selectionStart === 0 && el.selectionEnd === el.value.length }));
+ plain("a new project starts as Untitled project, selected", /^Untitled project( \d+)?$/.test(named.value) && named.all, JSON.stringify(named));
+ const count = (await call("/api/cinema/projects")).items?.length;
+ await nameBox.fill("");
+ await page.getByRole("button", { name: "Create project" }).click();
+ await page.waitForTimeout(500);
+ const inline = await page.getByText("Give the project a name").count();
+ plain("…cleared, Create says so under the field", inline === 1 && (await nameBox.getAttribute("aria-invalid")) === "true" && (await page.locator("[data-sonner-toast]").count()) === 0);
+ plain("…and makes nothing", (await call("/api/cinema/projects")).items?.length === count);
+ await page.keyboard.press("Escape");
+
+ // Phones: one Director chip opens the panel's chips in a sheet; in Image (stills) it warns that the camera is needed.
+ {
+ const phone = await (await browser.newContext({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true })).newPage();
+ await phone.goto(`${app}/cinema/${project.id}`, { waitUntil: "domcontentloaded", timeout: 120_000 });
+ await phone.waitForSelector("text=Your first shot", { timeout: 120_000 });
+ const director = phone.getByRole("button", { name: /^Director/ });
+ plain("phone: the Director chips fold into one chip", (await director.count()) === 1 && !(await phone.getByRole("button", { name: "Camera settings" }).isVisible()));
+ await director.tap();
+ const sheet = phone.getByRole("dialog", { name: "Director's Panel" });
+ await sheet.waitFor({ timeout: 10_000 }).catch(() => {});
+ plain("…which opens them in a sheet", (await sheet.getByRole("button", { name: "Camera settings" }).count()) === 1);
+ await phone.keyboard.press("Escape");
+ await phone.getByRole("radio", { name: "Image" }).first().tap().catch(() => {});
+ await phone.waitForTimeout(500);
+ plain("…and in Image it says the camera is needed", /camera needed/.test((await director.getAttribute("aria-label")) ?? ""), (await director.getAttribute("aria-label")) ?? "");
+ await phone.context().close();
+ }
+
await page.goto(`${app}/cinema/${project.id}`, { waitUntil: "domcontentloaded", timeout: 120_000 });
await page.waitForSelector("text=Your first shot", { timeout: 120_000 });
await page.getByPlaceholder(/Describe your scene/).fill("A lighthouse in a storm");