Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Honest empty states, no invented prompts, derived timeline duration

Bitti730a3653ce10
diff --git a/src/App.tsx b/src/App.tsx
index 884cbfa..2a5eece 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -2,7 +2,7 @@ import { BookImage, FolderOpen, Grid2X2, List, Search, Sparkles } from "lucide-r
import { useEffect, useMemo, useRef, useState } from "react";
import { EmptyPlaceholder } from "./components/EmptyPlaceholder";
import { ProjectCard } from "./components/ProjectCard";
-import { ProjectWorkspace } from "./components/ProjectWorkspace";
+import { ProjectWorkspace, type ProjectView } from "./components/ProjectWorkspace";
import { PromptComposer } from "./components/PromptComposer";
import { Sidebar, type WorkspaceView } from "./components/Sidebar";
import { chooseAndOpenProject, createProject, listRecentProjects, saveProject } from "./lib/persistence";
@@ -28,7 +28,7 @@ function App() {
const [view, setView] = useState<WorkspaceView>("library");
const [projects, setProjects] = useState<ProjectRecord[]>([]);
const [activeProject, setActiveProject] = useState<ProjectRecord | null>(null);
- const [activeProjectInitialView, setActiveProjectInitialView] = useState<"timeline" | "generator">("timeline");
+ const [activeProjectInitialView, setActiveProjectInitialView] = useState<ProjectView>("timeline");
const [loading, setLoading] = useState(true);
const [busy, setBusy] = useState(false);
const [query, setQuery] = useState("");
@@ -92,6 +92,16 @@ function App() {
};
const navigate = (nextView: WorkspaceView) => {
+ // Generating and references only exist inside a project. Rather than
+ // dead-ending on a placeholder, open the most recent project on that tab.
+ // With no projects yet, the placeholder is the honest answer.
+ const projectTab = nextView === "generate" ? "generator" : nextView === "references" ? "references" : null;
+ if (projectTab && projects.length > 0) {
+ setActiveProjectInitialView(projectTab);
+ setActiveProject(projects[0]);
+ setView("library");
+ return;
+ }
setActiveProject(null);
setView(nextView);
};
diff --git a/src/components/ProjectWorkspace.test.ts b/src/components/ProjectWorkspace.test.ts
index 233050b..f649d9c 100644
--- a/src/components/ProjectWorkspace.test.ts
+++ b/src/components/ProjectWorkspace.test.ts
@@ -32,7 +32,7 @@ describe("project workspace timecode", () => {
expect(alert.textContent).toContain("The original project file is locked.");
});
- it("creates and selects a draft job from Add or generate a scene", async () => {
+ it("opens the existing unstarted draft instead of duplicating it", async () => {
const config = createProjectConfig({ name: "Ceramic lamp", prompt: "A quiet product film", aspectRatio: "16:9", resolution: "1080p", targetDurationSeconds: 30 });
render(createElement(ProjectWorkspace, {
project: { folderPath: "C:\\Ceramic Lamp", config }, initialView: "timeline",
@@ -40,8 +40,12 @@ describe("project workspace timecode", () => {
}));
fireEvent.click(screen.getByRole("button", { name: "Add or generate a scene" }));
await screen.findByRole("heading", { name: "Generator" });
- expect(screen.getByRole("heading", { name: "New scene draft" })).not.toBeNull();
- expect(screen.getAllByText("DRAFT").length).toBeGreaterThan(0);
+ // A new project already carries one draft made from the user's own words.
+ // "Add or generate a scene" must open that, not stack a second near-identical
+ // shot the user has no way to tell apart.
+ expect(screen.getByRole("heading", { name: "First scene" })).not.toBeNull();
+ expect(screen.queryByRole("heading", { name: "New scene draft" })).toBeNull();
+ expect(screen.getAllByText("DRAFT").length).toBe(1);
});
it("shows a project-specific empty monitor without unrelated demo preview", () => {
diff --git a/src/components/ProjectWorkspace.tsx b/src/components/ProjectWorkspace.tsx
index 237cc38..bcb4950 100644
--- a/src/components/ProjectWorkspace.tsx
+++ b/src/components/ProjectWorkspace.tsx
@@ -71,7 +71,7 @@ export function ProjectWorkspace({ project, initialView = "timeline", onBack, on
<p className={`save-state save-state--${dirty ? "dirty" : "saved"}`} aria-live="polite"><i aria-hidden="true" />{dirty ? "Unsaved changes" : "All changes saved"}</p>
<div className="project-topbar__actions">
{/* Export is not wired to anything yet, so it must not look like a working action. */}
- <button className="secondary-button" type="button" disabled title="Export isn’t available yet. Finished clips are already written into your project folder.">
+ <button className="secondary-button" type="button" disabled title="Export isn’t available yet. Pol Studio can’t save generated shots as video files yet, so there is nothing to export.">
<Download size={16} aria-hidden="true" /> Export <span className="project-topbar__soon">Soon</span>
</button>
<button className="primary-button" onClick={() => void save()} disabled={saving}><Save size={16} aria-hidden="true" /> {saving ? "Saving…" : "Save"}</button>
diff --git a/src/components/workspace/GeneratorView.tsx b/src/components/workspace/GeneratorView.tsx
index 1aa951b..8fdbdab 100644
--- a/src/components/workspace/GeneratorView.tsx
+++ b/src/components/workspace/GeneratorView.tsx
@@ -79,7 +79,10 @@ export function GeneratorView({ config, runtime = null, onChange, onOpenTimeline
};
const createJob = async () => {
- const cleanPrompt = prompt.trim() || `A new scene for ${config.name}.`;
+ // Never synthesise a prompt: a shot 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;
const draft = createDraftGenerationJob(cleanPrompt, { referenceIds: config.references.slice(0, 2).map((ref) => ref.id) });
const job: GenerationJob = runtimeReady ? { ...draft, status: "queued" } : draft;
const next = { ...config, generationJobs: [job, ...jobs] };
@@ -182,7 +185,7 @@ export function GeneratorView({ config, runtime = null, onChange, onOpenTimeline
<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()}>
+ <button className="primary-button generation-composer__submit" onClick={() => void createJob()} disabled={!prompt.trim()}>
<WandSparkles size={17} /> {submitLabel}
</button>
</div>
@@ -195,8 +198,10 @@ export function GeneratorView({ config, runtime = null, onChange, onOpenTimeline
{runtimeReady
? "Shots render one at a time, so a new shot joins the queue behind anything already running."
: "Nothing renders on this computer yet, so your shot is saved as a draft you can run later."}
+ {/* There is no attach control: shots bind the first two references by
+ list order. Say so, rather than implying a choice the user has. */}
{config.references.length > 0
- ? ` ${config.references.length} project ${config.references.length === 1 ? "reference is" : "references are"} available to guide it.`
+ ? ` It will automatically use ${config.references.slice(0, 2).map((ref) => ref.name).join(" and ")}${config.references.length > 2 ? `, the first two of your ${config.references.length} references.` : "."}`
: " No references added yet — add characters, places, or looks to keep shots consistent."}
</p>
</section>
diff --git a/src/components/workspace/ReferencesView.tsx b/src/components/workspace/ReferencesView.tsx
index c49a3d8..e453564 100644
--- a/src/components/workspace/ReferencesView.tsx
+++ b/src/components/workspace/ReferencesView.tsx
@@ -15,9 +15,12 @@ export function ReferencesView({ config, folderPath, onChange }: { config: Proje
const selected = config.references.find((ref) => ref.id === selectedId);
const jobs = useMemo(() => config.generationJobs.filter((job) => job.referenceIds.includes(selectedId ?? "")), [config.generationJobs, selectedId]);
const update = (id: string, patch: Partial<ProjectReference>) => onChange({ ...config, references: config.references.map((ref) => ref.id === id ? { ...ref, ...patch } : ref) });
- const addTextReference = (name = "New definition", description = "Describe the traits Pol should keep consistent across generated clips.") => {
+ // Starts empty on purpose. Seeding it with the instruction text meant an
+ // unedited definition shipped "Describe the traits…" to the model as if the
+ // user had written it. The guidance lives in the field's placeholder instead.
+ const addTextReference = (name = "New definition", description = "") => {
const id = `ref-${Date.now()}`;
- const reference: ProjectReference = { id, kind: "text", name, description, content: description, intendedUse: ["style"], createdAt: new Date().toISOString() };
+ const reference: ProjectReference = { id, kind: "text", name, description, content: description || null, intendedUse: ["style"], createdAt: new Date().toISOString() };
onChange({ ...config, references: [reference, ...config.references] });
setSelectedId(id);
};
@@ -68,7 +71,7 @@ export function ReferencesView({ config, folderPath, onChange }: { config: Proje
</button>)}
<button className="reference-add-card" onClick={() => void addImage()}><span><Plus size={22} /></span><b>Add a reference</b><small>Import an image or write a definition</small></button>
</div>
- <div className="reference-explainer"><Sparkles size={18} /><div><b>References guide generation, not your timeline</b><p>Attach them to any job so characters, products, and art direction stay coherent. All files are copied into the project’s <code>references/</code> folder.</p></div></div>
+ <div className="reference-explainer"><Sparkles size={18} /><div><b>References guide generation, not your timeline</b><p>Every new shot automatically uses the first two references in this list, so characters, products, and art direction stay coherent. Newest additions go to the top. All files are copied into the project’s <code>references/</code> folder.</p></div></div>
</section>
<aside className="reference-inspector">
@@ -77,16 +80,16 @@ export function ReferencesView({ config, folderPath, onChange }: { config: Proje
<div className={`reference-detail-art reference-detail-art--${selected.kind}`}><span>{selected.kind === "image" ? <Image size={30} /> : <Users size={30} />}</span><em>{selected.kind === "image" ? selected.relativePath : "Reusable text definition"}</em></div>
<div className="reference-fields">
<label><span>Name</span><input value={selected.name} onChange={(event) => update(selected.id, { name: event.target.value || "Untitled reference" })} /></label>
- <label><span>Definition</span><textarea value={selected.description} onChange={(event) => update(selected.id, { description: event.target.value || "Add a reference description." })} /></label>
+ <label><span>Definition</span><textarea value={selected.description} placeholder="Describe what should stay consistent — the traits, materials, colours, or wardrobe Pol Studio should preserve across shots." onChange={(event) => update(selected.id, { description: event.target.value, content: event.target.value || null })} /></label>
</div>
<section className="intended-use">
<h3>Intended use</h3>
- <p>Tell Pol what must stay consistent. Tap any that apply.</p>
+ <p>Tell Pol Studio what must stay consistent. Select any that apply.</p>
<div>{uses.map((use) => <button key={use} className={selected.intendedUse.includes(use) ? "active" : ""} aria-pressed={selected.intendedUse.includes(use)} onClick={() => update(selected.id, { intendedUse: selected.intendedUse.includes(use) ? selected.intendedUse.filter((item) => item !== use) : [...selected.intendedUse, use] })}>{selected.intendedUse.includes(use) && <Check size={14} />}{use}</button>)}</div>
</section>
<section className="reference-used-by">
<h3>Used by <span>{jobs.length}</span></h3>
- {jobs.length ? jobs.map((job) => <div key={job.id}><span className={`job-link-dot job-link-dot--${job.status}`} /><div><b>{job.title}</b><small>{job.status} · {job.stage}</small></div><Link2 size={16} /></div>) : <p>No generations use this reference yet. Attach it to a scene in the Generator and Pol will keep it consistent.</p>}
+ {jobs.length ? jobs.map((job) => <div key={job.id}><span className={`job-link-dot job-link-dot--${job.status}`} /><div><b>{job.title}</b><small>{job.status} · {job.stage}</small></div><Link2 size={16} /></div>) : <p>No shots use this reference yet. Each new shot picks up the first two references in this list, so it will be used once it reaches the top two.</p>}
</section>
<section className="portable-path"><BookOpen size={16} /><div><b>Where this lives</b><code>{selected.relativePath ?? "Stored in polstudio.project.json"}</code></div></section>
</> : <div className="reference-empty"><BookOpen size={26} /><b>Select a reference</b><p>Pick one from the library, or add a new one, to edit its definition and see which generations use it.</p></div>}
diff --git a/src/components/workspace/TimelineView.tsx b/src/components/workspace/TimelineView.tsx
index 7076c64..c66c2c8 100644
--- a/src/components/workspace/TimelineView.tsx
+++ b/src/components/workspace/TimelineView.tsx
@@ -6,8 +6,29 @@ import {
import { useEffect, useMemo, useState } from "react";
import { createDraftGenerationJob, type ProjectConfig, type TimelineClip } from "../../lib/project";
-const DURATION = 34_000;
+const MIN_DURATION = 10_000;
const NOT_YET = "Not available yet. This control doesn’t change your project.";
+
+/* The canvas used to be a hard-coded 34s — the seeded fixture's exact length —
+ so a 60-second project still got a 34-second ruler. Derive it from the real
+ content, falling back to the duration the user actually asked for. */
+const canvasDuration = (config: ProjectConfig) => {
+ const lastClipEnd = config.timeline.tracks.reduce(
+ (end, track) => track.clips.reduce((furthest, clip) => Math.max(furthest, clip.startMs + clip.durationMs), end),
+ 0,
+ );
+ return Math.max(lastClipEnd, config.brief.targetDurationSeconds * 1000, MIN_DURATION);
+};
+
+/* Roughly seven labels regardless of length, snapped to a readable interval. */
+const rulerTicks = (durationMs: number) => {
+ const totalSeconds = Math.ceil(durationMs / 1000);
+ const step = [1, 2, 5, 10, 15, 30, 60, 120].find((candidate) => totalSeconds / candidate <= 7) ?? 300;
+ return Array.from({ length: Math.floor(totalSeconds / step) + 1 }, (_, index) => index * step);
+};
+
+const rulerLabel = (seconds: number) =>
+ `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
const timecode = (ms: number) => {
const seconds = Math.floor(ms / 1000);
const frames = Math.floor((ms % 1000) / (1000 / 30));
@@ -27,12 +48,18 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
const sceneClips = tracks.filter((track) => track.kind === "video").flatMap((track) => track.clips);
const hasVisualOutput = config.assets.some((asset) => asset.kind === "video" || asset.kind === "image" || asset.kind === "generated")
|| config.generationJobs.some((job) => Boolean(job.outputRelativePath));
+ const duration = useMemo(() => canvasDuration(config), [config]);
+ const ticks = useMemo(() => rulerTicks(duration), [duration]);
useEffect(() => {
- if (!playing) return;
- const timer = window.setInterval(() => setPlayhead((current) => current >= DURATION ? 0 : current + 100), 100);
+ // Playing an empty timeline would run the clock over nothing, which reads
+ // as playback of footage that does not exist.
+ if (!playing || clipCount === 0) return;
+ const timer = window.setInterval(() => setPlayhead((current) => current >= duration ? 0 : current + 100), 100);
return () => window.clearInterval(timer);
- }, [playing]);
+ }, [playing, clipCount, duration]);
+
+ useEffect(() => { if (clipCount === 0 && playing) setPlaying(false); }, [clipCount, playing]);
const updateTracks = (nextTracks: ProjectConfig["timeline"]["tracks"]) => onChange({ ...config, timeline: { tracks: nextTracks } });
const updateClip = (clipId: string, updates: Partial<TimelineClip>) => updateTracks(tracks.map((track) => ({ ...track, clips: track.clips.map((clip) => clip.id === clipId ? { ...clip, ...updates } : clip) })));
@@ -44,7 +71,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
};
const duplicateSelected = () => {
if (!selected || !selectedTrack || selectedTrack.locked) return;
- const copy = { ...selected, id: `${selected.id}-copy-${Date.now()}`, startMs: Math.min(DURATION - selected.durationMs, selected.startMs + selected.durationMs), label: `${selected.label} copy` };
+ const copy = { ...selected, id: `${selected.id}-copy-${Date.now()}`, startMs: Math.min(duration - selected.durationMs, selected.startMs + selected.durationMs), label: `${selected.label} copy` };
updateTracks(tracks.map((track) => track.id === selected.trackId ? { ...track, clips: [...track.clips, copy] } : track));
setSelectedId(copy.id);
};
@@ -56,7 +83,15 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
setSelectedId(right.id);
};
const addScene = () => {
- const job = createDraftGenerationJob(`A new scene for ${config.name}. ${config.brief.prompt}`, {
+ // A new project already carries an unstarted draft made from the user's own
+ // words. Opening that beats stacking a second near-identical shot they have
+ // no way to tell apart — and it never re-describes their idea back at them.
+ const unstarted = config.generationJobs.find((job) => job.status === "draft");
+ if (unstarted) {
+ onOpenGenerator(unstarted.id);
+ return;
+ }
+ const job = createDraftGenerationJob(config.brief.prompt, {
title: "New scene draft",
referenceIds: config.references.slice(0, 2).map((reference) => reference.id),
});
@@ -67,7 +102,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
return (
<div className="timeline-view" tabIndex={0} onKeyDown={(event) => {
if ((event.key === "Delete" || event.key === "Backspace") && event.target === event.currentTarget) removeSelected();
- if (event.code === "Space" && event.target === event.currentTarget) { event.preventDefault(); setPlaying((value) => !value); }
+ if (event.code === "Space" && event.target === event.currentTarget && clipCount > 0) { event.preventDefault(); setPlaying((value) => !value); }
}}>
{/* The view had no top-level heading at all, so screen-reader users had
no landmark for it. Sighted users already see the project topbar. */}
@@ -87,13 +122,13 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
<span><b>{clip.label.replace(/^\d+ · /, "")}</b><small>{clip.status === "generated" ? "Needs review" : "In timeline"}</small></span>
</button>
))}
- {sceneClips.length === 0 && <p className="panel-hint">No scenes yet. Start with the button below — Pol will draft one from your project brief.</p>}
+ {sceneClips.length === 0 && <p className="panel-hint">No scenes yet. Use the button below to open your shot in the Generator — scenes appear here once they land on the timeline.</p>}
<button className="scene-add" onClick={addScene}><Plus size={18} /> Add or generate a scene</button>
</div>
) : (
<div className="media-grid">
{config.assets.map((asset) => <button key={asset.id}><span className="media-thumb">{asset.kind === "audio" ? <Music2 size={22} /> : asset.kind === "image" ? <ImageIcon size={22} /> : <Video size={22} />}</span><b>{asset.name}</b><small>{asset.kind} · {asset.durationMs ? `${(asset.durationMs / 1000).toFixed(1)}s` : "still"}</small></button>)}
- {config.assets.length === 0 && <p className="panel-hint">No media in this project yet. Scenes you generate are saved here automatically.</p>}
+ {config.assets.length === 0 && <p className="panel-hint">No media in this project yet. Pol Studio can’t save generated shots as files yet, so nothing lands here.</p>}
<button className="media-import" disabled title="Importing your own files isn’t available yet. Generate a scene instead.">
<Upload size={20} /><b>Import media</b><small>Not available yet</small>
</button>
@@ -123,9 +158,11 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
<div className="monitor-transport">
<strong>{timecode(playhead)}</strong>
<div>
- <button onClick={() => setPlayhead(0)} aria-label="Go to beginning" title="Go to beginning"><SkipBack size={18} /></button>
- <button className="play-button" onClick={() => setPlaying((value) => !value)} aria-label={playing ? "Pause" : "Play"} title={playing ? "Pause" : "Play"}>{playing ? <Pause size={18} fill="currentColor" /> : <Play size={18} fill="currentColor" />}</button>
- <button onClick={() => setPlayhead(Math.min(DURATION, playhead + 1000))} aria-label="Step forward one second" title="Step forward one second"><SkipForward size={18} /></button>
+ <button onClick={() => setPlayhead(0)} aria-label="Go to beginning" title="Go to beginning" disabled={clipCount === 0}><SkipBack size={18} /></button>
+ {/* Nothing to play means nothing to play: running the clock over
+ an empty timeline reads as playback of footage that isn't there. */}
+ <button className="play-button" onClick={() => setPlaying((value) => !value)} aria-label={playing ? "Pause" : "Play"} disabled={clipCount === 0} title={clipCount === 0 ? "Nothing to play yet — add or generate a scene first." : playing ? "Pause" : "Play"}>{playing ? <Pause size={18} fill="currentColor" /> : <Play size={18} fill="currentColor" />}</button>
+ <button onClick={() => setPlayhead(Math.min(duration, playhead + 1000))} aria-label="Step forward one second" title="Step forward one second" disabled={clipCount === 0}><SkipForward size={18} /></button>
</div>
<span>{config.settings.resolution.toUpperCase()} · {config.settings.frameRate} fps</span>
</div>
@@ -159,7 +196,9 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
<label className="range-field"><span>Opacity <b>100%</b></span><input type="range" defaultValue="100" disabled title={NOT_YET} /></label>
<label className="range-field"><span>Temperature <b>+4</b></span><input type="range" defaultValue="54" disabled title={NOT_YET} /></label>
</section>
- </> : <div className="inspector-empty"><MouseSelection /><b>Select a clip to edit it</b><span>Pick any clip on the timeline below to rename it, check its timing, and see how it was made.</span></div>}
+ </> : clipCount === 0
+ ? <div className="inspector-empty"><MouseSelection /><b>Nothing to edit yet</b><span>Once a scene lands on the timeline, select it here to rename it and check its timing.</span></div>
+ : <div className="inspector-empty"><MouseSelection /><b>Select a clip to edit it</b><span>Pick any clip on the timeline below to rename it, check its timing, and see how it was made.</span></div>}
</aside>
</div>
@@ -175,18 +214,18 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
</header>
<div className="timeline-grid">
<div className="track-corner"><span>Tracks</span></div>
- <div className="time-ruler" onPointerDown={(event) => { const rect = event.currentTarget.getBoundingClientRect(); setPlayhead(Math.round(Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width)) * DURATION)); }}>
- {[0, 5, 10, 15, 20, 25, 30].map((second) => <span key={second} style={{ left: `${second / 34 * 100}%` }}><i />00:{String(second).padStart(2, "0")}</span>)}
+ <div className="time-ruler" onPointerDown={(event) => { const rect = event.currentTarget.getBoundingClientRect(); setPlayhead(Math.round(Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width)) * duration)); }}>
+ {ticks.map((second) => <span key={second} style={{ left: `${second * 1000 / duration * 100}%` }}><i />{rulerLabel(second)}</span>)}
</div>
- {tracks.map((track) => <TrackRow key={track.id} track={track} selectedId={selectedId} onSelect={setSelectedId} onToggle={toggleTrack} />)}
- <div className="timeline-playhead" style={{ left: `calc(var(--track-column) + (100% - var(--track-column)) * ${playhead / DURATION})` }}><span /><i /></div>
+ {tracks.map((track) => <TrackRow key={track.id} track={track} duration={duration} selectedId={selectedId} onSelect={setSelectedId} onToggle={toggleTrack} />)}
+ <div className="timeline-playhead" style={{ left: `calc(var(--track-column) + (100% - var(--track-column)) * ${playhead / duration})` }}><span /><i /></div>
</div>
</section>
</div>
);
}
-function TrackRow({ track, selectedId, onSelect, onToggle }: { track: ProjectConfig["timeline"]["tracks"][number]; selectedId: string; onSelect: (id: string) => void; onToggle: (id: string, key: "muted" | "locked") => void }) {
+function TrackRow({ track, duration, selectedId, onSelect, onToggle }: { track: ProjectConfig["timeline"]["tracks"][number]; duration: number; selectedId: string; onSelect: (id: string) => void; onToggle: (id: string, key: "muted" | "locked") => void }) {
return <>
<div className="track-head">
<span className={`track-kind track-kind--${track.kind}`}>{track.kind === "audio" ? <Music2 size={16} /> : <Video size={16} />}</span>
@@ -195,7 +234,7 @@ function TrackRow({ track, selectedId, onSelect, onToggle }: { track: ProjectCon
<button className={track.locked ? "active" : ""} onClick={() => onToggle(track.id, "locked")} aria-label={`${track.locked ? "Unlock" : "Lock"} ${track.name}`} title={`${track.locked ? "Unlock" : "Lock"} ${track.name}`}>{track.locked ? <Lock size={16} /> : <LockOpen size={16} />}</button>
</div>
<div className={`track-lane ${track.muted ? "muted" : ""}`}>
- {track.clips.map((clip) => <button key={clip.id} className={`timeline-clip timeline-clip--${track.kind} ${selectedId === clip.id ? "selected" : ""}`} style={{ left: `${clip.startMs / DURATION * 100}%`, width: `${clip.durationMs / DURATION * 100}%`, "--clip-color": clip.color } as React.CSSProperties} onClick={() => onSelect(clip.id)} title={`${clip.label} · ${(clip.durationMs / 1000).toFixed(1)} seconds`}><span className="clip-text"><b>{clip.label}</b><small>{track.kind === "audio" ? "▂▅▃▆▂▃▇▅▂▆▃▅▂" : `${(clip.durationMs / 1000).toFixed(1)}s · ${clip.status}`}</small></span></button>)}
+ {track.clips.map((clip) => <button key={clip.id} className={`timeline-clip timeline-clip--${track.kind} ${selectedId === clip.id ? "selected" : ""}`} style={{ left: `${clip.startMs / duration * 100}%`, width: `${clip.durationMs / duration * 100}%`, "--clip-color": clip.color } as React.CSSProperties} onClick={() => onSelect(clip.id)} title={`${clip.label} · ${(clip.durationMs / 1000).toFixed(1)} seconds`}><span className="clip-text"><b>{clip.label}</b><small>{track.kind === "audio" ? "▂▅▃▆▂▃▇▅▂▆▃▅▂" : `${(clip.durationMs / 1000).toFixed(1)}s · ${clip.status}`}</small></span></button>)}
</div>
</>;
}
diff --git a/src/lib/project.ts b/src/lib/project.ts
index be22bdb..fd1139e 100644
--- a/src/lib/project.ts
+++ b/src/lib/project.ts
@@ -78,7 +78,9 @@ export const projectReferenceSchema = z.object({
id: idSchema,
kind: z.enum(["text", "image"]),
name: z.string().min(1),
- description: z.string().min(1),
+ // May be empty: a reference can exist before the user has described it, and
+ // pre-filling it with instruction text would feed that text to the model.
+ description: z.string(),
content: z.string().min(1).nullable().optional(),
relativePath: projectRelativePathSchema.nullable().optional(),
intendedUse: z.array(z.enum(["character", "product", "location", "style", "audio"])).default([]),
diff --git a/src/styles/timeline.css b/src/styles/timeline.css
index 32bc37b..8ae93a1 100644
--- a/src/styles/timeline.css
+++ b/src/styles/timeline.css
@@ -563,7 +563,8 @@
padding: 0 var(--space-3);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
- outline: 0;
+ /* No outline reset here: the Name field is the only editable control in the
+ inspector, and base.css's :focus-visible ring is its sole focus signal. */
color: var(--text-primary);
background: var(--bg);
font-family: var(--font-sans);