Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Drop the kind suffix from the seeded track names

Bittif3bb2d101421
diff --git a/fixtures/project-v1-created.json b/fixtures/project-v1-created.json
index fc096fb..a705fc3 100644
--- a/fixtures/project-v1-created.json
+++ b/fixtures/project-v1-created.json
@@ -24,7 +24,7 @@
{
"id": "track-story",
"kind": "video",
- "name": "Track 1, Video",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -32,7 +32,7 @@
{
"id": "track-v2",
"kind": "video",
- "name": "Track 2, Video",
+ "name": "Track 2",
"locked": false,
"muted": false,
"clips": []
@@ -40,7 +40,7 @@
{
"id": "track-a1",
"kind": "audio",
- "name": "Track 1, Audio",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -48,7 +48,7 @@
{
"id": "track-a2",
"kind": "audio",
- "name": "Track 2, Audio",
+ "name": "Track 2",
"locked": false,
"muted": false,
"clips": []
diff --git a/fixtures/project-v1-scene.json b/fixtures/project-v1-scene.json
index d253f2c..8dccc46 100644
--- a/fixtures/project-v1-scene.json
+++ b/fixtures/project-v1-scene.json
@@ -24,7 +24,7 @@
{
"id": "track-story",
"kind": "video",
- "name": "Track 1, Video",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -32,7 +32,7 @@
{
"id": "track-a1",
"kind": "audio",
- "name": "Track 1, Audio",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
diff --git a/fixtures/rust-serialized-created.json b/fixtures/rust-serialized-created.json
index 076dcef..d7431e2 100644
--- a/fixtures/rust-serialized-created.json
+++ b/fixtures/rust-serialized-created.json
@@ -24,7 +24,7 @@
{
"id": "track-story",
"kind": "video",
- "name": "Track 1, Video",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -32,7 +32,7 @@
{
"id": "track-v2",
"kind": "video",
- "name": "Track 2, Video",
+ "name": "Track 2",
"locked": false,
"muted": false,
"clips": []
@@ -40,7 +40,7 @@
{
"id": "track-a1",
"kind": "audio",
- "name": "Track 1, Audio",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -48,7 +48,7 @@
{
"id": "track-a2",
"kind": "audio",
- "name": "Track 2, Audio",
+ "name": "Track 2",
"locked": false,
"muted": false,
"clips": []
diff --git a/fixtures/rust-serialized-initial-reference.json b/fixtures/rust-serialized-initial-reference.json
index b3997a0..214102b 100644
--- a/fixtures/rust-serialized-initial-reference.json
+++ b/fixtures/rust-serialized-initial-reference.json
@@ -24,7 +24,7 @@
{
"id": "track-story",
"kind": "video",
- "name": "Track 1, Video",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -32,7 +32,7 @@
{
"id": "track-v2",
"kind": "video",
- "name": "Track 2, Video",
+ "name": "Track 2",
"locked": false,
"muted": false,
"clips": []
@@ -40,7 +40,7 @@
{
"id": "track-a1",
"kind": "audio",
- "name": "Track 1, Audio",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -48,7 +48,7 @@
{
"id": "track-a2",
"kind": "audio",
- "name": "Track 2, Audio",
+ "name": "Track 2",
"locked": false,
"muted": false,
"clips": []
diff --git a/fixtures/rust-serialized-scene.json b/fixtures/rust-serialized-scene.json
index 0236dd1..6516dab 100644
--- a/fixtures/rust-serialized-scene.json
+++ b/fixtures/rust-serialized-scene.json
@@ -24,7 +24,7 @@
{
"id": "track-story",
"kind": "video",
- "name": "Track 1, Video",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
@@ -32,7 +32,7 @@
{
"id": "track-a1",
"kind": "audio",
- "name": "Track 1, Audio",
+ "name": "Track 1",
"locked": false,
"muted": false,
"clips": []
diff --git a/src/components/ProjectWorkspace.test.ts b/src/components/ProjectWorkspace.test.ts
index f1dbb05..95b3d3d 100644
--- a/src/components/ProjectWorkspace.test.ts
+++ b/src/components/ProjectWorkspace.test.ts
@@ -603,7 +603,7 @@ describe("project workspace timecode", () => {
const onChange = vi.fn();
const onOpenTimeline = vi.fn();
render(createElement(GeneratorView, { config, folderPath: "C:\Ceramic Lamp", onChange, onOpenTimeline, selectedJobId: config.generationJobs[0].id }));
- fireEvent.click(screen.getByRole("button", { name: "Insert into Track 1, Video" }));
+ fireEvent.click(screen.getByRole("button", { name: "Insert into Track 1" }));
const next = onChange.mock.calls[0][0];
expect(next.assets[0].relativePath).toBe("media/generated/first-scene.mp4");
expect(next.timeline.tracks.find((track: { id: string }) => track.id === STORY_TRACK_ID).clips).toHaveLength(1);
diff --git a/src/components/workspace/GeneratorView.tsx b/src/components/workspace/GeneratorView.tsx
index fec5702..94d5f85 100644
--- a/src/components/workspace/GeneratorView.tsx
+++ b/src/components/workspace/GeneratorView.tsx
@@ -186,7 +186,7 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
before the id was fixed, when the track was still called "Story". */
const existingStory = config.timeline.tracks.find((track) => track.id === STORY_TRACK_ID)
?? config.timeline.tracks.find((track) => track.kind === "video" && track.name === "Story");
- const story: TimelineTrack = existingStory ?? { id: STORY_TRACK_ID, kind: "video", name: "Track 1, Video", locked: false, muted: false, clips: [] };
+ const story: TimelineTrack = existingStory ?? { id: STORY_TRACK_ID, kind: "video", name: "Track 1", locked: false, muted: false, clips: [] };
if (story.locked) return;
const startMs = story.clips.reduce((end, clip) => Math.max(end, clip.startMs + clip.durationMs), 0);
const clip: TimelineClip = { id: `clip-${crypto.randomUUID()}`, assetId: asset.id, trackId: story.id, startMs, durationMs: asset.durationMs || lengthMs || 1, sourceStartMs: 0, label: job.title, color: "#4f6ba8", status: "generated" };
@@ -423,7 +423,7 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
</div>
</>}
- {selected.status === "completed" && selected.outputRelativePath && !selected.clipId && <button className="primary-button" onClick={() => insertIntoStory(selected)}><Play size={15} /> Insert into Track 1, Video</button>}
+ {selected.status === "completed" && selected.outputRelativePath && !selected.clipId && <button className="primary-button" onClick={() => insertIntoStory(selected)}><Play size={15} /> Insert into Track 1</button>}
{selected.status === "completed" && selected.clipId && <button className="primary-button" onClick={onOpenTimeline}><Play size={15} /> Open in timeline</button>}
diff --git a/src/components/workspace/TimelineView.tsx b/src/components/workspace/TimelineView.tsx
index 2d0418c..008bd7f 100644
--- a/src/components/workspace/TimelineView.tsx
+++ b/src/components/workspace/TimelineView.tsx
@@ -602,6 +602,11 @@ function TrackRow({ track, duration, selectedId, dropActive, dropBlocked, onSele
onDragLeaveLane: () => void;
onDropLane: (event: React.DragEvent<HTMLDivElement>) => void;
}) {
+ /* The name no longer carries its kind ("Track 1, Video" is now "Track 1"),
+ which the icon and the line under the field already say — but that leaves a
+ video and an audio track both called "Track 1", and a button announced as
+ "Mute Track 1" twice names neither. The controls say which one in full. */
+ const named = `${track.kind === "audio" ? "audio" : "video"} ${track.name}`;
return <>
<div className="track-head">
<span className={`track-kind track-kind--${track.kind}`}>{track.kind === "audio" ? <Music2 size={16} /> : <Video size={16} />}</span>
@@ -612,12 +617,12 @@ function TrackRow({ track, duration, selectedId, dropActive, dropBlocked, onSele
<div><input
className="track-name"
value={track.name}
- aria-label={`Rename ${track.name}`}
+ aria-label={`Rename ${named}`}
title="Rename this track"
onChange={(event) => onRename(track.id, event.target.value || "Untitled track")}
/><small>{track.kind === "audio" ? "Audio" : "Video"}</small></div>
- <button className={track.muted ? "active" : ""} onClick={() => onToggle(track.id, "muted")} aria-label={`${track.muted ? "Unmute" : "Mute"} ${track.name}`} title={`${track.muted ? "Unmute" : "Mute"} ${track.name}`}>{track.muted ? <VolumeX size={16} /> : <Volume2 size={16} />}</button>
- <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>
+ <button className={track.muted ? "active" : ""} onClick={() => onToggle(track.id, "muted")} aria-label={`${track.muted ? "Unmute" : "Mute"} ${named}`} title={`${track.muted ? "Unmute" : "Mute"} ${named}`}>{track.muted ? <VolumeX size={16} /> : <Volume2 size={16} />}</button>
+ <button className={track.locked ? "active" : ""} onClick={() => onToggle(track.id, "locked")} aria-label={`${track.locked ? "Unlock" : "Lock"} ${named}`} title={`${track.locked ? "Unlock" : "Lock"} ${named}`}>{track.locked ? <Lock size={16} /> : <LockOpen size={16} />}</button>
</div>
<div
className={`track-lane ${track.muted ? "muted" : ""} ${dropActive ? "track-lane--drop" : ""} ${dropBlocked ? "track-lane--reject" : ""}`}
diff --git a/src/lib/export.test.ts b/src/lib/export.test.ts
index 97ac656..eb8e581 100644
--- a/src/lib/export.test.ts
+++ b/src/lib/export.test.ts
@@ -44,8 +44,8 @@ const clip = (id: string, trackId: string, startMs: number, durationMs: number,
});
/** A project with the app's own four tracks, `clips` distributed by trackId.
- * `track-story` is "Track 1, Video" — the FIRST video track, and the one that
- * composites over "Track 2, Video" (`track-v2`), because the timeline draws
+ * `track-story` is the video "Track 1" — the FIRST video track, and the one
+ * that composites over the video "Track 2" (`track-v2`), because the timeline draws
* tracks in array order from the top. */
function project(clips: TimelineClip[], assets: ProjectAsset[], overrides: Partial<ProjectConfig["settings"]> = {}): ProjectConfig {
const base = createProjectConfig({
diff --git a/src/lib/project.test.ts b/src/lib/project.test.ts
index d37d08a..da44c06 100644
--- a/src/lib/project.test.ts
+++ b/src/lib/project.test.ts
@@ -82,7 +82,7 @@ describe("project schema", () => {
expect(project.schemaVersion).toBe(1);
// Two video layers over two audio, numbered rather than named after a job:
// the seed says where a track sits, not what the user must put on it.
- expect(project.timeline.tracks.map((track) => track.name)).toEqual(["Track 1, Video", "Track 2, Video", "Track 1, Audio", "Track 2, Audio"]);
+ expect(project.timeline.tracks.map((track) => track.name)).toEqual(["Track 1", "Track 2", "Track 1", "Track 2"]);
expect(project.timeline.tracks.map((track) => track.kind)).toEqual(["video", "video", "audio", "audio"]);
// GeneratorView inserts generated shots by id. Renaming the tracks must
// not move that target off the first video track.
@@ -516,7 +516,7 @@ describe("project schema", () => {
targetDurationSeconds: 34,
}));
expect(project.timeline.tracks).toHaveLength(4);
- expect(project.timeline.tracks.map((track) => track.name)).toEqual(["Track 1, Video", "Track 2, Video", "Track 1, Audio", "Track 2, Audio"]);
+ expect(project.timeline.tracks.map((track) => track.name)).toEqual(["Track 1", "Track 2", "Track 1", "Track 2"]);
// Every demo clip has to land on a track that is actually in the seed.
const trackIds = new Set(project.timeline.tracks.map((track) => track.id));
expect(project.timeline.tracks.flatMap((track) => track.clips).every((clip) => trackIds.has(clip.trackId))).toBe(true);
diff --git a/src/lib/project.ts b/src/lib/project.ts
index 90a5a58..31a4420 100644
--- a/src/lib/project.ts
+++ b/src/lib/project.ts
@@ -987,10 +987,10 @@ export function createProjectConfig(input: CreateProjectInput): ProjectConfig {
cut needs to work at all: something to lay over, and something to lay
under. */
timeline: { tracks: [
- { id: STORY_TRACK_ID, kind: "video", name: "Track 1, Video", locked: false, muted: false, clips: [] },
- { id: "track-v2", kind: "video", name: "Track 2, Video", locked: false, muted: false, clips: [] },
- { id: "track-a1", kind: "audio", name: "Track 1, Audio", locked: false, muted: false, clips: [] },
- { id: "track-a2", kind: "audio", name: "Track 2, Audio", locked: false, muted: false, clips: [] },
+ { id: STORY_TRACK_ID, kind: "video", name: "Track 1", locked: false, muted: false, clips: [] },
+ { id: "track-v2", kind: "video", name: "Track 2", locked: false, muted: false, clips: [] },
+ { id: "track-a1", kind: "audio", name: "Track 1", locked: false, muted: false, clips: [] },
+ { id: "track-a2", kind: "audio", name: "Track 2", locked: false, muted: false, clips: [] },
] },
references: [],
generationJobs: [createDraftGenerationJob(brief, { id: "job-initial-brief", title: "First scene", now })],
@@ -1039,10 +1039,10 @@ export function seedProjectWorkspace(config: ProjectConfig, seed = 0): ProjectCo
brief: { ...config.brief, status: "generating" },
assets,
timeline: { tracks: [
- { id: STORY_TRACK_ID, kind: "video", name: "Track 1, Video", locked: false, muted: false, clips: videoClips },
- { id: "track-v2", kind: "video", name: "Track 2, Video", locked: false, muted: false, clips: [] },
- { id: "track-a1", kind: "audio", name: "Track 1, Audio", locked: false, muted: false, clips: [{ id: "clip-voice", assetId: "asset-voice", trackId: "track-a1", startMs: 1800, durationMs: 28000, sourceStartMs: 0, label: "Mara · narration", color: "#3d817c", status: "approved" }] },
- { id: "track-a2", kind: "audio", name: "Track 2, Audio", locked: false, muted: false, clips: [{ id: "clip-score", assetId: "asset-score", trackId: "track-a2", startMs: 0, durationMs: 34000, sourceStartMs: 0, label: "Glass & concrete", color: "#6b5790", status: "approved" }] },
+ { id: STORY_TRACK_ID, kind: "video", name: "Track 1", locked: false, muted: false, clips: videoClips },
+ { id: "track-v2", kind: "video", name: "Track 2", locked: false, muted: false, clips: [] },
+ { id: "track-a1", kind: "audio", name: "Track 1", locked: false, muted: false, clips: [{ id: "clip-voice", assetId: "asset-voice", trackId: "track-a1", startMs: 1800, durationMs: 28000, sourceStartMs: 0, label: "Mara · narration", color: "#3d817c", status: "approved" }] },
+ { id: "track-a2", kind: "audio", name: "Track 2", locked: false, muted: false, clips: [{ id: "clip-score", assetId: "asset-score", trackId: "track-a2", startMs: 0, durationMs: 34000, sourceStartMs: 0, label: "Glass & concrete", color: "#6b5790", status: "approved" }] },
] },
references,
generationJobs,
diff --git a/src/styles/timeline.css b/src/styles/timeline.css
index 4dbd0e1..7d1c747 100644
--- a/src/styles/timeline.css
+++ b/src/styles/timeline.css
@@ -956,9 +956,9 @@
/* --- Track grid ------------------------------------------------------------ */
.timeline-grid {
- /* Wide enough for the seeded track names ("Track 1, Video") to be read in
- full. At 224px the rename field clipped them to "Track 1, Vi...", which
- reads as a broken name rather than a narrow column. */
+ /* Wide enough for a track name to be read in full beside the kind icon and
+ the two toggles. It was cut to fit the seeded names when those still ended
+ in ", Video"; the room now goes to names the user types. */
--track-column: 256px;
position: relative;
display: grid;