Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Create scenes empty with + instead of from a composer box

Bitti9911c1cfc0a4
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index b148743..089bbc3 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -3520,6 +3520,36 @@ mod tests {
}
}
+ #[test]
+ fn an_empty_scene_survives_the_round_trip_the_plus_button_creates() {
+ /* The Generator's + adds a scene holding ONE shot with nothing written
+ in it and no words in the mirror — PolStudio writes no line for
+ anyone. Rust writes that file to disk before the frontend ever parses
+ it back, so if this side accepted it and zod did not, the project
+ would save and then fail to open. `createDraftGenerationJob("")`
+ builds exactly this shape. */
+ let mut empty = scene_fixture();
+ let job = &mut empty.generation_jobs[0];
+ job.prompt = String::new();
+ job.creative_brief = String::new();
+ job.reference_ids = Vec::new();
+ job.shots = Some(vec![SceneShot {
+ id: "scene-walk-shot-1".into(),
+ start_seconds: 0.0,
+ action: String::new(),
+ settings: None,
+ }]);
+
+ let normalized = validate_and_normalize_config(empty)
+ .expect("an empty scene is a scene waiting to be written, not an invalid one");
+ let shots = normalized.generation_jobs[0]
+ .shots
+ .as_ref()
+ .expect("one blank shot is still a shot and must not be dropped");
+ assert_eq!(shots.len(), 1);
+ assert_eq!(shots[0].action, "");
+ }
+
#[test]
fn a_scene_is_bounded_to_fifteen_seconds_on_both_the_length_and_the_cuts() {
// The frontend spells this `z.number().min(0).max(15)` on both fields.
diff --git a/src/components/ProjectWorkspace.test.ts b/src/components/ProjectWorkspace.test.ts
index 95b3d3d..18eadad 100644
--- a/src/components/ProjectWorkspace.test.ts
+++ b/src/components/ProjectWorkspace.test.ts
@@ -4,7 +4,7 @@ import { act, cleanup, createEvent, fireEvent, render, screen, waitFor, within }
import { createElement, useEffect, useState } from "react";
import { afterEach, describe, expect, it, vi } from "vitest";
import completeFixture from "../../fixtures/project-v1-complete.json";
-import { compileMiniMaxH3Prompt, createProjectConfig, parseProjectConfig, STORY_TRACK_ID, type ProjectAsset, type ProjectConfig, type ProjectRecord, type TimelineClip } from "../lib/project";
+import { compileMiniMaxH3Prompt, createProjectConfig, parseProjectConfig, sceneShots, STORY_TRACK_ID, UNTITLED_SCENE, type ProjectAsset, type ProjectConfig, type ProjectRecord, type TimelineClip } from "../lib/project";
import { formatDurationTimecode } from "./ProjectWorkspace";
import { ProjectWorkspace } from "./ProjectWorkspace";
import { GeneratorView } from "./workspace/GeneratorView";
@@ -737,21 +737,23 @@ describe("project workspace timecode", () => {
expect(split().title).toBe("Split at playhead");
});
- it("keeps half-written composer text when you visit another tab and come back", async () => {
+ it("keeps a half-written shot line when you visit another tab and come back", async () => {
const config = createProjectConfig({ name: "Ceramic lamp", prompt: "A quiet product film", aspectRatio: "16:9", resolution: "1080p", targetDurationSeconds: 30 });
- const { container } = render(createElement(ProjectWorkspace, {
+ render(createElement(ProjectWorkspace, {
project: { folderPath: "C:\\Ceramic Lamp", config }, initialView: "generator",
onBack: () => undefined, onSave: async () => undefined,
}));
- const composer = () => container.querySelector(".generation-composer textarea") as HTMLTextAreaElement;
- fireEvent.change(composer(), { target: { value: "a slow push across the launch pad" } });
+ const line = () => screen.getByRole("textbox", { name: "What happens in shot 1" }) as HTMLTextAreaElement;
+ fireEvent.change(line(), { target: { value: "a slow push across the launch pad" } });
fireEvent.click(screen.getByRole("button", { name: "Timeline" }));
await screen.findByRole("heading", { name: "Timeline", level: 2 });
fireEvent.click(screen.getByRole("button", { name: "Generator" }));
await screen.findByRole("heading", { name: "Generator" });
- // Switching tabs unmounts the generator. Losing the user's own half-written
- // words is the one thing this app must never do.
- expect(composer().value).toBe("a slow push across the launch pad");
+ /* Switching tabs unmounts the generator. The words are no longer typed into
+ a composer the parent has to hold on its behalf — every keystroke lands on
+ the scene itself, so the project carries them across the trip. Losing the
+ user's own half-written words is the one thing this app must never do. */
+ expect(line().value).toBe("a slow push across the launch pad");
});
it("does not bind an audio-tagged reference a new shot's prompt would drop", () => {
@@ -760,9 +762,8 @@ describe("project workspace timecode", () => {
{ id: "ref-audio", kind: "text", name: "Score idea", description: "Sparse piano.", content: "Sparse piano.", intendedUse: ["audio"], createdAt: fresh.createdAt },
] });
const onChange = vi.fn();
- const { container } = render(createElement(GeneratorView, { config, folderPath: "C:\\Ceramic Lamp", onChange, onOpenTimeline: () => undefined }));
- fireEvent.change(container.querySelector(".generation-composer textarea")!, { target: { value: "a slow push across the pad" } });
- fireEvent.click(screen.getByRole("button", { name: /Save as a draft|Generate/ }));
+ render(createElement(GeneratorView, { config, folderPath: "C:\\Ceramic Lamp", onChange, onOpenTimeline: () => undefined }));
+ fireEvent.click(screen.getByRole("button", { name: "Add a scene" }));
// It would take a binding slot and then be dropped by the compiler, so the
// shot would claim a reference its prompt never mentions.
expect(onChange.mock.calls[0][0].generationJobs[0].referenceIds).toEqual([]);
@@ -777,9 +778,6 @@ describe("project workspace timecode", () => {
});
const { container } = render(createElement(GeneratorView, { config, folderPath: "C:\\Ceramic Lamp", onChange: () => undefined, onOpenTimeline: () => undefined, selectedJobId: fresh.generationJobs[0].id }));
expect(document.querySelector(".job-refs")!.textContent).toContain("The text definition is written into this scene’s prompt.");
- // The composer hint says the same thing about the same references. Scoping
- // this to .job-refs hid a second copy of the claim that was still wrong.
- expect(container.querySelector(".generation-composer__hint")!.textContent).toContain("The text definition is written into the prompt.");
// No image exists anywhere in this project, so NOTHING on the screen may
// claim something is sent to the engine as an asset.
expect(container.textContent).not.toContain("images are sent to the video engine");
@@ -859,13 +857,43 @@ describe("project workspace timecode", () => {
expect(screen.getByRole("complementary", { name: "Scenes" })).not.toBeNull();
expect(container.querySelector(".generator-heading .eyebrow")).toBeNull();
expect(screen.queryByRole("button", { name: "View timeline" })).toBeNull();
- // A new scene is still started from this page, and it says so.
- expect(screen.getByRole("heading", { name: "Start another scene" })).not.toBeNull();
- expect(document.querySelector(".generation-composer__lede")!.textContent).toContain("changing a scene that already exists");
+ /* The composer panel is gone. A new scene is started from the + in the
+ rail, which adds an EMPTY one — nothing on this page turns a sentence
+ into a scene any more, so nothing may advertise that it does. */
+ expect(screen.queryByRole("heading", { name: "Start another scene" })).toBeNull();
+ expect(container.querySelector(".generation-composer")).toBeNull();
+ expect(screen.getByRole("button", { name: "Add a scene" })).not.toBeNull();
unmount();
}
});
+ it("adds an EMPTY scene from the + button — one blank shot, no words this app wrote", () => {
+ const config = lampProject();
+ const onChange = vi.fn();
+ const { rerender } = render(createElement(GeneratorView, { config, folderPath: "C:\\Ceramic Lamp", onChange, onOpenTimeline: () => undefined, selectedJobId: config.generationJobs[0].id }));
+ fireEvent.click(screen.getByRole("button", { name: "Add a scene" }));
+
+ const next = onChange.mock.calls.at(-1)![0];
+ // It goes to the head of the list and does not disturb the scene already there.
+ expect(next.generationJobs).toHaveLength(2);
+ expect(next.generationJobs[1]).toEqual(config.generationJobs[0]);
+ const added = next.generationJobs[0];
+ expect(added.status).toBe("draft");
+ // One shot with nothing in it, and a name that says so rather than a phrase
+ // PolStudio made up out of words the user never typed.
+ expect(sceneShots(added).map((shot) => shot.action)).toEqual([""]);
+ expect(added.title).toBe(UNTITLED_SCENE);
+ expect(added.prompt).toBe("");
+ expect(added.creativeBrief).toBe("");
+ // Both validators have to accept it — Rust writes this to disk before the
+ // frontend ever parses it back (see CLAUDE.md).
+ expect(() => parseProjectConfig(next)).not.toThrow();
+
+ // And it cannot be generated until the user writes a line in it.
+ rerender(createElement(GeneratorView, { config: parseProjectConfig(next), folderPath: "C:\\Ceramic Lamp", onChange, onOpenTimeline: () => undefined, selectedJobId: added.id }));
+ expect(screen.getByText("Write what happens in at least one shot before this scene can be generated.")).not.toBeNull();
+ });
+
it("splits a scene into three shots on the bar, each with its own line and cut", () => {
const config = lampProject();
const onChange = vi.fn();
diff --git a/src/components/ProjectWorkspace.tsx b/src/components/ProjectWorkspace.tsx
index 5cf2b91..5293dcc 100644
--- a/src/components/ProjectWorkspace.tsx
+++ b/src/components/ProjectWorkspace.tsx
@@ -43,9 +43,6 @@ export function ProjectWorkspace({ project, initialView = "timeline", runtime =
const [config, setConfig] = useState(project.config);
const [view, setView] = useState<ProjectView>(initialView);
const [selectedGenerationJobId, setSelectedGenerationJobId] = useState<string | undefined>(project.config.generationJobs[0]?.id);
- /* Switching tabs unmounts the generator, so its composer text lives here.
- Half a shot description used to vanish on a trip to the timeline and back. */
- const [generatorPrompt, setGeneratorPrompt] = useState("");
const [saving, setSaving] = useState(false);
const [dirty, setDirty] = useState(false);
const [saveError, setSaveError] = useState<string | null>(null);
@@ -161,7 +158,7 @@ export function ProjectWorkspace({ project, initialView = "timeline", runtime =
<div className={`project-content project-content--${view}`}>
{view === "timeline" && <TimelineView config={config} folderPath={project.folderPath} onChange={changeConfig} onMeasured={recordMeasurement} onOpenGenerator={(jobId) => { setSelectedGenerationJobId(jobId); setView("generator"); }} />}
- {view === "generator" && <GeneratorView config={config} folderPath={project.folderPath} runtime={runtime?.vidfab ?? null} onChange={changeConfig} selectedJobId={selectedGenerationJobId} onOpenTimeline={() => setView("timeline")} draftPrompt={generatorPrompt} onDraftPromptChange={setGeneratorPrompt} />}
+ {view === "generator" && <GeneratorView config={config} folderPath={project.folderPath} runtime={runtime?.vidfab ?? null} onChange={changeConfig} selectedJobId={selectedGenerationJobId} onOpenTimeline={() => setView("timeline")} />}
{view === "references" && <ReferencesView config={config} folderPath={project.folderPath} onChange={changeConfig} />}
{view === "export" && <ExportView config={config} folderPath={project.folderPath} />}
</div>
diff --git a/src/components/workspace/AgentDock.tsx b/src/components/workspace/AgentDock.tsx
index b7ebde7..5156c26 100644
--- a/src/components/workspace/AgentDock.tsx
+++ b/src/components/workspace/AgentDock.tsx
@@ -34,12 +34,13 @@ export function AgentDock({ context, record, providers, onRecord }: {
// ellipsis (see .agent-dock input in workspace.css). Keep the full sentence
// reachable on hover so nothing that matters is lost to the truncation.
//
- // It used to offer to "generate a shot", which the generator flatly denies a
- // few inches above it: this bar changes a shot that already exists, it does
- // not start one. New shots are made in the generator. Two panels cannot
- // describe the same bar differently, so this one follows that rule.
+ // It may offer to write a scene again: the generator no longer has a box that
+ // turns a sentence into one, and a turn here comes back as a whole mutated
+ // project that PolStudio applies — a new scene included. It still generates
+ // nothing; the scene arrives as a draft the generator renders. Two panels
+ // cannot describe the same bar differently, so the generator says the same.
const placeholder = ready
- ? `Ask Pol to refine ${context}, change a shot you already have, or make an edit…`
+ ? `Ask Pol to write a new scene from a prompt, refine ${context}, or make an edit…`
: blockedDetail ?? "No agent provider is available";
const send = async () => {
diff --git a/src/components/workspace/GeneratorView.tsx b/src/components/workspace/GeneratorView.tsx
index 94d5f85..7ab6c62 100644
--- a/src/components/workspace/GeneratorView.tsx
+++ b/src/components/workspace/GeneratorView.tsx
@@ -2,7 +2,7 @@ import { listen } from "@tauri-apps/api/event";
import { AlertCircle, Ban, Check, ChevronRight, Clock3, FileText, Image as ImageIcon, Info, LoaderCircle, Music2, Play, Plus, RefreshCw, Sparkles, Square, Video, WandSparkles, X } from "lucide-react";
import { useEffect, useMemo, useRef, useState } from "react";
import { isTauri } from "../../lib/persistence";
-import { actionReferenceIds, compileGenerationJobPrompt, compileGenerationJobSegments, compileMiniMaxH3PromptSegments, createDraftGenerationJob, danglingReferenceTokens, sceneDurationSeconds, sceneShots, STORY_TRACK_ID, isReferenceDescribed, isReferenceUsable, isVisualReference, projectItemPath, usableImageReferences, type GenerationJob, type ProjectAsset, type ProjectConfig, type ProjectReference, type PromptSegment, type TimelineClip, type TimelineTrack } from "../../lib/project";
+import { actionReferenceIds, compileGenerationJobPrompt, compileGenerationJobSegments, createDraftGenerationJob, danglingReferenceTokens, sceneDurationSeconds, sceneShots, STORY_TRACK_ID, isReferenceDescribed, isReferenceUsable, isVisualReference, projectItemPath, usableImageReferences, type GenerationJob, type ProjectAsset, type ProjectConfig, type ProjectReference, type PromptSegment, type TimelineClip, type TimelineTrack } from "../../lib/project";
import { cancelVidfabGeneration, enqueueVidfabGeneration, resolveVidfabPlan, type VidfabGenerationRequest, type VidfabStatus } from "../../lib/runtime";
import { ReferenceImage } from "./ReferenceImage";
import { SceneEditor } from "./SceneEditor";
@@ -14,23 +14,13 @@ interface GeneratorViewProps {
onChange: (next: ProjectConfig) => void;
onOpenTimeline: () => void;
selectedJobId?: string;
- /** Composer text, held by the parent. Switching tabs unmounts this view, and
- * keeping the half-written scene in local state threw the user's own words
- * away — the one thing this app is not allowed to do. Optional so the view
- * still works standalone; it falls back to its own state. */
- draftPrompt?: string;
- onDraftPromptChange?: (value: string) => void;
}
type JobStatus = GenerationJob["status"];
-export function GeneratorView({ config, folderPath, runtime = null, onChange, onOpenTimeline, selectedJobId, draftPrompt, onDraftPromptChange }: GeneratorViewProps) {
+export function GeneratorView({ config, folderPath, runtime = null, onChange, onOpenTimeline, selectedJobId }: GeneratorViewProps) {
const [selectedId, setSelectedId] = useState(selectedJobId ?? config.generationJobs.find((job) => job.status === "generating")?.id ?? config.generationJobs[0]?.id);
- const [ownPrompt, setOwnPrompt] = useState("");
- const prompt = draftPrompt ?? ownPrompt;
- const setPrompt: (value: string) => void = onDraftPromptChange ?? setOwnPrompt;
const [planNotes, setPlanNotes] = useState<Record<string, string>>({});
- const composerRef = useRef<HTMLTextAreaElement | null>(null);
const configRef = useRef(config);
configRef.current = config;
const jobs = config.generationJobs;
@@ -49,14 +39,7 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
// taken from the IDs alone told the user a definition was steering the scene
// when the compiled prompt never mentioned it.
const promptRefs = useMemo(() => boundRefs.filter((ref) => isReferenceUsable(ref) && isVisualReference(ref)), [boundRefs]);
- // The references a NEW scene could cite. Both filters, or the hint promises a
- // reference the prompt drops and a legacy audio-only one looks available.
- const usableReferences = useMemo(
- () => config.references.filter((ref) => isReferenceUsable(ref) && isVisualReference(ref)),
- [config.references],
- );
const runtimeReady = runtime?.state === "ready";
- const submitLabel = runtimeReady ? "Generate this scene" : "Save as a draft";
/* Why this scene cannot be sent, or null. Every one of these is a state the
user can see and fix; the button says the reason rather than sitting grey. */
const blocked = selected ? sendBlocker(selected, config.references) : null;
@@ -142,38 +125,41 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
if (runtimeReady) await enqueueVidfabGeneration(requestFor(job), configRef.current);
};
- const createJob = async () => {
- // Never synthesise a prompt: a scene must only ever describe what the user
- // actually typed, or it gets read back to them as their own request.
- const cleanPrompt = prompt.trim();
- if (!cleanPrompt) return;
- // Nothing is auto-bound: which references steer a scene is now decided by
- // writing them into a line, or by the checkbox list. Binding the first two
- // in the library decided that for the user, and often for a scene that
- // never mentioned either of them.
- const draft = createDraftGenerationJob(cleanPrompt);
- const job: GenerationJob = runtimeReady ? { ...draft, status: "queued" } : draft;
- const next = { ...config, generationJobs: [job, ...jobs] };
- onChange(next);
+ /* A scene now starts EMPTY. There is no box that turns a sentence into a
+ scene any more: the + button adds a scene holding one blank shot, and the
+ shots are written in the editor above. PolStudio still writes no line for
+ anyone, so the scene arrives with no words and carries UNTITLED_SCENE as
+ its name rather than a phrase this app made up.
+
+ A scene built FROM a prompt is Pol’s job: the bar along the bottom of the
+ window hands the request to Claude Code or Codex, which returns the whole
+ project with the new scene in it. Nothing is auto-bound either way — which
+ references steer a scene is decided by writing them into a line or by the
+ checkbox list beside it. */
+ const newScene = () => {
+ const job = createDraftGenerationJob("");
+ onChange({ ...config, generationJobs: [job, ...jobs] });
setSelectedId(job.id);
- setPrompt("");
+ };
+
+ const startDraft = async (job: GenerationJob) => {
+ if (!runtimeReady) return;
+ updateJob(job.id, { status: "queued", stage: "queued", error: null, updatedAt: new Date().toISOString() });
try {
+ /* Resolved before the job is handed over, so "What actually happened"
+ reports the real frame count and canvas this run was planned as. The
+ composer used to do this for a scene it had just created; a scene is
+ now created empty and generated from here, so the plan is resolved
+ here or nobody ever sees it. */
const request = requestFor(job);
- const plan = await resolveVidfabPlan(request, next);
+ const plan = await resolveVidfabPlan(request, configRef.current);
setPlanNotes((current) => ({ ...current, [job.id]: `Planned as ${plan.alignedFrames} frames at ${plan.canvasWidth}×${plan.canvasHeight}. ${plan.boundary}` }));
- if (runtimeReady) await enqueueVidfabGeneration(request, next);
- else updateJob(job.id, { error: runtime?.detail ?? "The video engine isn’t available, so this was kept as an editable draft." });
+ await enqueueVidfabGeneration(request, configRef.current);
} catch (reason) {
updateJob(job.id, { error: reason instanceof Error ? reason.message : String(reason) });
}
};
- const startDraft = async (job: GenerationJob) => {
- if (!runtimeReady) return;
- updateJob(job.id, { status: "queued", stage: "queued", error: null, updatedAt: new Date().toISOString() });
- await enqueueVidfabGeneration(requestFor(job), configRef.current);
- };
-
const insertIntoStory = (job: GenerationJob) => {
if (!job.outputRelativePath) return;
const now = new Date().toISOString();
@@ -195,15 +181,6 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
onOpenTimeline();
};
- // "Start another scene" has to be a real control, not advice, so the ready
- // state always has somewhere to go.
- const focusComposer = () => {
- const node = composerRef.current;
- if (!node) return;
- if (typeof node.scrollIntoView === "function") node.scrollIntoView({ block: "center" });
- node.focus();
- };
-
/* Binding order does not matter: requestFor and the compiler both read
config.references in list order and keep whatever this scene names, so the
<Subject N> / <Picture N> numbering stays in lockstep however the boxes are
@@ -227,17 +204,17 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
<span>Scenes</span>
<b>{queueSummary(active.length, queued.length, jobs.length)}</b>
</div>
- {/* A scene is its words, and PolStudio never writes those for anyone —
- so this opens the composer rather than adding an empty scene to the
- list. Same destination as "Start another scene" below. */}
- <button className="queue-panel__new" onClick={focusComposer} aria-label="Describe a new scene" title="Describe a new scene"><Plus size={18} /></button>
+ {/* Adds the scene and leaves it empty. PolStudio still writes no words
+ for anyone — it gives the user somewhere to write them, and the
+ scene keeps the name UNTITLED_SCENE until they rename it. */}
+ <button className="queue-panel__new" onClick={newScene} aria-label="Add a scene" title="Add an empty scene — you write the shots"><Plus size={18} /></button>
</div>
<div className="queue-panel__scroll">
<QueueGroup title="Rendering now" jobs={active} selectedId={selectedId} onSelect={setSelectedId} />
<QueueGroup title="Waiting to render" jobs={queued} selectedId={selectedId} onSelect={setSelectedId} />
<QueueGroup title="Drafts" jobs={drafts} selectedId={selectedId} onSelect={setSelectedId} />
<QueueGroup title="Already run" jobs={completed} selectedId={selectedId} onSelect={setSelectedId} />
- {jobs.length === 0 && <p className="queue-empty">No scenes yet. Describe one in the box on the right and it will appear here.</p>}
+ {jobs.length === 0 && <p className="queue-empty">No scenes yet. Choose + to add an empty one, or ask Pol in the bar along the bottom to build one from a prompt.</p>}
</div>
{/* One line: the headline already IS the status. */}
<div className={`queue-runtime queue-runtime--${runtime?.state ?? "checking"}`}>
@@ -249,7 +226,7 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
<header className="generator-heading">
<div>
<h1>Generator</h1>
- <p>A scene is up to fifteen seconds long and holds as many shots as you split it into. Write what happens in each one; PolStudio turns the whole scene into a single MiniMax H3 prompt you can read before anything is sent.</p>
+ <p>A scene is up to fifteen seconds long and holds as many shots as you split it into. Add one with + and write what happens in each shot, or ask Pol along the bottom to build one from a prompt; PolStudio turns the whole scene into a single MiniMax H3 prompt you can read before anything is sent.</p>
</div>
</header>
@@ -335,6 +312,11 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
<dl className="job-meta">
<div><dt>Video model</dt><dd>MiniMax H3</dd></div>
<div><dt>Scene length</dt><dd>{sceneDurationSeconds(selected).toFixed(1)} seconds, {sceneShots(selected).length === 1 ? "one shot" : `${sceneShots(selected).length} shots`}</dd></div>
+ {/* Project settings, not this scene's — but they decide the frame
+ every scene is rendered into, and the composer's chips were the
+ only place on this screen that said so. */}
+ <div><dt>Shape</dt><dd>{config.settings.aspectRatio}</dd></div>
+ <div><dt>Size</dt><dd>{config.settings.resolution.toUpperCase()}</dd></div>
<div><dt>Where it is</dt><dd>{STATUS_WORD[selected.status]}</dd></div>
<div><dt>Saved to</dt><dd>{selected.outputRelativePath ?? "Nothing saved to disk"}</dd></div>
</dl>
@@ -398,7 +380,12 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
<button className="primary-button" disabled={!runtimeReady || Boolean(blocked)} onClick={() => void startDraft(selected)}>
<WandSparkles size={15} /> {runtimeReady ? (jobs.length === 1 ? "Generate your first scene" : "Generate this scene") : "Can’t generate yet"}
</button>
- {!runtimeReady && <p className="job-actions__note">This draft is saved with your project. PolStudio needs a working video engine before it can render it.</p>}
+ {/* Disclosed at the point of commitment, not after an expensive
+ run. This used to sit under the composer's submit button; the
+ button that actually starts a render is this one. */}
+ {runtimeReady
+ ? <p className="job-actions__limit"><Info size={16} /><span>A finished scene renders frames into memory. PolStudio can’t save them as a video file yet, so nothing lands in your project folder and there is nothing to add to the timeline.</span></p>
+ : <p className="job-actions__note">This draft is saved with your project. PolStudio needs a working video engine before it can render it.</p>}
</>}
{(selected.status === "failed" || selected.status === "cancelled") && <>
@@ -417,8 +404,8 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
<button className="primary-button" disabled={!runtimeReady || Boolean(blocked)} onClick={() => void prepareOrRetry(selected)}>
<RefreshCw size={15} /> {runtimeReady ? "Run this scene again" : "Can’t run it again yet"}
</button>
- <button className="secondary-button" onClick={focusComposer}>
- <Sparkles size={15} /> Start another scene
+ <button className="secondary-button" onClick={newScene}>
+ <Plus size={15} /> Start another scene
</button>
</div>
</>}
@@ -437,75 +424,21 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
</aside>
</section>}
- {/* Where a NEW scene is started. The scene above is where one is written;
- this is only the door onto the next one, which is why it is one line
- and sits at the foot of the page. */}
- <section className="generation-composer" aria-labelledby="start-another-scene">
- <div className="generation-composer__head">
- <h2 className="generation-composer__label" id="start-another-scene"><Sparkles size={17} /> Start another scene</h2>
- <p className="generation-composer__lede">
- One line is enough to open a scene — it becomes its first shot, and you can split the scene and add more above.
- The prompt bar along the bottom of the window is for changing a scene that already exists — it doesn’t start one.
- </p>
- </div>
- <label className="generation-composer__field">
- <span className="generation-composer__sublabel">In your own words</span>
- <textarea
- ref={composerRef}
- value={prompt}
- onChange={(event) => setPrompt(event.target.value)}
- placeholder="Example: hands shaping wet clay on a spinning wheel, the wheel slowing as the rim thins."
- />
- </label>
- {/* Visible before the button is ever pressed: the exact words that go
- to the engine, with the user's own prose marked apart from the
- format PolStudio adds around it. */}
- {prompt.trim().length > 0 && <CompiledPrompt
- segments={compileMiniMaxH3PromptSegments(prompt, [])}
- caption={`Nothing is sent until you choose “${submitLabel}”. A new scene starts with no references; drag one into a line once it exists.`}
- />}
- <div className="generation-composer__foot">
- <div className="generation-settings">
- <span className="generation-settings__lead">A new scene is made as</span>
- <span className="setting-chip"><em>Length</em><b>6 seconds</b></span>
- <span className="setting-chip"><em>Shape</em><b>{config.settings.aspectRatio}</b></span>
- <span className="setting-chip"><em>Size</em><b>{config.settings.resolution.toUpperCase()}</b></span>
- <span className="setting-chip"><em>Model</em><b>MiniMax H3</b></span>
- </div>
- <button className="primary-button generation-composer__submit" onClick={() => void createJob()} disabled={!prompt.trim()}>
- <WandSparkles size={17} /> {submitLabel}
- </button>
- </div>
- {/* Disclosed at the point of commitment, not after an expensive run. */}
- {runtimeReady && <p className="generation-composer__limit">
- <Info size={16} />
- <span>A finished scene renders frames into memory. PolStudio can’t save them as a video file yet, so nothing lands in your project folder and there is nothing to add to the timeline.</span>
- </p>}
- <p className="generation-composer__hint">
- {runtimeReady
- ? "Scenes render one at a time, so a new scene joins the queue behind anything already running."
- : "Nothing renders on this computer yet, so your scene is saved as a draft you can run later."}
- {/* Images are sent as real assets (referencePaths) AND cited as
- <Picture N>; text definitions reach the engine only as prose
- inside <Subject N>. Say exactly that — no more, and only about the
- references actually in hand: the same referenceRouting the scene
- panel uses, so the two places cannot drift apart. */}
- {usableReferences.length > 0
- ? ` ${usableReferences.length === 1 ? "Your reference is" : `Your ${usableReferences.length} references are`} used by a scene once you write ${usableReferences.length === 1 ? "it" : "one"} into one of its lines. ${referenceRouting(usableReferences, "the prompt")}`
- : ""}
- </p>
- </section>
-
+ {/* No scene selected — which, on a new project, means none exists. This
+ is the whole of the "how do I start" advice now that the composer is
+ gone, so it has to name both doors: the button below, and Pol. */}
{!selected && <div className="job-empty">
<span className="job-empty__icon"><Sparkles size={26} /></span>
<h2>Start with one scene</h2>
- <p>Write what should happen on screen in the box above — who or what is in frame, what they do. Then choose “{submitLabel}”.</p>
+ <p>An empty scene is one blank shot waiting for a line. Add one, then write what should happen on screen — who or what is in frame, what they do.</p>
<ul className="job-empty__tips">
<li>A scene can be up to 15 seconds and split into as many shots as you like.</li>
<li>Each shot gets its own line, its own start time and its own settings.</li>
<li>Drag a reference into a line and the prompt cites it as a subject.</li>
<li>You can read the finished prompt before anything is sent.</li>
+ <li>Or ask Pol in the bar along the bottom — Claude Code and Codex can write a whole scene from a prompt.</li>
</ul>
+ <button className="primary-button job-empty__add" onClick={newScene}><Plus size={16} /> Add an empty scene</button>
</div>}
</main>
</div>;
@@ -570,16 +503,16 @@ function QueueGroup({ title, jobs, selectedId, onSelect }: { title: string; jobs
/* Only claim the route the bound references actually take. Saying "images are
sent … text definitions are written into the prompt" for a scene that has only
one of the two describes something that isn't happening. */
-const referenceRouting = (references: ProjectReference[], prompt = "this scene’s prompt"): string => {
+const referenceRouting = (references: ProjectReference[]): string => {
const hasImage = references.some((reference) => reference.kind === "image");
const hasText = references.some((reference) => reference.kind !== "image");
- if (hasImage && hasText) return `Images are sent to the video engine as reference assets; text definitions are written into ${prompt}.`;
+ if (hasImage && hasText) return "Images are sent to the video engine as reference assets; text definitions are written into this scene’s prompt.";
if (hasImage) return references.length === 1
? "The image is sent to the video engine as a reference asset."
: "The images are sent to the video engine as reference assets.";
return references.length === 1
- ? `The text definition is written into ${prompt}.`
- : `The text definitions are written into ${prompt}.`;
+ ? "The text definition is written into this scene’s prompt."
+ : "The text definitions are written into this scene’s prompt.";
};
/* Why a reference that is bound to this scene never reaches its prompt, or null
diff --git a/src/styles/generator.css b/src/styles/generator.css
index cbfeee4..06f95a8 100644
--- a/src/styles/generator.css
+++ b/src/styles/generator.css
@@ -337,127 +337,6 @@
line-height: var(--leading-normal);
}
-/* --- Generation composer --------------------------------------------------- */
-
-.generation-composer {
- max-width: var(--content-max);
- margin: 0 auto var(--space-6);
- padding: var(--space-5);
- border: 1px solid var(--accent-line);
- border-radius: var(--radius-xl);
- background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 10%, var(--panel-2)), var(--panel-2));
- box-shadow: var(--shadow-sm);
-}
-
-.generation-composer__field {
- display: block;
- margin-top: var(--space-4);
-}
-
-.generation-composer__label {
- display: flex;
- align-items: center;
- gap: var(--space-2);
- margin: 0;
- color: var(--text-primary);
- font-size: var(--text-md);
- font-weight: var(--weight-semibold);
- line-height: var(--leading-snug);
-}
-
-.generation-composer__label svg {
- flex: 0 0 auto;
- color: var(--accent-bright);
-}
-
-/* Says which surface authors a shot and which one edits it, at the point where
- the two are easy to confuse. */
-.generation-composer__lede {
- max-width: 78ch;
- margin: var(--space-2) 0 0;
- color: var(--text-secondary);
- font-size: var(--text-sm);
- line-height: var(--leading-normal);
-}
-
-.generation-composer__sublabel {
- display: block;
- margin-bottom: var(--space-2);
- color: var(--text-secondary);
- font-size: var(--text-xs);
- font-weight: var(--weight-semibold);
- line-height: var(--leading-snug);
-}
-
-.generation-composer textarea {
- width: 100%;
- min-height: 128px;
- padding: var(--space-3) var(--space-4);
- resize: vertical;
- border: 1px solid var(--line);
- border-radius: var(--radius-lg);
- color: var(--text-primary);
- background: var(--panel);
- font-family: var(--font-sans);
- font-size: var(--text-base);
- line-height: var(--leading-normal);
-}
-
-.generation-composer textarea:focus-visible {
- border-color: var(--accent);
-}
-
-.generation-composer textarea::placeholder {
- color: var(--text-faint);
-}
-
-.generation-composer__foot {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: space-between;
- gap: var(--space-4);
- margin-top: var(--space-4);
-}
-
-.generation-composer__submit {
- min-height: var(--control-lg);
- flex: 0 0 auto;
- font-size: var(--text-base);
-}
-
-/* Expectation-setting, not an alarm: sits directly under the generate button
- so the limit is known before an expensive render, never after it. */
-
-.generation-composer__limit {
- display: flex;
- align-items: flex-start;
- gap: var(--space-2);
- max-width: 78ch;
- margin: var(--space-4) 0 0;
- padding: var(--space-3) var(--space-4);
- border: 1px solid var(--line);
- border-radius: var(--radius-md);
- color: var(--text-secondary);
- background: var(--panel);
- font-size: var(--text-sm);
- line-height: var(--leading-normal);
-}
-
-.generation-composer__limit svg {
- flex: 0 0 auto;
- margin-top: 2px;
- color: var(--text-muted);
-}
-
-.generation-composer__hint {
- max-width: 78ch;
- margin: var(--space-4) 0 0;
- color: var(--text-muted);
- font-size: var(--text-sm);
- line-height: var(--leading-normal);
-}
-
/* --- The scene editor ------------------------------------------------------
The main control on this screen. The lines the user writes are the largest
@@ -1677,6 +1556,29 @@
line-height: var(--leading-normal);
}
+/* Expectation-setting, not an alarm: sits directly under the generate button
+ so the limit is known before an expensive render, never after it. */
+
+.job-actions__limit {
+ display: flex;
+ align-items: flex-start;
+ gap: var(--space-2);
+ margin: var(--space-3) 0 0;
+ padding: var(--space-3) var(--space-4);
+ border: 1px solid var(--line);
+ border-radius: var(--radius-md);
+ color: var(--text-secondary);
+ background: var(--panel);
+ font-size: var(--text-sm);
+ line-height: var(--leading-normal);
+}
+
+.job-actions__limit svg {
+ flex: 0 0 auto;
+ margin-top: 2px;
+ color: var(--text-muted);
+}
+
/* Shown when the honest answer is "there is no next step here". */
.job-actions__blocked {
@@ -1761,6 +1663,10 @@
line-height: var(--leading-normal);
}
+.job-empty__add {
+ margin-top: var(--space-5);
+}
+
.job-empty__tips li::before {
content: "";
position: absolute;
@@ -1803,14 +1709,6 @@
align-items: flex-start;
}
- .generation-composer__foot {
- flex-direction: column;
- align-items: stretch;
- }
-
- .generation-composer__submit {
- width: 100%;
- }
}
@media (max-width: 1040px) {
@@ -1822,10 +1720,6 @@
padding: var(--space-5) var(--space-4) var(--space-7);
}
- .generation-composer {
- padding: var(--space-4);
- }
-
.job-detail__visual,
.job-detail__info {
padding: var(--space-4);