Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Music Video: six-step project page with one status line, step checklists and approvals at the end of each step (#10305)

[._.]/fbe84a4a073e
diff --git a/client/src/components/musicVideo/AutoReviewPanel.jsx b/client/src/components/musicVideo/AutoReviewPanel.jsx
index b9d3b24794..02c770f6da 100644
--- a/client/src/components/musicVideo/AutoReviewPanel.jsx
+++ b/client/src/components/musicVideo/AutoReviewPanel.jsx
@@ -1,3 +1,4 @@
+import { Link } from 'react-router';
import { useState } from 'react';
import { Bot, Play, Pause, X } from 'lucide-react';
import useProviderModels from '../../hooks/useProviderModels.js';
@@ -140,7 +141,7 @@ export default function AutoReviewPanel({ project, startSec, endSec, rangeValid,
<span className="flex items-center gap-1"><Bot size={12} /> Auto-review{isStartedByAutonomous ? '' : ' (opt-in)'}</span>
{isStartedByAutonomous && (
<span className="text-xs text-port-text-muted font-normal">
- · <a href={project?.id ? `/music-video/${project.id}/setup#mv-autonomous-run` : '#mv-autonomous-run'} className="text-port-accent hover:underline">Started by the autonomous run</a>
+ · <Link to={{ search: '?mvPanel=autopilot', hash: '#mv-autonomous-run' }} className="text-port-accent hover:underline">Started by the autonomous run</Link>
</span>
)}
</span>
diff --git a/client/src/components/musicVideo/AutopilotPanel.jsx b/client/src/components/musicVideo/AutopilotPanel.jsx
index ff65d120cf..8b0cceaefd 100644
--- a/client/src/components/musicVideo/AutopilotPanel.jsx
+++ b/client/src/components/musicVideo/AutopilotPanel.jsx
@@ -1,3 +1,4 @@
+import { Link } from 'react-router';
import { useState } from 'react';
import { Bot, Clapperboard, Pause, Play, X } from 'lucide-react';
import AutomationBriefFields from './AutomationBriefFields.jsx';
@@ -421,7 +422,7 @@ function ProductionSection({ project, production, readiness }) {
<span className="flex items-center gap-1"><Clapperboard size={12} /> Production run{isStartedByAutonomous ? '' : ' (opt-in)'}</span>
{isStartedByAutonomous && (
<span className="text-xs text-port-text-muted font-normal">
- · <a href={project?.id ? `/music-video/${project.id}/setup#mv-autonomous-run` : '#mv-autonomous-run'} className="text-port-accent hover:underline">Started by the autonomous run</a>
+ · <Link to={{ search: '?mvPanel=autopilot', hash: '#mv-autonomous-run' }} className="text-port-accent hover:underline">Started by the autonomous run</Link>
</span>
)}
</span>
diff --git a/client/src/components/musicVideo/BeatTimeline.jsx b/client/src/components/musicVideo/BeatTimeline.jsx
index 880e808dbd..a51c9a63e2 100644
--- a/client/src/components/musicVideo/BeatTimeline.jsx
+++ b/client/src/components/musicVideo/BeatTimeline.jsx
@@ -290,7 +290,7 @@ export default function BeatTimeline({ audioAnalysis, scenes, lyricCues, narrati
</div>
</div>
{narrative.events.length > 0 && <p className="text-xs text-port-text-muted">Narrative event lane · click an event to seek its resolved song frame.</p>}
- {narrative.unresolved.length > 0 && <p role="status" className="text-xs text-port-warning">Rebind {narrative.unresolved.length} unresolved narrative events in Compose.</p>}
+ {narrative.unresolved.length > 0 && <p role="status" className="text-xs text-port-warning">Rebind {narrative.unresolved.length} unresolved narrative events in Make.</p>}
</div>
);
}
diff --git a/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx b/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
index fffec75831..ef8dce3282 100644
--- a/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
+++ b/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
@@ -19,6 +19,11 @@ vi.mock('../../services/apiMusicVideo.js', async (importOriginal) => ({
}));
vi.mock('../../services/apiMediaJobs', () => ({ getMediaJob }));
vi.mock('../ui/Toast', () => ({ default: { success: vi.fn(), error: vi.fn() } }));
+// The Look step also holds the creative direction; it is covered by its own panels' tests.
+vi.mock('./CreativeSetupPanel.jsx', () => ({ default: () => null }));
+vi.mock('./LookReferencesPanel.jsx', () => ({ default: () => null }));
+vi.mock('./VisualSpecPanel.jsx', () => ({ default: () => null }));
+const DRAFTS = { conceptDraft: { value: '', onChange: () => {}, onBlur: () => {} }, styleDraft: { value: '', onChange: () => {}, onBlur: () => {} } };
const emit = async (event, data) => act(async () => { for (const fn of listeners.get(event) || []) fn(data); });
const plan = {
@@ -33,7 +38,7 @@ function Harness({ initial, locked = true }) {
const [value, setValue] = useState(initial);
selectProject = setValue;
const actions = useMusicVideoCastAndSets({ project: value, replaceProject: setValue });
- return <CastSetsStage board={{ project: value, locked, castSets: actions, kickoff: { running: locked }, devArtifacts: { busy: false }, openArtifact: vi.fn(), approveCastAndSets: actions.approve, skipCastAndSets: actions.skip }} />;
+ return <CastSetsStage board={{ project: value, locked, castSets: actions, kickoff: { running: locked }, devArtifacts: { busy: false }, openArtifact: vi.fn(), approveCastAndSets: actions.approve, skipCastAndSets: actions.skip, ...DRAFTS }} />;
}
const stage = (next) => emit('music-video:cast-and-sets', { projectId: next.id, project: next });
const card = (name) => within(screen.getByRole('article', { name }));
@@ -198,7 +203,7 @@ describe('Cast & Sets tab: undo, regenerate and guide import', () => {
const Page = () => {
const [current, setCurrent] = useState(value);
const actions = useMusicVideoCastAndSets({ project: current, replaceProject: setCurrent });
- return <CastSetsStage board={{ project: current, locked: false, castSets: actions, kickoff: { running: false }, devArtifacts: { busy: false }, openArtifact: vi.fn(), approveCastAndSets: actions.approve, skipCastAndSets: actions.skip, ...board }} />;
+ return <CastSetsStage board={{ project: current, locked: false, castSets: actions, kickoff: { running: false }, devArtifacts: { busy: false }, openArtifact: vi.fn(), approveCastAndSets: actions.approve, skipCastAndSets: actions.skip, ...DRAFTS, ...board }} />;
};
return render(<Page />);
};
@@ -268,7 +273,7 @@ describe('Cast & Sets stage before any check-in exists', () => {
it('offers Build and Skip, wired to the start and skip actions', async () => {
const start = vi.fn();
const skip = vi.fn();
- render(<CastSetsStage board={{ project: { id: 'example-project', audioAnalysis: { sections: [{}] } }, locked: false, castSets: { busy: false, start, skip }, kickoff: { running: false }, devArtifacts: { busy: false }, openArtifact: vi.fn() }} />);
+ render(<CastSetsStage board={{ project: { id: 'example-project', audioAnalysis: { sections: [{}] } }, locked: false, castSets: { busy: false, start, skip }, kickoff: { running: false }, devArtifacts: { busy: false }, openArtifact: vi.fn(), ...DRAFTS }} />);
fireEvent.click(screen.getByRole('button', { name: 'Build cast & sets' }));
fireEvent.click(screen.getByRole('button', { name: 'Skip' }));
expect(start).toHaveBeenCalledTimes(1);
diff --git a/client/src/components/musicVideo/stages/ComposeStage.jsx b/client/src/components/musicVideo/CompositionPanel.jsx
similarity index 67%
rename from client/src/components/musicVideo/stages/ComposeStage.jsx
rename to client/src/components/musicVideo/CompositionPanel.jsx
index 1c14cfcd5f..c2f15dc658 100644
--- a/client/src/components/musicVideo/stages/ComposeStage.jsx
+++ b/client/src/components/musicVideo/CompositionPanel.jsx
@@ -1,18 +1,19 @@
-import { RenderFailure } from '../RenderStatusPanel.jsx';
-import GradePanel from '../GradePanel.jsx';
-import TypographyPanel from '../TypographyPanel.jsx';
-import EidoverseVideoPanel from '../EidoverseVideoPanel.jsx';
-import CodeVideoPanel from '../CodeVideoPanel.jsx';
-import DocumentCompositionPanel from '../DocumentCompositionPanel.jsx';
-import { renderStyleLabel } from '../compositionDraft.js';
-import { MUSIC_VIDEO_MEDIA_MODE_LABELS, musicVideoMediaMode } from '../../../../../server/lib/musicVideoMediaPolicy.js';
+import { RenderFailure } from './RenderStatusPanel.jsx';
+import GradePanel from './GradePanel.jsx';
+import TypographyPanel from './TypographyPanel.jsx';
+import EidoverseVideoPanel from './EidoverseVideoPanel.jsx';
+import CodeVideoPanel from './CodeVideoPanel.jsx';
+import DocumentCompositionPanel from './DocumentCompositionPanel.jsx';
+import { renderStyleLabel } from './compositionDraft.js';
+import { MUSIC_VIDEO_MEDIA_MODE_LABELS, musicVideoMediaMode } from '../../../../server/lib/musicVideoMediaPolicy.js';
/**
- * Compose: how the final render is put together — the timed typography and
- * (per render style, a project option chosen in Setup) the code-rendered or
- * composition-document panel. The preview of what this produces is docked beside these panels.
+ * The composition half of Make: how the final render is put together — grade,
+ * timed typography and (per render style, set in Project settings) the
+ * code-rendered or composition-document panel. The preview of what this
+ * produces is docked beside the step.
*/
-export default function ComposeStage({ board }) {
+export default function CompositionPanel({ board }) {
const { project, locked, audioUrl } = board;
const mode = project.composition?.mode;
return (
@@ -22,8 +23,8 @@ export default function ComposeStage({ board }) {
<div className="flex flex-wrap items-center gap-2 text-xs text-port-text-muted">
<span>Render style: <span className="text-port-text">{renderStyleLabel(mode)}</span></span>
<span>Media: <span className="text-port-text">{MUSIC_VIDEO_MEDIA_MODE_LABELS[musicVideoMediaMode(project)]}</span></span>
- <button type="button" onClick={() => board.goToStage('setup', 'mv-setup-options')} className="min-h-[44px] px-1 text-port-accent sm:min-h-0">
- Change in Setup
+ <button type="button" onClick={() => board.openSettings('project')} aria-label="Change render style and media in Project settings" className="min-h-[44px] px-1 text-port-accent sm:min-h-0">
+ Change
</button>
</div>
{mode !== 'document' && (
diff --git a/client/src/components/musicVideo/CompositionPreviewPlayer.jsx b/client/src/components/musicVideo/CompositionPreviewPlayer.jsx
index 29216eed70..8aebf1f07a 100644
--- a/client/src/components/musicVideo/CompositionPreviewPlayer.jsx
+++ b/client/src/components/musicVideo/CompositionPreviewPlayer.jsx
@@ -164,7 +164,7 @@ export default function CompositionPreviewPlayer({ project, audioUrl, seekReques
<div className="space-y-2" aria-label="Composition preview">
{previewError && <p className="text-xs text-port-error" role="alert">{previewError}</p>}
{status && <p className="text-xs text-port-text-muted">{status}</p>}
- <div className={`overflow-hidden rounded border border-port-border bg-black mx-auto ${collapsed ? 'max-lg:hidden' : ''}`}
+ <div className={`overflow-hidden rounded border border-port-border bg-black mx-auto ${collapsed ? 'max-xl:hidden' : ''}`}
style={{ aspectRatio: aspect, maxHeight: '70vh', maxWidth: '100%' }}>
{preview?.html ? (
<iframe ref={iframeRef} title={draft ? 'Composition candidate preview' : 'Composition document preview'} sandbox="allow-scripts" srcDoc={preview.html} className="h-full w-full" />
diff --git a/client/src/components/musicVideo/DevArtifactsPanel.jsx b/client/src/components/musicVideo/DevArtifactsPanel.jsx
index f9c41d256f..7994bc3657 100644
--- a/client/src/components/musicVideo/DevArtifactsPanel.jsx
+++ b/client/src/components/musicVideo/DevArtifactsPanel.jsx
@@ -29,7 +29,7 @@ const GUIDE_MIME_TYPES = ['text/html', 'image/png', 'image/jpeg'];
* navigates to its deep link (`/music-video/:projectId/:stage/dev/:artifactId`),
* which shows it in the viewer drawer.
*
- * `kinds` narrows the list to those artifact kinds (the Cast & Sets tab shows
+ * `kinds` narrows the list to those artifact kinds (the Look step shows
* only its own sheets); without `onUpload` the import control is left out.
* With `onUseAsGuide(artifactId)` each usable sheet or image gets a
* "Use as visual guide" action; `guideId` marks the one already chosen.
diff --git a/client/src/components/musicVideo/LyricTimingCheck.jsx b/client/src/components/musicVideo/LyricTimingCheck.jsx
new file mode 100644
index 0000000000..2d2256f0e6
--- /dev/null
+++ b/client/src/components/musicVideo/LyricTimingCheck.jsx
@@ -0,0 +1,83 @@
+import { useState } from 'react';
+import { lyricSetupState } from '../../lib/musicVideoStages.js';
+
+const EMPTY_DRAFT = { cast: '', environments: '', visualLanguage: '', motionLanguage: '', guideArtifactId: null,
+ lyricsMode: 'vocal', timingStatus: 'provisional', timingNotes: '', storyboard: [] };
+const buttonClass = 'min-h-[44px] rounded border border-port-border bg-port-bg px-3 py-1.5 text-sm disabled:opacity-50 sm:min-h-0';
+
+/**
+ * The Song step's last check: is this a vocal song whose word timings you have
+ * listened to and verified, or an instrumental? It writes the same production
+ * draft fields the storyboard approval reads (`lyricsMode`, `timingStatus`,
+ * `timingNotes`), so the Song step is finished here rather than in a review
+ * panel on another step. A stale verification (the master or the word times
+ * changed) is re-verified through the server's alignment route, which needs a
+ * note. `planning` is the page's unsaved planning draft pair; its copy of these
+ * fields is kept in step so a later planning save cannot undo this one.
+ */
+export default function LyricTimingCheck({ project, review, planning = null, disabled = false }) {
+ const saved = { ...EMPTY_DRAFT, ...(project.productionReview?.draft || {}) };
+ const lyrics = lyricSetupState(project, review.readiness);
+ const [mode, setMode] = useState(saved.lyricsMode === 'instrumental' ? 'instrumental' : 'vocal');
+ const [notes, setNotes] = useState(saved.timingNotes || '');
+ const stale = lyrics.alignment === 'stale';
+ const busy = disabled || review.busy || !review.current;
+ const notesId = `mv-timing-notes-${project.id}`;
+
+ // Keep the page's unsaved planning draft in step with what the server now holds.
+ const syncPlanning = (fields) => { if (planning?.[0]) planning[1]({ ...planning[0], ...fields }); };
+ const write = async (fields) => {
+ if (await review.save({ ...saved, ...fields })) syncPlanning(fields);
+ };
+ const reverify = async () => {
+ const timingNotes = notes.trim();
+ // The alignment route records the verification on the draft server-side.
+ if (await review.reverifyAlignment(timingNotes)) syncPlanning({ timingStatus: 'verified', timingNotes });
+ };
+
+ const verified = mode === 'vocal' ? lyrics.verified && !lyrics.instrumental : lyrics.instrumental && lyrics.verified;
+ return (
+ <div className="space-y-2" id="mv-lyric-timing">
+ <fieldset className="flex flex-wrap gap-3 text-sm">
+ <legend className="sr-only">Song content</legend>
+ <label className="flex min-h-[44px] items-center gap-2 sm:min-h-0">
+ <input type="radio" name={`mv-song-content-${project.id}`} value="vocal" checked={mode === 'vocal'} onChange={() => setMode('vocal')} />
+ Vocal song
+ </label>
+ <label className="flex min-h-[44px] items-center gap-2 sm:min-h-0">
+ <input type="radio" name={`mv-song-content-${project.id}`} value="instrumental" checked={mode === 'instrumental'} onChange={() => setMode('instrumental')} />
+ Instrumental
+ </label>
+ </fieldset>
+ {verified ? (
+ <p role="status" className="text-sm text-port-success">
+ {mode === 'vocal' ? 'Word timing verified against the current master.' : 'Marked instrumental.'}
+ </p>
+ ) : (
+ <>
+ <label htmlFor={notesId} className="block text-xs text-port-text-muted">
+ {mode === 'vocal' ? 'What you checked (needed to re-verify after a change)' : 'Why this song has no lyrics'}
+ </label>
+ <textarea id={notesId} rows={2} maxLength={4000} value={notes} onChange={(e) => setNotes(e.target.value)}
+ className="w-full rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm" />
+ {stale && mode === 'vocal' && (
+ <p role="status" className="text-xs text-port-warning">The master or the word times changed since you verified them. Listen again, then re-verify.</p>
+ )}
+ {mode === 'vocal' ? (
+ <button type="button" className={buttonClass}
+ disabled={busy || lyrics.lines === 0 || (stale && !notes.trim())}
+ onClick={() => (stale ? reverify() : write({ lyricsMode: 'vocal', timingStatus: 'verified', timingNotes: notes.trim() }))}>
+ {stale ? 'Re-verify timing' : 'Mark timing verified'}
+ </button>
+ ) : (
+ <button type="button" className={buttonClass} disabled={busy || !notes.trim()}
+ onClick={() => write({ lyricsMode: 'instrumental', timingNotes: notes.trim() })}>
+ Confirm instrumental
+ </button>
+ )}
+ </>
+ )}
+ {review.error && <p role="alert" className="text-xs text-port-error">{review.error}</p>}
+ </div>
+ );
+}
diff --git a/client/src/components/musicVideo/MusicVideoAutomationNaming.test.jsx b/client/src/components/musicVideo/MusicVideoAutomationNaming.test.jsx
index e1052673b2..c550ababa1 100644
--- a/client/src/components/musicVideo/MusicVideoAutomationNaming.test.jsx
+++ b/client/src/components/musicVideo/MusicVideoAutomationNaming.test.jsx
@@ -3,6 +3,7 @@ import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { render, screen } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
vi.mock('../../services/socket', () => ({
default: { on: vi.fn(), off: vi.fn() },
@@ -95,20 +96,23 @@ describe('Music Video Automation Naming Canonical Conventions (#10166)', () => {
}],
};
render(
- <AutopilotPanel
- project={project}
- production={{ busy: false }}
- readiness={{}}
- onSave={vi.fn()}
- onKickoff={vi.fn()}
- />
+ <MemoryRouter initialEntries={['/music-video/p1/board']}>
+ <AutopilotPanel
+ project={project}
+ production={{ busy: false }}
+ readiness={{}}
+ onSave={vi.fn()}
+ onKickoff={vi.fn()}
+ />
+ </MemoryRouter>
);
expect(screen.queryByText(/Production run \(opt-in\)/)).toBeNull();
expect(screen.getByText('Production run')).toBeInTheDocument();
const link = screen.getByRole('link', { name: 'Started by the autonomous run' });
expect(link).toBeInTheDocument();
- expect(link).toHaveAttribute('href', '/music-video/p1/setup#mv-autonomous-run');
+ // It stays on the open step and opens Project settings › Autopilot at the run log.
+ expect(link).toHaveAttribute('href', '/music-video/p1/board?mvPanel=autopilot#mv-autonomous-run');
});
it('renders Auto-review (opt-in) on Review when not started by autonomous run', () => {
@@ -143,21 +147,24 @@ describe('Music Video Automation Naming Canonical Conventions (#10166)', () => {
}],
};
render(
- <AutoReviewPanel
- project={project}
- startSec={0}
- endSec={5}
- rangeValid={true}
- rendering={false}
- autoReview={{ busy: false }}
- />
+ <MemoryRouter initialEntries={['/music-video/p1/board']}>
+ <AutoReviewPanel
+ project={project}
+ startSec={0}
+ endSec={5}
+ rangeValid={true}
+ rendering={false}
+ autoReview={{ busy: false }}
+ />
+ </MemoryRouter>
);
expect(screen.queryByText(/Auto-review \(opt-in\)/)).toBeNull();
expect(screen.getByText('Auto-review')).toBeInTheDocument();
const link = screen.getByRole('link', { name: 'Started by the autonomous run' });
expect(link).toBeInTheDocument();
- expect(link).toHaveAttribute('href', '/music-video/p1/setup#mv-autonomous-run');
+ // It stays on the open step and opens Project settings › Autopilot at the run log.
+ expect(link).toHaveAttribute('href', '/music-video/p1/board?mvPanel=autopilot#mv-autonomous-run');
});
it('renders "Draft art direction and shots" in Production approvals', () => {
@@ -189,6 +196,7 @@ describe('Music Video Automation Naming Canonical Conventions (#10166)', () => {
project={project}
review={review}
onOpenArtifact={vi.fn()}
+ stage="art"
/>
);
diff --git a/client/src/components/musicVideo/MusicVideoLayout.jsx b/client/src/components/musicVideo/MusicVideoLayout.jsx
index c96176d2bd..06837e3fe8 100644
--- a/client/src/components/musicVideo/MusicVideoLayout.jsx
+++ b/client/src/components/musicVideo/MusicVideoLayout.jsx
@@ -1,97 +1,105 @@
-import { useEffect, useRef, useState } from 'react';
+import { useEffect, useRef } from 'react';
import {
- AlertTriangle, ArrowRight, CheckCircle2, ChevronDown, CircleDot, Clapperboard, Film, History, Layers, LayoutGrid, Music, Play,
- Send, SlidersHorizontal, Users,
+ ArrowRight, Bot, Check, Clapperboard, Film, History, LayoutGrid, Music, Play, Send, Settings, Users,
} from 'lucide-react';
import TabPills from '../ui/TabPills.jsx';
import Pill from '../ui/Pill.jsx';
import { formatUsd } from '../../utils/formatters.js';
-// One icon per stage: the bottom tab bar collapses to icons on a phone, and a
-// repeated glyph would be a repeated destination.
+// One icon per step: the phone's bottom bar collapses to icons, and a repeated
+// glyph would be a repeated destination.
const STAGE_ICONS = {
- setup: SlidersHorizontal, 'cast-sets': Users, board: LayoutGrid, produce: Clapperboard, compose: Layers, review: Film,
- publish: Send,
+ setup: Music, 'cast-sets': Users, board: LayoutGrid, produce: Clapperboard, review: Film, publish: Send,
};
-// The tab bar is the one stage row, so each tab carries its own status mark. The
-// quiet marks (done, in progress) drop out below `lg`, where the bar is icons
-// only; "needs you" always shows.
-const STAGE_TRAILING = {
- done: <CheckCircle2 size={12} className="shrink-0 text-port-success max-lg:hidden" aria-label="done" />,
- active: <CircleDot size={12} className="shrink-0 text-port-accent max-lg:hidden" aria-label="in progress" />,
- blocked: <AlertTriangle size={12} className="shrink-0 text-port-warning" aria-label="needs you" />,
-};
-// Approved earlier, changed since (#10141): shown at every width, like "needs you",
-// because the stage's checklist names what to re-approve.
-const STALE_MARK = <History size={12} className="shrink-0 text-port-warning" aria-label="approved earlier, changed since" />;
// The page's scroll body (the route is full-width, so the page owns its
-// scroll): a new tab scrolls it back to the top.
+// scroll): a new step scrolls it back to the top.
export const MUSIC_VIDEO_SCROLL_ID = 'mv-scroll';
-const STATUS_TONES = { warn: 'text-port-warning', ok: 'text-port-success', muted: 'text-port-text-muted' };
+const TONE_CLASSES = {
+ warn: 'border-port-warning/40 bg-port-warning/10 text-port-warning',
+ ok: 'border-port-success/40 bg-port-success/10 text-port-success',
+ muted: 'border-port-border bg-port-card text-port-text-muted',
+};
-function StatusFacts({ status }) {
- return status.facts.map((fact) => (
- <span key={fact.id} className={`flex items-center gap-2 ${STATUS_TONES[fact.tone] || ''}`}>
- <span aria-hidden="true" className="text-port-text-muted">·</span>{fact.label}
- </span>
- ));
+/**
+ * One state word per step, shared by the step list and the phone's bottom bar:
+ * Done, Changed since approval (an approval whose inputs moved, #10141), Needs
+ * you (stopped, or the step `describeProjectStatus` names as waiting on the
+ * director), In progress, Not started.
+ */
+export function stepState(entry, { needsYouStage = null } = {}) {
+ if (entry.state === 'done' && entry.id !== needsYouStage) return entry.stale ? { word: 'Changed since approval', tone: 'warn' } : { word: 'Done', tone: 'ok' };
+ if (entry.state === 'blocked' || entry.id === needsYouStage) return { word: 'Needs you', tone: 'warn' };
+ if (entry.stale) return { word: 'Changed since approval', tone: 'warn' };
+ if (entry.state === 'active') return { word: 'In progress', tone: 'accent' };
+ return { word: 'Not started', tone: 'muted' };
}
-/** Wide screens show the headline and every fact. A phone shows one tappable line. */
-function ProjectStatusLine({ status }) {
- const [open, setOpen] = useState(false);
- const facts = status.facts || [];
+const WORD_CLASSES = { ok: 'text-port-success', warn: 'text-port-warning', accent: 'text-port-accent', muted: 'text-port-text-muted' };
+const MARK_CLASSES = {
+ ok: 'bg-port-success/20 text-port-success',
+ warn: 'bg-port-warning text-port-on-warning',
+ accent: 'bg-port-accent text-port-on-accent',
+ muted: 'bg-port-border text-port-text-muted',
+};
+
+/** The six steps as a vertical list (md and up): number or check, name, state word and one fact. */
+function StepRail({ stages, stage, onStageChange, needsYouStage, notes }) {
return (
- <>
- <p role="status" aria-label="Project status" className="hidden min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs sm:flex">
- <span className={`font-medium ${STATUS_TONES[status.tone] || ''}`}>{status.headline}</span>
- <StatusFacts status={status} />
- </p>
- <div>
- <button
- type="button"
- className="flex min-h-[44px] w-full min-w-0 items-center gap-1 text-left text-xs sm:hidden"
- aria-expanded={facts.length > 0 ? open : undefined}
- onClick={() => { if (facts.length > 0) setOpen((value) => !value); }}
- >
- <span className={`min-w-0 font-medium ${STATUS_TONES[status.tone] || ''}`}>{status.headline}</span>
- {facts.length > 0 && <ChevronDown size={14} aria-hidden="true" className={`shrink-0 ${open ? 'rotate-180' : ''}`} />}
- </button>
- {open && facts.length > 0 && (
- <p className="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs">
- <StatusFacts status={status} />
- </p>
- )}
- </div>
- </>
+ <nav aria-label="Steps" className="hidden md:block">
+ <ol className="space-y-1">
+ {stages.map((entry, index) => {
+ const state = stepState(entry, { needsYouStage });
+ const selected = entry.id === stage;
+ return (
+ <li key={entry.id}>
+ <button
+ type="button"
+ onClick={() => onStageChange(entry.id)}
+ aria-current={selected ? 'step' : undefined}
+ className={`flex w-full min-h-[44px] items-start gap-2 rounded-lg border px-2 py-2 text-left ${selected ? 'border-port-accent bg-port-accent/10' : 'border-transparent hover:bg-port-card'}`}
+ >
+ <span aria-hidden="true" className={`flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${MARK_CLASSES[state.tone]}`}>
+ {state.word === 'Done' ? <Check size={13} /> : state.word === 'Changed since approval' ? <History size={13} /> : index + 1}
+ </span>
+ <span className="min-w-0">
+ <span className="block text-sm font-medium text-port-text">{entry.label}</span>
+ <span className={`block text-xs ${WORD_CLASSES[state.tone]}`}>{state.word}</span>
+ {notes?.[entry.id] && <span className="block truncate text-xs text-port-text-muted">{notes[entry.id]}</span>}
+ </span>
+ </button>
+ </li>
+ );
+ })}
+ </ol>
+ </nav>
);
}
-// Below `lg` the preview is a mini-player pinned above the bottom tab bar (or
-// the viewport edge once the tab bar is in the header); from `lg` it is a
-// sticky right column that clears the header (the -0.75rem cancels the
-// scroll container's md:p-6, which sticky offsets are measured inside of).
-const DOCK_CLASSES = 'max-lg:fixed max-lg:inset-x-0 max-lg:bottom-0 max-lg:z-30 max-lg:max-h-[70vh] max-lg:overflow-y-auto max-md:bottom-[calc(env(safe-area-inset-bottom)+3rem)] lg:sticky lg:top-[calc(var(--mv-header-h,9rem)-0.75rem)] lg:max-h-[calc(100vh-var(--mv-header-h,9rem)-2rem)] lg:overflow-y-auto';
+// Below `xl` the preview is a mini-player pinned to the bottom (above the
+// phone's step bar); from `xl` it is a sticky right column under the header.
+const DOCK_CLASSES = 'max-xl:fixed max-xl:inset-x-0 max-xl:bottom-0 max-xl:z-30 max-xl:max-h-[70vh] max-xl:overflow-y-auto max-md:bottom-[calc(env(safe-area-inset-bottom)+3rem)] xl:sticky xl:top-[calc(var(--mv-header-h,9rem)-0.75rem)] xl:max-h-[calc(100vh-var(--mv-header-h,9rem)-2rem)] xl:overflow-y-auto';
/**
- * The Music Video project frame: a sticky header (name, track, spend and the
- * one next action for the project's stage), the stage tabs — the single stage
- * row, each tab marking its stage done / in progress / needs you — on top from
- * `md` up, a bottom tab bar on a phone — the active stage's
- * content, and the docked preview player beside it on every tab.
+ * The Music Video project frame. A sticky header says where the project stands
+ * in one line (`status.headline`) beside the one next action, with the spend,
+ * the autopilot control and Project settings. The six steps run down the left
+ * from `md` (a bottom icon bar on a phone), each with its state word and one
+ * fact; the open step shows its title and what "done" means, then its content;
+ * the preview is docked on the right from `xl` (a mini-player below that).
*
* `progress` is `deriveStages(project)`; `nextAction` is `deriveNextAction(…)`;
- * `status` is `describeProjectStatus(…)`, the one "where it stands" line under
- * the name. `attention` is the `NeedsAttentionBanner` element (or null): it sits
- * under that line so a stranded revision, interrupted check-in or unwatched
- * render is visible on every tab, with its Resume/Cancel inline (#9940). `dock` is the `PreviewDock` element (or null when there is nothing
- * to preview).
+ * `status` is `describeProjectStatus(…)`; `notes` is `stepNotes(…)`.
+ * `attention` is the `NeedsAttentionBanner` element (or null): work the server
+ * holds that needs a Resume or Cancel, visible on every step. `autopilot` is
+ * `autopilotStatus(…)` (`{ label, short, tone }`) for the header's Autopilot
+ * button (or null to hide it);
+ * `onOpenSettings(tab)` opens Project settings. `dock` is the `PreviewDock`.
*/
export default function MusicVideoLayout({
project, trackLabel, stage, onStageChange, progress, nextAction, onNextAction, spend, status = null,
- attention = null, dock, projectPanels, children,
+ attention = null, dock = null, notes = null, autopilot = null, onOpenSettings = null, children,
}) {
const headerRef = useRef(null);
const rootRef = useRef(null);
@@ -109,7 +117,7 @@ export default function MusicVideoLayout({
return () => observer.disconnect();
}, []);
- // A new tab starts at its top, not wherever the last one was scrolled to.
+ // A new step starts at its top, not wherever the last one was scrolled to.
const shownStage = useRef(stage);
useEffect(() => {
if (shownStage.current === stage) return;
@@ -117,34 +125,51 @@ export default function MusicVideoLayout({
document.getElementById(MUSIC_VIDEO_SCROLL_ID)?.scrollTo?.({ top: 0 });
}, [stage]);
- const tabs = progress.stages.map((entry) => ({
- id: entry.id,
- label: entry.label,
- icon: STAGE_ICONS[entry.id],
- trailing: entry.state !== 'blocked' && entry.stale ? STALE_MARK : STAGE_TRAILING[entry.state] || null,
- }));
+ const needsYouStage = status?.needsYouStage || null;
+ const tabs = progress.stages.map((entry) => {
+ const state = stepState(entry, { needsYouStage });
+ return {
+ id: entry.id,
+ label: entry.label,
+ icon: STAGE_ICONS[entry.id],
+ // The phone bar is icons only: the state word rides along for screen readers, a dot marks "needs you".
+ trailing: (
+ <>
+ <span className="sr-only">, {state.word}</span>
+ {state.tone === 'warn' && <span aria-hidden="true" className="h-1.5 w-1.5 shrink-0 rounded-full bg-port-warning" />}
+ </>
+ ),
+ };
+ });
const showSpend = spend.spentUsd > 0 || spend.capUsd > 0;
const stageEntry = progress.stages.find((entry) => entry.id === stage);
- const ActionIcon = nextAction?.kind === 'goto' ? ArrowRight : Play;
+ // Play runs something; an arrow goes somewhere (a step, or a Project settings tab).
+ const ActionIcon = nextAction?.kind === 'run' ? Play : ArrowRight;
return (
- <div ref={rootRef} className={`space-y-3 ${dockVisible ? 'max-lg:pb-[calc(10rem+env(safe-area-inset-bottom))]' : 'max-md:pb-[calc(5rem+env(safe-area-inset-bottom))]'}`}>
+ <div ref={rootRef} className={`space-y-3 ${dockVisible ? 'max-xl:pb-[calc(10rem+env(safe-area-inset-bottom))]' : 'max-md:pb-[calc(5rem+env(safe-area-inset-bottom))]'}`}>
<header
ref={headerRef}
- className="sticky top-[calc(env(safe-area-inset-top)-1rem)] z-30 -mx-4 -mt-4 space-y-2 border-b border-port-border bg-port-bg px-4 pt-2 md:top-[calc(env(safe-area-inset-top)-1.5rem)] md:-mx-6 md:-mt-6 md:px-6"
+ className="sticky top-[calc(env(safe-area-inset-top)-1rem)] z-30 -mx-4 -mt-4 space-y-2 border-b border-port-border bg-port-bg px-4 py-2 md:top-[calc(env(safe-area-inset-top)-1.5rem)] md:-mx-6 md:-mt-6 md:px-6"
>
- <div className="flex min-w-0 flex-wrap items-center gap-3">
- <h2 className="min-w-0 flex-1 basis-full truncate text-lg font-semibold max-sm:whitespace-normal max-sm:break-words sm:basis-auto" title={project.name}>{project.name}</h2>
- <span className="flex min-w-0 items-center gap-1 text-xs text-port-text-muted max-sm:hidden">
- <Music size={12} className="shrink-0" aria-hidden="true" />
- <span className="truncate">{trackLabel}</span>
- </span>
- {showSpend && (
- <Pill size="xs" tone={spend.capUsd != null && spend.spentUsd >= spend.capUsd ? 'warning' : 'muted'}>
- <span title={`Paid generation used, against the cap. Autopilot ${formatUsd(spend.autopilot ?? 0)} · manual takes ${formatUsd(spend.manual ?? 0)} · auto-review ${formatUsd(spend.autoReview ?? 0)} (estimates)`}>
- {formatUsd(spend.spentUsd)}{spend.capUsd != null ? ` / ${formatUsd(spend.capUsd)}` : ' · no cap'}
- </span>
- </Pill>
+ <div className="flex min-w-0 flex-wrap items-center gap-2">
+ <div className="min-w-0 flex-1 basis-full sm:basis-auto">
+ <h2 className="truncate text-lg font-semibold max-sm:whitespace-normal max-sm:break-words" title={project.name}>{project.name}</h2>
+ <p className="flex min-w-0 items-center gap-1 text-xs text-port-text-muted">
+ <span>v{project.version || 1}</span>
+ {trackLabel && (
+ <>
+ <span aria-hidden="true">·</span>
+ <Music size={12} className="shrink-0" aria-hidden="true" />
+ <span className="truncate">{trackLabel}</span>
+ </>
+ )}
+ </p>
+ </div>
+ {status && (
+ <p role="status" aria-label="Project status" className={`flex min-h-[36px] min-w-0 items-center rounded-lg border px-2.5 text-sm font-medium ${TONE_CLASSES[status.tone] || TONE_CLASSES.muted}`}>
+ {status.headline}
+ </p>
)}
{nextAction && (
<button
@@ -153,20 +178,49 @@ export default function MusicVideoLayout({
disabled={nextAction.disabled}
title={nextAction.reason}
aria-label={nextAction.label}
- className="flex min-h-[44px] shrink-0 items-center gap-1 rounded bg-port-accent px-2 text-xs text-white disabled:opacity-50 sm:min-h-0 sm:px-3 sm:py-1.5 sm:text-sm"
+ className="flex min-h-[44px] shrink-0 items-center gap-1 rounded-lg bg-port-accent px-3 text-sm font-medium text-white disabled:opacity-50"
>
<ActionIcon size={14} aria-hidden="true" />
<span className="sm:hidden">{nextAction.shortLabel || nextAction.label}</span>
<span className="hidden sm:inline">{nextAction.label}</span>
</button>
)}
+ {autopilot && onOpenSettings && (
+ <button
+ type="button"
+ onClick={() => onOpenSettings('autopilot')}
+ aria-label={autopilot.label}
+ className={`flex min-h-[44px] shrink-0 items-center gap-1 rounded-lg border px-2.5 text-sm ${autopilot.tone === 'warn' ? 'border-port-warning/50 text-port-warning' : 'border-port-border text-port-text'}`}
+ >
+ <Bot size={15} aria-hidden="true" />
+ <span className="sm:hidden">{autopilot.short || autopilot.label}</span>
+ <span className="hidden sm:inline">{autopilot.label}</span>
+ </button>
+ )}
+ {showSpend && (
+ <Pill size="xs" tone={spend.capUsd != null && spend.spentUsd >= spend.capUsd ? 'warning' : 'muted'}>
+ <span title={`Paid generation used, against the cap. Autopilot ${formatUsd(spend.autopilot ?? 0)} · manual takes ${formatUsd(spend.manual ?? 0)} · auto-review ${formatUsd(spend.autoReview ?? 0)} (estimates)`}>
+ {formatUsd(spend.spentUsd)}{spend.capUsd != null ? ` / ${formatUsd(spend.capUsd)}` : ' · no cap'}
+ </span>
+ </Pill>
+ )}
+ {onOpenSettings && (
+ <button
+ type="button"
+ onClick={() => onOpenSettings('project')}
+ aria-label="Project settings"
+ title="Project settings"
+ className="flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-lg border border-port-border text-port-text-muted hover:text-port-text"
+ >
+ <Settings size={16} aria-hidden="true" />
+ </button>
+ )}
</div>
- {status && <ProjectStatusLine status={status} />}
{nextAction?.disabled && nextAction.reason && <p role="status" className="text-xs text-port-text-muted">{nextAction.reason}</p>}
{attention}
<nav
- aria-label="Stages"
- className="max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:z-40 max-md:border-t max-md:border-port-border max-md:bg-port-bg max-md:pb-[env(safe-area-inset-bottom)]"
+ aria-label="Steps"
+ className="md:hidden max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:z-40 max-md:border-t max-md:border-port-border max-md:bg-port-bg max-md:pb-[env(safe-area-inset-bottom)]"
>
<TabPills
tabs={tabs}
@@ -176,27 +230,31 @@ export default function MusicVideoLayout({
size="sm"
stretch
mobileCompact
- ariaLabel="Music video stages"
+ ariaLabel="Music video steps"
controlsIdPrefix="mv-stage"
/>
</nav>
</header>
- <div className={`grid items-start gap-4 ${dockVisible ? 'lg:grid-cols-[minmax(0,1fr)_minmax(20rem,26rem)]' : ''}`}>
+ <div className={`grid items-start gap-4 md:grid-cols-[13rem_minmax(0,1fr)] ${dockVisible ? 'xl:grid-cols-[13rem_minmax(0,1fr)_minmax(20rem,24rem)]' : ''}`}>
+ <div className="md:sticky md:top-[calc(var(--mv-header-h,9rem)-0.75rem)]">
+ <StepRail stages={progress.stages} stage={stage} onStageChange={onStageChange} needsYouStage={needsYouStage} notes={notes} />
+ </div>
+ {/* Labelled by its own heading: from md the phone tab bar is hidden and the step list drives it. */}
<div
role="tabpanel"
id={`mv-stage-${stage}`}
- aria-labelledby={`tab-${stage}`}
+ aria-labelledby={`mv-step-title-${stage}`}
className="min-w-0 space-y-3"
>
- <h3 className="text-base font-semibold">{stageEntry?.title || stageEntry?.label}</h3>
+ <div className="space-y-0.5">
+ <h3 id={`mv-step-title-${stage}`} className="text-xl font-semibold">{stageEntry?.title || stageEntry?.label}</h3>
+ {stageEntry?.doneWhen && <p className="text-sm text-port-text-muted">{stageEntry.doneWhen}</p>}
+ </div>
{children}
</div>
{dockVisible ? <div className={DOCK_CLASSES}>{dock}</div> : null}
</div>
- {/* Shared run/review forms stay mounted, but never obscure the stage
- selected from the phone's bottom navigation. */}
- {projectPanels}
</div>
);
}
diff --git a/client/src/components/musicVideo/MusicVideoLayout.test.jsx b/client/src/components/musicVideo/MusicVideoLayout.test.jsx
index 74aa96b099..718c8dd8c5 100644
--- a/client/src/components/musicVideo/MusicVideoLayout.test.jsx
+++ b/client/src/components/musicVideo/MusicVideoLayout.test.jsx
@@ -1,55 +1,90 @@
-import { describe, expect, it } from 'vitest';
-import { render, screen, within } from '@testing-library/react';
-import MusicVideoLayout from './MusicVideoLayout.jsx';
+import { describe, expect, it, vi } from 'vitest';
+import { fireEvent, render, screen, within } from '@testing-library/react';
+import MusicVideoLayout, { stepState } from './MusicVideoLayout.jsx';
import { MUSIC_VIDEO_STAGES } from '../../lib/musicVideoStages.js';
-describe('music-video stage navigation', () => {
- it('renders one stage row: the tabs carry the status marks, with no separate progress strip', () => {
- const states = ['done', 'active', 'blocked', 'todo', 'todo', 'todo', 'todo'];
- render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project' }} stage="cast-sets" trackLabel="Example Track"
- onStageChange={() => {}} progress={{ current: 'cast-sets', stages: MUSIC_VIDEO_STAGES.map((stage, i) => ({ ...stage, state: states[i] })) }}
+// Both the step list (md+) and the phone icon bar are "Steps"; only one shows at a time.
+const stepNavs = () => screen.getAllByRole('navigation', { name: 'Steps' });
+const rail = () => stepNavs().find((nav) => nav.querySelector('ol'));
+const phoneBar = () => stepNavs().find((nav) => nav.querySelector('[role="tablist"]'));
+const progressFor = (current, states = {}) => ({
+ current, stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: states[stage.id] || (stage.id === current ? 'active' : 'todo') })),
+});
+
+describe('music-video step navigation', () => {
+ it('lists the six steps with a state word and one fact each, and opens a step on click', () => {
+ const onStageChange = vi.fn();
+ render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project', version: 2 }} stage="board" trackLabel="Example Track"
+ onStageChange={onStageChange} progress={progressFor('board', { setup: 'done', 'cast-sets': 'done' })}
+ status={{ headline: 'Step 3 of 6: Storyboard needs you', tone: 'warn', needsYouStage: 'board' }}
+ notes={{ setup: '4:40 · 70 lyric lines', board: '26 shots' }}
spend={{ spentUsd: 3, capUsd: 10 }} />);
- expect(screen.queryByRole('list', { name: 'Progress' })).not.toBeInTheDocument();
- const tabs = within(screen.getByRole('navigation', { name: 'Stages' })).getAllByRole('tab');
- expect(tabs).toHaveLength(MUSIC_VIDEO_STAGES.length);
- expect(within(tabs[0]).getByLabelText('done')).toBeInTheDocument();
- expect(within(tabs[1]).getByLabelText('in progress')).toBeInTheDocument();
- expect(within(tabs[2]).getByLabelText('needs you')).toBeInTheDocument();
- // The track and spend chips survive the strip's removal.
+ expect(stepNavs()).toHaveLength(2);
+ const steps = within(rail()).getAllByRole('button');
+ expect(steps.map((step) => step.textContent)).toEqual([
+ 'Song' + 'Done' + '4:40 · 70 lyric lines',
+ 'Look' + 'Done',
+ '3Storyboard' + 'Needs you' + '26 shots',
+ '4Make' + 'Not started',
+ '5Final render' + 'Not started',
+ '6Publish' + 'Not started',
+ ]);
+ expect(steps[2]).toHaveAttribute('aria-current', 'step');
+ fireEvent.click(steps[3]);
+ expect(onStageChange).toHaveBeenCalledWith('produce');
+ // The phone bar says each state to screen readers, since it shows only icons.
+ expect(within(phoneBar()).getAllByRole('tab').map((tab) => tab.textContent)).toEqual([
+ 'Song, Done', 'Look, Done', 'Storyboard, Needs you', 'Make, Not started', 'Final render, Not started', 'Publish, Not started',
+ ]);
+ // The step names what "done" means under its title, and labels the panel.
+ expect(screen.getByRole('tabpanel', { name: 'Storyboard' })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { level: 3, name: 'Storyboard' })).toBeInTheDocument();
+ expect(screen.getByText(MUSIC_VIDEO_STAGES[2].doneWhen)).toBeInTheDocument();
+ // The track, version and spend stay in the header.
expect(screen.getByText('Example Track')).toBeInTheDocument();
+ expect(screen.getByText('v2')).toBeInTheDocument();
expect(screen.getByText(/\$3\.00 \/ \$10\.00/)).toBeInTheDocument();
});
- it('says where the project stands under its name', () => {
+ it('says where the project stands in one line, and a status error marks no step as needing you', () => {
render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project' }} stage="cast-sets"
- onStageChange={() => {}} progress={{ current: 'cast-sets', stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: 'todo' })) }}
- spend={{ spentUsd: 0 }}
- status={{ headline: 'Stage 2 of 7: Cast & Sets · needs you', tone: 'warn', facts: [{ id: 'render', label: 'Nothing rendered yet', tone: 'muted' }] }} />);
+ onStageChange={() => {}} progress={progressFor('cast-sets')} spend={{ spentUsd: 0 }}
+ status={{ headline: 'Status unavailable: offline', tone: 'warn', needsYouStage: null }} />);
const status = screen.getByRole('status', { name: 'Project status' });
- expect(status).toHaveTextContent('Stage 2 of 7: Cast & Sets · needs you');
- expect(status).toHaveTextContent('Nothing rendered yet');
- // Phone collapses the facts behind one line; the wide line stays for sm+.
- expect(screen.getByRole('button', { name: /Stage 2 of 7/ })).toHaveClass('sm:hidden');
+ expect(status).toHaveTextContent(/^Status unavailable: offline$/);
+ expect(within(rail()).queryByText('Needs you')).not.toBeInTheDocument();
+ });
+
+ it('opens Project settings and its Autopilot tab from the header', () => {
+ const onOpenSettings = vi.fn();
+ render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project' }} stage="setup"
+ onStageChange={() => {}} progress={progressFor('setup')} spend={{ spentUsd: 0 }}
+ autopilot={{ label: 'Autonomous run: writing the lyric draft', short: 'Autopilot running', tone: 'muted' }} onOpenSettings={onOpenSettings} />);
+ fireEvent.click(screen.getByRole('button', { name: 'Project settings' }));
+ expect(onOpenSettings).toHaveBeenLastCalledWith('project');
+ const autopilot = screen.getByRole('button', { name: /Autonomous run: writing the lyric draft/ });
+ // A phone shows the short label so the sticky header stays one row.
+ expect(autopilot.querySelector('.sm\\:hidden')).toHaveTextContent('Autopilot running');
+ fireEvent.click(autopilot);
+ expect(onOpenSettings).toHaveBeenLastCalledWith('autopilot');
});
it('keeps the project name from a long next action on a phone (#10170)', () => {
render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project Name' }} stage="board"
- onStageChange={() => {}} progress={{ current: 'board', stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: 'todo' })) }}
- spend={{ spentUsd: 1.2, capUsd: 10 }}
+ onStageChange={() => {}} progress={progressFor('board')} spend={{ spentUsd: 1.2, capUsd: 10 }}
nextAction={{ id: 'review-production', kind: 'goto', label: 'Review timed storyboard', shortLabel: 'Board' }}
onNextAction={() => {}} />);
const name = screen.getByRole('heading', { level: 2, name: 'Example Project Name' });
- expect(name).toHaveClass('min-w-0', 'truncate');
+ expect(name).toHaveClass('truncate');
+ expect(name.parentElement).toHaveClass('min-w-0');
const action = screen.getByRole('button', { name: 'Review timed storyboard' });
- expect(action).toHaveTextContent('Board');
expect(action.querySelector('.sm\\:hidden')).toHaveTextContent('Board');
});
- it('keeps every fixed stage in the compact icon row after adding Publish', () => {
+ it('keeps every step in the phone icon bar, each with its own icon', () => {
render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project' }} stage="publish"
- onStageChange={() => {}} progress={{ current: 'publish', stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: 'todo' })) }}
- spend={{ spentUsd: 0 }} />);
- const navigation = within(screen.getByRole('navigation', { name: 'Stages' }));
+ onStageChange={() => {}} progress={progressFor('publish')} spend={{ spentUsd: 0 }} />);
+ const navigation = within(phoneBar());
expect(navigation.queryByRole('combobox')).not.toBeInTheDocument();
const tabs = navigation.getAllByRole('tab');
expect(tabs).toHaveLength(MUSIC_VIDEO_STAGES.length);
@@ -59,3 +94,19 @@ describe('music-video stage navigation', () => {
expect(navigation.getByRole('tab', { name: /^Publish/ })).toHaveAttribute('aria-selected', 'true');
});
});
+
+describe('stepState', () => {
+ it('uses one word per state, flagging a changed approval and the step that waits on the director', () => {
+ const at = (entry, needsYouStage = null) => stepState({ id: 'board', ...entry }, { needsYouStage }).word;
+ expect(at({ state: 'done' })).toBe('Done');
+ expect(at({ state: 'done', stale: true })).toBe('Changed since approval');
+ expect(at({ state: 'blocked' })).toBe('Needs you');
+ expect(at({ state: 'active' }, 'board')).toBe('Needs you');
+ // An approval on a later step marks that step, not the first unfinished one.
+ expect(at({ state: 'todo' }, 'board')).toBe('Needs you');
+ expect(at({ state: 'active' }, 'cast-sets')).toBe('In progress');
+ expect(at({ state: 'active' })).toBe('In progress');
+ expect(at({ state: 'todo', stale: true })).toBe('Changed since approval');
+ expect(at({ state: 'todo' })).toBe('Not started');
+ });
+});
diff --git a/client/src/components/musicVideo/MusicVideoProjectCard.test.jsx b/client/src/components/musicVideo/MusicVideoProjectCard.test.jsx
index 5caff9fb8a..0dd4203bb6 100644
--- a/client/src/components/musicVideo/MusicVideoProjectCard.test.jsx
+++ b/client/src/components/musicVideo/MusicVideoProjectCard.test.jsx
@@ -84,7 +84,7 @@ describe('MusicVideoProjectCard', () => {
preview: { kind: 'none', label: 'No render yet' },
};
render(<MusicVideoProjectCard project={summary} onSelect={vi.fn()} />);
- expect(screen.getByText('Board')).toBeInTheDocument();
+ expect(screen.getByText('Storyboard')).toBeInTheDocument();
expect(screen.getByText('128 BPM')).toBeInTheDocument();
expect(screen.getByText(/2 scenes · 1 clip/)).toBeInTheDocument();
expect(screen.getByTitle('50% clips rendered')).toBeInTheDocument();
diff --git a/client/src/components/musicVideo/PreviewDock.jsx b/client/src/components/musicVideo/PreviewDock.jsx
index 6f119036ba..9232a4a2f7 100644
--- a/client/src/components/musicVideo/PreviewDock.jsx
+++ b/client/src/components/musicVideo/PreviewDock.jsx
@@ -2,6 +2,7 @@ import { useEffect, useRef } from 'react';
import { useSearchParams } from 'react-router';
import { ChevronDown, ChevronUp, MonitorPlay } from 'lucide-react';
import CompositionPreviewPlayer from './CompositionPreviewPlayer.jsx';
+import StoryboardAnimatic from './StoryboardAnimatic.jsx';
// A rendered file (the final render or a draft excerpt). Its clock starts at
// the clip's own start, so a seek to song time `t` lands at `t - startSec` and
@@ -31,24 +32,24 @@ function VideoPreview({ source, seekRequest, collapsed }) {
preload="metadata"
onLoadedMetadata={() => { if (pending.current != null) { seekTo(pending.current); pending.current = null; } }}
aria-label={source.id === 'final' ? 'Final render preview' : 'Draft excerpt preview'}
- className={`aspect-video max-h-[50vh] w-full rounded border border-port-border bg-black object-contain ${collapsed ? 'max-lg:hidden' : ''}`}
+ className={`aspect-video max-h-[50vh] w-full rounded border border-port-border bg-black object-contain ${collapsed ? 'max-xl:hidden' : ''}`}
/>
);
}
/**
- * The docked preview card. `MusicVideoLayout` places it: a right-hand column
- * beside every stage from `lg` up, a collapsible mini-player pinned above the
- * bottom tab bar below it. `sources` is `listPreviewSources(…)` (never empty —
- * the page passes no dock when there is nothing to play); the picked one is
- * the `?play=` param, defaulting to the first (final render, then the live
- * composition, then the newest draft). `seekRequest` (`{ t, n }`) is the
- * scene-card seek.
+ * The docked preview card, on every step. `MusicVideoLayout` places it: a
+ * right-hand column from `xl` up, a collapsible mini-player pinned to the
+ * bottom below it. `sources` is `listPreviewSources(…)`; the picked one is the
+ * `?play=` param, defaulting to the first (final render, then the live
+ * composition, then the newest draft, then the storyboard animatic). With
+ * nothing to play yet it says what makes something playable. `seekRequest`
+ * (`{ t, n }`) is the scene-card seek.
*/
export default function PreviewDock({ project, sources, audioUrl, seekRequest, collapsed, onToggleCollapsed }) {
const [searchParams, setSearchParams] = useSearchParams();
const requested = searchParams.get('play');
- const source = sources.find((entry) => entry.id === requested) || sources[0];
+ const source = sources.find((entry) => entry.id === requested) || sources[0] || null;
const pick = (id) => setSearchParams((prev) => {
const next = new URLSearchParams(prev);
if (id === sources[0].id) next.delete('play');
@@ -58,7 +59,7 @@ export default function PreviewDock({ project, sources, audioUrl, seekRequest, c
const Chevron = collapsed ? ChevronUp : ChevronDown;
const pickerId = `mv-preview-source-${project.id}`;
return (
- <aside aria-label="Preview" className="space-y-2 rounded-lg border border-port-border bg-port-card p-2 max-lg:rounded-b-none">
+ <aside aria-label="Preview" className="space-y-2 rounded-lg border border-port-border bg-port-card p-2 max-xl:rounded-b-none">
<div className="flex min-w-0 items-center gap-2 text-xs text-port-text-muted">
<MonitorPlay size={14} className="shrink-0 text-port-accent" aria-hidden="true" />
<span className="text-sm font-medium text-port-text">Preview</span>
@@ -75,21 +76,26 @@ export default function PreviewDock({ project, sources, audioUrl, seekRequest, c
</select>
</>
) : (
- <span className="min-w-0 truncate">{source.label}</span>
+ <span className="min-w-0 truncate">{source ? source.label : 'Nothing to play yet'}</span>
)}
<button
type="button"
onClick={onToggleCollapsed}
aria-expanded={!collapsed}
aria-label={collapsed ? 'Expand preview' : 'Collapse preview'}
- className="ml-auto flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded lg:hidden"
+ className="ml-auto flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded xl:hidden"
>
<Chevron size={16} aria-hidden="true" />
</button>
</div>
- {source.kind === 'document'
- ? <CompositionPreviewPlayer project={project} audioUrl={audioUrl} seekRequest={seekRequest} collapsed={collapsed} />
- : <VideoPreview key={source.id} source={source} seekRequest={seekRequest} collapsed={collapsed} />}
+ {!source && (
+ <p className={`text-xs text-port-text-muted ${collapsed ? 'max-xl:hidden' : ''}`}>
+ Attach a track and plan the shots to watch a storyboard animatic here; drafts and the final render join it as you make them.
+ </p>
+ )}
+ {source?.kind === 'document' && <CompositionPreviewPlayer project={project} audioUrl={audioUrl} seekRequest={seekRequest} collapsed={collapsed} />}
+ {source?.kind === 'animatic' && <StoryboardAnimatic project={project} audioUrl={audioUrl} seekRequest={seekRequest} collapsed={collapsed} />}
+ {source?.kind === 'video' && <VideoPreview key={source.id} source={source} seekRequest={seekRequest} collapsed={collapsed} />}
</aside>
);
}
diff --git a/client/src/components/musicVideo/ProductionReviewPanel.jsx b/client/src/components/musicVideo/ProductionReviewPanel.jsx
index d3b2c0a595..4e61c65254 100644
--- a/client/src/components/musicVideo/ProductionReviewPanel.jsx
+++ b/client/src/components/musicVideo/ProductionReviewPanel.jsx
@@ -7,17 +7,33 @@ const EMPTY = { cast: '', environments: '', visualLanguage: '', motionLanguage:
const fieldClass = 'mt-1 w-full rounded border border-port-border bg-port-bg p-2 text-sm';
const buttonClass = 'min-h-[44px] rounded border border-port-border px-3 py-2 text-sm disabled:opacity-50';
const labels = { art: 'Art direction', storyboard: 'Lyric-timed storyboard', proof: 'Animated proof' };
-// Each approval lives on the tab that owns its work (#10151); the page passes `stage` to render only that one.
-const STAGE_TABS = { art: 'cast-sets', storyboard: 'board', proof: 'compose' };
+// Each approval closes the step that owns its work (#10151); the page passes that step's `stage`.
+const STAGE_TABS = { art: 'cast-sets', storyboard: 'board', proof: 'produce' };
const EMPTY_PLAYBACK = { method: 'playback', energyComparison: '', timecodedNotes: '', visualReview: '', audioReview: '', limitations: '' };
-/** Editable planning content and explicit operator decisions for every render mode. */
-// `framed={false}` drops the card chrome and heading for a host that supplies them.
-// `stage` ('art' | 'storyboard' | 'proof') renders just that stage's approval, feedback and planning fields; omitted, all three render.
-// `planning` is an optional `[draft, setDraft]` pair owned by the page so unsaved edits survive a tab switch; `onNavigate(tab, anchor)` jumps tabs.
-export default function ProductionReviewPanel({ project, review, onOpenArtifact, framed = true, stage = null, planning = null, onNavigate = null }) {
- const showArt = !stage || stage === 'art';
- const showBoard = !stage || stage === 'storyboard';
+const FOLD_STYLE = { scrollMarginTop: 'calc(var(--mv-header-h, 9rem) + 1rem)' };
+/**
+ * The open box that closes a step: heading, then the approval's content and
+ * Approve / Request changes, highlighted until approved.
+ */
+function ApprovalBox({ id, label, approved, children }) {
+ return <section id={id} tabIndex={-1} aria-label={`Approve: ${label}`} style={FOLD_STYLE}
+ className={`rounded-lg border p-3 focus:outline focus:outline-2 focus:outline-port-accent ${approved ? 'border-port-border' : 'border-port-accent bg-port-accent/5'}`}>
+ <h4 className="text-sm font-semibold">{approved ? `${label} approved` : `Approve the ${label.toLowerCase()}`}</h4>
+ {children}
+ </section>;
+}
+
+/**
+ * One step's production approval, with its feedback and planning fields, for
+ * every render mode. `stage` ('art' | 'storyboard' | 'proof') is the approval
+ * the step closes. `planning` is an optional `[draft, setDraft]` pair owned by
+ * the page so unsaved edits survive a step switch; `onNavigate(step, anchor)`
+ * jumps steps.
+ */
+export default function ProductionReviewPanel({ project, review, onOpenArtifact, stage, planning = null, onNavigate = null }) {
+ const showArt = stage === 'art';
+ const showBoard = stage === 'storyboard';
const fieldId = key => `mv-review-${project.id}-${key}`;
const saved = project.productionReview?.draft || EMPTY;
const [visibleArt, setVisibleArt] = useState(null);
@@ -27,7 +43,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
const [local, setLocal] = planning || [ownLocal, setOwnLocal];
const draft = local || saved;
const dirty = !!local && JSON.stringify(local) !== JSON.stringify(saved);
- const [feedback, setFeedback] = useState({ stage: stage || 'art', target: '', text: '', decision: 'request-changes' });
+ const [feedback, setFeedback] = useState({ stage, target: '', text: '', decision: 'request-changes' });
const [resolutions, setResolutions] = useState({});
const [importError, setImportError] = useState(null);
const [revisionNotice, setRevisionNotice] = useState(null);
@@ -85,16 +101,15 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
if (!evidenceComplete) return 'Complete the visual and audio observations (at least 40 characters each) and state the review limitations.';
return null;
};
- // A link to another stage's section crosses tabs through the page; within a tab it just unfolds the target.
+ // A link to another step's section crosses steps through the page; within this step it just unfolds the target.
const jump = (tab, anchor) => event => {
- if (onNavigate && stage && tab !== STAGE_TABS[stage]) { event.preventDefault(); onNavigate(tab, anchor); return; }
+ if (onNavigate && tab !== STAGE_TABS[stage]) { event.preventDefault(); onNavigate(tab, anchor); return; }
openReviewSection(event);
};
const openReviewSection = event => {
const target = document.getElementById(event.currentTarget.hash.slice(1));
if (target) { target.open = true; target.focus({ preventScroll: true }); }
};
- const nextStage = ['art', 'storyboard', 'proof'].find(stage => !ready?.[stage].approved) || 'proof';
const openRequests = stage => (project.productionReview?.feedback || []).filter(f => f.stage === stage && f.decision === 'request-changes' && !f.resolvedAt);
// Mirrors the server's revise routing so an unsupported stage explains itself instead of failing on click.
const revisionScope = stage => {
@@ -110,7 +125,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
const mode = project.composition?.mode;
if (mode === 'code') return { action: 'Regenerates the code composition with these requests. Render a new proof afterwards.' };
if (mode === 'document') return ['generated', 'template', undefined].includes(project.composition?.document?.source?.kind)
- ? { action: 'Authors a revised composition candidate with these requests. Accept it in Compose, then render a new proof.' }
+ ? { action: 'Authors a revised composition candidate with these requests. Accept it in Make, then render a new proof.' }
: { unavailable: 'This composition was imported from its own source. Revise that source and reimport it, then resolve each request.' };
return { unavailable: 'This proof is assembled from Board footage. Revise the affected storyboard shots or takes, then render a new proof.' };
};
@@ -130,7 +145,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
{!ready?.art.approved && <li><a href="#mv-review-art" onClick={jump('cast-sets', 'mv-review-art')} className="text-port-accent underline">Review and approve art direction</a> for the current revision.</li>}
{!ready?.storyboard.approved && <li><a href="#mv-review-storyboard" onClick={jump('board', 'mv-review-storyboard')} className="text-port-accent underline">Resolve storyboard prerequisites and approve it</a>.
<ul className="list-disc pl-5">{(ready?.storyboard.problems || []).map(problem => <li key={problem}>{problem}</li>)}</ul>
- <a href="#mv-review-planning" onClick={jump('board', 'mv-review-planning')} className="text-port-accent underline">Open planning edits for alignment and document shot manifests</a>.
+ <a href="#mv-review-planning" onClick={jump('board', 'mv-review-planning')} className="text-port-accent underline">Open planning edits for document shot manifests</a>; lyric timing is verified on the <a href="#mv-lyric-timing" onClick={jump('setup', 'mv-lyric-timing')} className="text-port-accent underline">Song step</a>.
</li>}
<li>Choose a 10–45 second chorus window and use “Render animated proof” below. The feasibility prototype button creates a separate, unapproved preview.</li>
<li>Review the proof with audio, add an energy comparison and timecoded notes, then approve using the playback attestation.</li>
@@ -203,17 +218,11 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
<p className="text-xs text-port-text-muted">Include at least one playback timestamp such as 0:04 or 4.5s. These notes are saved with this exact proof. A replacement proof requires a new comparison and acknowledgement.</p>
{!machineReview && <p id={fieldId('playback-attestation')} className="text-sm">By approving, I confirm that I watched this exact proof with audio at normal speed and compared its energy, timed choreography and lyric timing with the saved plan.</p>}
</>;
- return <section id="mv-production-review" aria-label="Production review" className={framed ? 'rounded-lg border border-port-border bg-port-card p-3 space-y-3' : 'space-y-3'}>
- {framed && <h3 className="font-medium">Production review</h3>}
- <details><summary className="min-h-[44px] cursor-pointer text-xs text-port-text-muted">About production approvals</summary>
- <p className="text-sm text-port-text-muted">{stage ? 'Approving a development file or rendering a draft does not approve production.'
- : 'Approve the visual direction, then the timed storyboard, then the reviewed animated proof. Approving a development file or rendering a draft does not approve production.'}</p>
- </details>
+ const key = stage;
+ const label = labels[stage];
+ return <section id="mv-production-review" aria-label="Production review" className="space-y-3">
{review.error && <p role="alert" className="text-port-error">{review.error}</p>}
- <ol className="space-y-3">
- {Object.entries(labels).filter(([key]) => !stage || key === stage).map(([key, label]) => <li key={key}><details open={window.location.hash === `#mv-review-${key}` || (!stage && key === nextStage)} id={`mv-review-${key}`} tabIndex={-1} style={{ scrollMarginTop: 'calc(var(--mv-header-h, 9rem) + 1rem)' }} className="rounded border border-port-border p-2 focus:outline focus:outline-2 focus:outline-port-accent">
- <summary className="cursor-pointer min-h-[44px] py-2 text-sm font-medium">{label}</summary>
- <p role="status" className="text-xs">{ready?.[key].approved ? 'Approved for this revision' : 'Review required'}</p>
+ <ApprovalBox id={`mv-review-${key}`} label={label} approved={!!ready?.[key].approved}>
<div id={fieldId(`${key}-prerequisites`)}>{(ready?.[key].problems || []).map(problem => <p key={problem} className="mt-1 text-xs text-port-text-muted">{problem}</p>)}</div>
{key === 'proof' ? proofContent : <ProductionReviewContext stage={key} project={project} basis={ready?.basis[key]} approved={ready?.[key].approved} onOpenArtifact={onOpenArtifact} onArtReady={available => setVisibleArt(available ? artIdentity : null)} />}
<p id={fieldId(`${key}-approval-help`)} role="status" className="mt-2 text-sm text-port-text-muted">{approvalHelp(key)}</p>
@@ -239,16 +248,11 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
</>}
{revisionNotice?.stage === key && <p role="status" className="text-sm">{revisionNotice.text}</p>}
</div>}
- </details></li>)}
- </ol>
- <p className="text-xs text-port-text-muted">Your signed-in session can approve each reviewed stage. Authenticated agents can also review and approve. Proof approval requires recorded visual and audio evidence; publishing remains manual.</p>
+ </ApprovalBox>
{dirty && <p role="status" className="text-sm">Save your planning edits before approving this revision.</p>}
<details>
<summary className="cursor-pointer min-h-[44px] py-2 text-sm">Review feedback and revision history</summary>
<p className="text-sm">Name a cast member, environment, shot, artifact or frame time. Structure acceptance records agreement on organization only; it never approves the art or authorizes production.</p>
- {!stage && <label htmlFor={fieldId('feedback-stage')} className="block text-sm">Feedback stage<select id={fieldId('feedback-stage')} className={fieldClass} value={feedback.stage} onChange={e => setFeedback({ ...feedback, stage: e.target.value })}>
- {Object.entries(labels).map(([key, label]) => <option key={key} value={key}>{label}</option>)}
- </select></label>}
<label htmlFor={fieldId('feedback-target')} className="block text-sm">Feedback target<input id={fieldId('feedback-target')} className={fieldClass} value={feedback.target} placeholder="Cast: operator; shot: chorus; frame: 12.5s" onChange={e => setFeedback({ ...feedback, target: e.target.value })} /></label>
<label htmlFor={fieldId('feedback-text')} className="block text-sm">Requested change<textarea id={fieldId('feedback-text')} className={fieldClass} rows={3} value={feedback.text} onChange={e => setFeedback({ ...feedback, text: e.target.value })} /></label>
<label htmlFor={fieldId('feedback-decision')} className="block text-sm">Review decision<select id={fieldId('feedback-decision')} className={fieldClass} value={feedback.decision} onChange={e => setFeedback({ ...feedback, decision: e.target.value })}>
@@ -263,7 +267,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
{savedRequestStage && openRequests(savedRequestStage).length > 0 && <p role="status" className="text-sm">
Approval stays blocked until these are resolved. <a href={`#mv-review-${savedRequestStage}`} onClick={openReviewSection} className="text-port-accent underline">Revise from feedback</a>, or edit and resolve manually.
</p>}
- <ul className="mt-3 space-y-3">{(project.productionReview?.feedback || []).filter(item => !stage || item.stage === stage).map(item => <li key={item.id} className="rounded border border-port-border p-2">
+ <ul className="mt-3 space-y-3">{(project.productionReview?.feedback || []).filter(item => item.stage === stage).map(item => <li key={item.id} className="rounded border border-port-border p-2">
<p className="text-sm"><strong>{item.target}</strong> · {item.decision} · {item.resolvedAt ? 'Resolved' : 'Open'}</p>
<p className="text-sm whitespace-pre-wrap">{item.text}</p>
<p className="text-xs text-port-text-muted">Reviewed revision {item.basis.slice(0, 12)}{ready?.basis[item.stage] !== item.basis ? ' · content has changed since review' : ' · current revision'}</p>
@@ -277,7 +281,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
</li>)}</ul>
</details>
{stage !== 'proof' && <details id="mv-review-planning" tabIndex={-1} open={window.location.hash === '#mv-review-planning'} style={{ scrollMarginTop: 'calc(var(--mv-header-h, 9rem) + 1rem)' }}>
- <summary className="cursor-pointer min-h-[44px] py-2 text-sm">{!stage ? 'Edit visual guide and storyboard' : showArt ? 'Edit art direction and visual guide' : 'Edit alignment and storyboard shots'}</summary>
+ <summary className="cursor-pointer min-h-[44px] py-2 text-sm">{showArt ? 'Edit art direction and visual guide' : 'Edit storyboard shots'}</summary>
<div className="space-y-3">
{importError && <p role="alert">{importError}</p>}
{showArt && <label htmlFor={fieldId('import')} className="block text-sm">Import planning JSON as an unapproved draft
@@ -291,7 +295,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
</label>}
{showBoard && project.composition?.mode === 'document' && <div className="space-y-2 rounded border border-port-border p-2">
<p className="text-sm">Document shot manifest</p>
- <p className="text-xs text-port-text-muted">Export the composition in Compose. Have its author extract the actual shot IDs, timings and choreography from the source (for example timeline.js) into the JSON format below, keeping its documentDirectory and audioBasis from when that source was authored. A generic document section or Board row is not a shot list. Reauthor and reimport the composition after changing lyrics or timing, then import its matching manifest here.</p>
+ <p className="text-xs text-port-text-muted">Export the composition in Make. Have its author extract the actual shot IDs, timings and choreography from the source (for example timeline.js) into the JSON format below, keeping its documentDirectory and audioBasis from when that source was authored. A generic document section or Board row is not a shot list. Reauthor and reimport the composition after changing lyrics or timing, then import its matching manifest here.</p>
<label htmlFor={fieldId('document-shots')} className="block text-sm">Import document shot manifest
<input id={fieldId('document-shots')} type="file" accept=".json,application/json" disabled={dirty || review.busy || !project.productionReview?.draft || !project.composition.document} className={fieldClass}
onChange={async e => {
@@ -334,23 +338,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
{draft.guideArtifactId && <button type="button" className={buttonClass} onClick={() => onOpenArtifact(draft.guideArtifactId)}>Review visual sheet</button>}
</>}
{showBoard && <>
- <label htmlFor={fieldId('song-content')} className="block text-sm">Song content
- <select id={fieldId('song-content')} value={draft.lyricsMode} onChange={e => set('lyricsMode', e.target.value)} className={fieldClass}>
- <option value="vocal">Vocal song — aligned lyrics required</option><option value="instrumental">Instrumental — explicit exception</option>
- </select>
- </label>
- <label htmlFor={fieldId('alignment-status')} className="block text-sm">Alignment status
- <select id={fieldId('alignment-status')} value={draft.timingStatus} onChange={e => set('timingStatus', e.target.value)} className={fieldClass}>
- <option value="provisional">Provisional — needs listening and correction</option><option value="verified">{ready?.alignment?.status === 'stale' ? 'Previously verified — needs re-review' : 'Verified against the current master vocal'}</option>
- </select>
- </label>
- {draft.lyricsMode === 'vocal' && ready?.alignment?.status === 'stale' && <div className="space-y-2">
- <p role="status" className="text-sm text-port-warning">Word timings or master audio changed. The previous verification is historical; current alignment needs re-review.</p>
- <p className="text-xs text-port-text-muted">Listen to the current master and inspect its word timings before reverifying. Save any edited notes first. This records your authenticated review; it does not approve the storyboard or fix timing errors.</p>
- <button type="button" className={buttonClass} disabled={blocked || !draft.timingNotes.trim()}
- onClick={() => review.reverifyAlignment(draft.timingNotes)}>Reverify current timings</button>
- </div>}
- <label htmlFor={fieldId('alignment-notes')} className="block text-sm">Alignment notes / instrumental rationale<textarea id={fieldId('alignment-notes')} rows={2} value={draft.timingNotes} onChange={e => set('timingNotes', e.target.value)} className={fieldClass} /></label>
+ {/* Song content and lyric-timing verification live on the Song step (LyricTimingCheck). */}
<label htmlFor={fieldId('storyboard-source')} className="block text-sm">Storyboard source
<select id={fieldId('storyboard-source')} value={draft.storyboardSource || 'board'} onChange={e => set('storyboardSource', e.target.value)} className={fieldClass}>
<option value="board">Board scenes</option><option value="document">Authored document shot manifest</option>
@@ -369,7 +357,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
{!documentShots && !scene && <button type="button" className={buttonClass} disabled={dirty || review.busy || !shot.id} onClick={() => review.bindShot(shot.id)}>Create Board scene from this draft shot</button>}
{documentShots ? <div className="flex flex-wrap gap-2">
{['startSec', 'endSec'].map(key => <label key={key} htmlFor={fieldId(`${shotKey(shot)}-${key}`)} className="text-sm">{key === 'startSec' ? 'Shot start (seconds)' : 'Shot end (seconds)'}<input id={fieldId(`${shotKey(shot)}-${key}`)} type="number" min="0" step="0.01" value={shot[key] ?? ''} onChange={e => setShot(shot, key, e.target.value === '' ? null : Number(e.target.value))} className={fieldClass} /></label>)}
- <p className="text-xs text-port-text-muted">Planning edits do not rewrite source code. Reauthor or reimport in Compose, then import its matching shot manifest before approval.</p>
+ <p className="text-xs text-port-text-muted">Planning edits do not rewrite source code. Reauthor or reimport in Make, then import its matching shot manifest before approval.</p>
</div> : <p className="text-xs text-port-text-muted">{scene && Number.isFinite(scene.startSec) && Number.isFinite(scene.endSec) ? `Shot window ${formatTimecode(scene.startSec)}–${formatTimecode(scene.endSec)}. ` : ''}Review exact start/end in Board. Imported timings remain provisional.</p>}
{['action', 'staging', 'camera', 'transition'].map(key => <label key={key} htmlFor={fieldId(`${shotKey(shot)}-${key}`)} className="block text-sm capitalize">{key}
<textarea id={fieldId(`${shotKey(shot)}-${key}`)} rows={2} value={shot[key]} placeholder={({ action: 'At a beat or word: subject and prop action; pose, travel and energy change.', staging: 'Depth, blocking, prop trajectory and typography placement through the shot.', camera: 'Timed camera path, framing changes and motivated holds.', transition: 'Exact entry/exit anchor, visual handoff and escalation into the next section.' })[key]} onChange={e => setShot(shot, key, e.target.value)} className={fieldClass} />
diff --git a/client/src/components/musicVideo/ProductionReviewPanel.test.jsx b/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
index ad66e34556..09a269fdf0 100644
--- a/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
+++ b/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { fireEvent, render, screen, waitFor, within } from '@testing-library/react';
+import { useState } from 'react';
import ProductionReviewPanel from './ProductionReviewPanel.jsx';
afterEach(() => { vi.unstubAllGlobals(); window.location.hash = ''; });
@@ -28,7 +29,7 @@ function recordPlayback() {
describe('Production proof playback evidence', () => {
it('records playback attestation only when the reviewer explicitly approves, without a separate checkbox', () => {
const review = reviewFixture();
- render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
+ render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
const approve = screen.getByRole('button', { name: approvalAction });
expect(approve.disabled).toBe(true);
fireEvent.loadedData(screen.getByLabelText('Animated proof with master audio'));
@@ -56,8 +57,9 @@ describe('Production proof playback evidence', () => {
review.readiness.storyboard = { approved: false, problems: ['Verify alignment against the current master.', 'Import a matching document shot manifest.'] };
review.readiness.proof.problems = ['Approve the current lyric-timed storyboard before the animated proof.'];
const prototype = { ...project, productionReview: { ...project.productionReview, proof: null, prototype: { excerptId: 'proof-a' } } };
- render(<ProductionReviewPanel project={prototype} review={review} onOpenArtifact={vi.fn()} />);
- fireEvent.click(screen.getByText('Animated proof', { selector: 'summary' }));
+ const onNavigate = vi.fn();
+ render(<ProductionReviewPanel project={prototype} review={review} onOpenArtifact={vi.fn()} stage="proof" onNavigate={onNavigate} />);
+ expect(screen.getByRole('region', { name: 'Approve: Animated proof' })).toBeTruthy();
const prerequisites = screen.getByLabelText('Proof approval prerequisites');
expect(prerequisites.textContent).toContain('feasibility prototype, not a registered production proof');
expect(prerequisites.textContent).toContain('Verify alignment against the current master.');
@@ -67,22 +69,24 @@ describe('Production proof playback evidence', () => {
fireEvent.loadedData(screen.getByLabelText('Unapproved feasibility prototype'));
expect(screen.getByRole('button', { name: approvalAction }).disabled).toBe(true);
fireEvent.click(within(prerequisites).getByRole('link', { name: 'Resolve storyboard prerequisites and approve it' }));
- expect(document.getElementById('mv-review-storyboard').open).toBe(true);
- fireEvent.click(within(prerequisites).getByRole('link', { name: 'Open planning edits for alignment and document shot manifests' }));
- expect(document.getElementById('mv-review-planning').open).toBe(true);
- expect(document.activeElement.id).toBe('mv-review-planning');
+ // The storyboard approval and its planning edits live on the Board step, so the links cross steps.
+ expect(onNavigate).toHaveBeenLastCalledWith('board', 'mv-review-storyboard');
+ fireEvent.click(within(prerequisites).getByRole('link', { name: 'Open planning edits for document shot manifests' }));
+ expect(onNavigate).toHaveBeenLastCalledWith('board', 'mv-review-planning');
+ fireEvent.click(within(prerequisites).getByRole('link', { name: 'Song step' }));
+ expect(onNavigate).toHaveBeenLastCalledWith('setup', 'mv-lyric-timing');
expect(review.approve).not.toHaveBeenCalled();
});
it('clears evidence when the creative revision changes even if the excerpt and filename are unchanged', () => {
const review = reviewFixture();
- const view = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
+ const view = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
recordPlayback();
const changedReview = { ...review, readiness: { ...review.readiness,
basis: { ...review.readiness.basis, proof: 'new-creative-basis' },
proof: { approved: false, problems: ['Render and watch a current animated chorus proof with the master song.'] },
} };
- view.rerender(<ProductionReviewPanel project={project} review={changedReview} onOpenArtifact={vi.fn()} />);
+ view.rerender(<ProductionReviewPanel project={project} review={changedReview} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.getByLabelText('Timecoded playback notes').value).toBe('');
expect(screen.getByRole('button', { name: approvalAction }).disabled).toBe(true);
expect(screen.getByText(/Source changed — render a new proof/)).toBeTruthy();
@@ -92,7 +96,7 @@ describe('Production proof playback evidence', () => {
it('shows a persisted capture failure after reconnect and keeps proof approval blocked', () => {
render(<ProductionReviewPanel project={{ ...project, excerpts: [{ id: 'proof-a', status: 'error',
error: 'Composition capture failed at frame 0 (song 12s): Browser command timed out: Page.captureScreenshot' }] }}
- review={reviewFixture()} onOpenArtifact={vi.fn()} />);
+ review={reviewFixture()} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.getByRole('alert').textContent).toContain('capture failed at frame 0');
expect(screen.getByRole('button', { name: proofAction }).disabled).toBe(true);
expect(screen.queryByLabelText('Animated proof with master audio')).toBeNull();
@@ -100,7 +104,7 @@ describe('Production proof playback evidence', () => {
it('submits substantive machine evidence for the exact proof without claiming playback', () => {
const review = reviewFixture();
- const view = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
+ const view = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
recordPlayback();
fireEvent.change(screen.getByLabelText('Review method'), { target: { value: 'machine' } });
expect(screen.queryByRole('checkbox')).toBeNull();
@@ -126,7 +130,7 @@ describe('Production proof playback evidence', () => {
fireEvent.change(screen.getByLabelText('Review method'), { target: { value: 'playback' } });
expect(screen.getByRole('button', { name: approvalAction }).disabled).toBe(false);
fireEvent.change(screen.getByLabelText('Review method'), { target: { value: 'machine' } });
- view.rerender(<ProductionReviewPanel project={{ ...project, excerpts: [{ ...project.excerpts[0], filename: 'replacement.mp4' }] }} review={review} onOpenArtifact={vi.fn()} />);
+ view.rerender(<ProductionReviewPanel project={{ ...project, excerpts: [{ ...project.excerpts[0], filename: 'replacement.mp4' }] }} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.getByLabelText('Review method').value).toBe('playback');
fireEvent.loadedData(screen.getByLabelText('Animated proof with master audio'));
fireEvent.change(screen.getByLabelText('Review method'), { target: { value: 'machine' } });
@@ -138,7 +142,7 @@ describe('Production proof playback evidence', () => {
it('reports server errors and blocks machine approval for missing media or timestamps', () => {
const review = reviewFixture();
- render(<ProductionReviewPanel project={project} review={{ ...review, error: 'The proof revision changed; review the current proof.' }} onOpenArtifact={vi.fn()} />);
+ render(<ProductionReviewPanel project={project} review={{ ...review, error: 'The proof revision changed; review the current proof.' }} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.getByRole('alert').textContent).toContain('proof revision changed');
expect(screen.getByLabelText('Review method').disabled).toBe(true);
fireEvent.loadedData(screen.getByLabelText('Animated proof with master audio'));
@@ -162,7 +166,7 @@ describe('Production proof playback evidence', () => {
const review = reviewFixture(); review.readiness.art.approved = false;
const art = { ...project, devArtifacts: [{ id: 'guide', title: 'Synthetic visual guide', version: 2, mimeType: 'image/png' }],
productionReview: { ...project.productionReview, draft: { ...project.productionReview.draft, guideArtifactId: 'guide' } } };
- render(<ProductionReviewPanel project={art} review={review} onOpenArtifact={vi.fn()} />);
+ render(<ProductionReviewPanel project={art} review={review} onOpenArtifact={vi.fn()} stage="art" />);
const approve = screen.getByRole('button', { name: 'Approve art direction' });
expect(approve.disabled).toBe(true);
const image = await screen.findByAltText('Synthetic visual guide v2');
@@ -176,20 +180,27 @@ describe('Production proof playback evidence', () => {
expect(screen.getByRole('alert').textContent).toContain('could not be loaded');
});
- it('shows the document shots beside storyboard approval and targets change requests to that stage', () => {
- const review = reviewFixture(); review.readiness.storyboard.approved = false;
+ it('shows the document shots beside storyboard approval and targets change requests to that stage', async () => {
+ const review = { ...reviewFixture(), feedback: vi.fn(async () => true) }; review.readiness.storyboard.approved = false;
const doc = { ...project, composition: { mode: 'document', document: { directory: 'synthetic/doc-2' } },
productionReview: { ...project.productionReview, draft: { ...project.productionReview.draft, storyboardSource: 'document',
storyboard: [{ id: 'shot-a', label: 'Doorway', startSec: 0, endSec: 10, action: 'Open the doorway on the downbeat', camera: 'Push in', staging: 'Figure left', transition: 'Match cut', lyricCueIds: [] }] } } };
- render(<ProductionReviewPanel project={doc} review={review} onOpenArtifact={vi.fn()} />);
+ render(<ProductionReviewPanel project={doc} review={review} onOpenArtifact={vi.fn()} stage="storyboard" />);
const content = screen.getByLabelText('Storyboard review content');
expect(content.textContent).toContain('1 document shots');
expect(content.textContent).toContain('doc-2');
expect(content.textContent).toContain('Open the doorway on the downbeat');
- fireEvent.click(within(content.closest('details')).getByRole('button', { name: 'Request changes' }));
- expect(screen.getByLabelText('Feedback stage').value).toBe('storyboard');
+ const box = screen.getByRole('region', { name: 'Approve: Lyric-timed storyboard' });
+ expect(box.contains(content)).toBe(true);
+ fireEvent.click(within(box).getByRole('button', { name: 'Request changes' }));
+ expect(screen.queryByLabelText('Feedback stage')).toBeNull();
expect(document.activeElement).toBe(screen.getByLabelText('Requested change'));
expect(screen.getByLabelText('Requested change').closest('details').open).toBe(true);
+ fireEvent.change(screen.getByLabelText('Feedback target'), { target: { value: 'shot: Doorway' } });
+ fireEvent.change(screen.getByLabelText('Requested change'), { target: { value: 'Hold the doorway one beat longer.' } });
+ fireEvent.click(screen.getByRole('button', { name: 'Save revision feedback' }));
+ expect(review.feedback).toHaveBeenCalledWith({ stage: 'storyboard', target: 'shot: Doorway', text: 'Hold the doorway one beat longer.', decision: 'request-changes' });
+ await waitFor(() => expect(screen.getByLabelText('Requested change').value).toBe(''));
});
it('offers a stage revision for open change requests and explains the blocked approval', async () => {
@@ -201,7 +212,8 @@ describe('Production proof playback evidence', () => {
{ id: 'fb-done', stage: 'storyboard', target: 'shot: Intro', text: 'Already handled', decision: 'request-changes', basis: 'board', resolvedAt: '2026-01-01T00:00:00.000Z' },
{ id: 'fb-proof', stage: 'proof', target: 'frame: 0:04', text: 'Prop lands late', decision: 'request-changes', basis: 'same-creative-basis' },
] } };
- render(<ProductionReviewPanel project={withRequests} review={review} onOpenArtifact={vi.fn()} />);
+ const board = render(<ProductionReviewPanel project={withRequests} review={review} onOpenArtifact={vi.fn()} stage="storyboard" />);
+ expect(screen.queryByRole('group', { name: 'Animated proof change requests' })).toBeNull();
const requests = screen.getByRole('group', { name: 'Lyric-timed storyboard change requests' });
expect(requests.textContent).toContain('Approval stays blocked until these are resolved. Revise from feedback, or edit and resolve manually.');
expect(requests.textContent).toContain('Land the leap on the downbeat');
@@ -210,16 +222,27 @@ describe('Production proof playback evidence', () => {
expect(review.revise).toHaveBeenCalledWith('storyboard');
await waitFor(() => expect(requests.textContent).toContain('Revised 2 shots. Review them, then resolve each request.'));
// A document-mode proof with no imported source can be re-authored as a generated candidate.
+ board.unmount();
+ render(<ProductionReviewPanel project={withRequests} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
+ expect(screen.queryByRole('group', { name: 'Lyric-timed storyboard change requests' })).toBeNull();
const proofRequests = screen.getByRole('group', { name: 'Animated proof change requests' });
expect(within(proofRequests).getByRole('button', { name: 'Revise from feedback' })).toBeTruthy();
});
- it('keeps the hash-selected art context open when readiness arrives', () => {
+ it('keeps the hash-selected art approval open and highlighted when readiness arrives, until approved', () => {
window.location.hash = '#mv-review-art';
- const review = reviewFixture();
- const view = render(<ProductionReviewPanel project={project} review={{ ...review, readiness: null }} onOpenArtifact={vi.fn()} />);
- view.rerender(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
- expect(document.getElementById('mv-review-art').open).toBe(true);
+ const review = reviewFixture(); review.readiness.art.approved = false;
+ const view = render(<ProductionReviewPanel project={project} review={{ ...review, readiness: null }} onOpenArtifact={vi.fn()} stage="art" />);
+ view.rerender(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="art" />);
+ const box = document.getElementById('mv-review-art');
+ expect(box).toBe(screen.getByRole('region', { name: 'Approve: Art direction' }));
+ expect(box.tagName).toBe('SECTION');
+ expect(within(box).getByRole('heading', { name: 'Approve the art direction' })).toBeTruthy();
+ expect(box.className).toContain('border-port-accent');
+ const approved = reviewFixture();
+ view.rerender(<ProductionReviewPanel project={project} review={approved} onOpenArtifact={vi.fn()} stage="art" />);
+ expect(within(box).getByRole('heading', { name: 'Art direction approved' })).toBeTruthy();
+ expect(box.className).not.toContain('border-port-accent');
});
it('shows the recorded review for an approved artifact without treating it as fresh playback evidence', () => {
@@ -229,11 +252,11 @@ describe('Production proof playback evidence', () => {
excerptId: 'proof-a', filename: 'proof-a.mp4', watchedWithAudio: true,
energyComparison: 'The driving turn matches the saved energy target.', timecodedNotes: '0:04 — the figure turns on the downbeat.',
} } } } };
- const view = render(<ProductionReviewPanel project={approved} review={review} onOpenArtifact={vi.fn()} />);
+ const view = render(<ProductionReviewPanel project={approved} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.getByLabelText('Recorded proof review').textContent).toContain('0:04 — the figure turns on the downbeat.');
expect(screen.queryByRole('checkbox')).toBeNull();
expect(screen.getByLabelText('Timecoded playback notes').value).toBe('');
- view.rerender(<ProductionReviewPanel project={{ ...approved, excerpts: [{ id: 'proof-a', filename: 'replacement.mp4', status: 'complete' }] }} review={review} onOpenArtifact={vi.fn()} />);
+ view.rerender(<ProductionReviewPanel project={{ ...approved, excerpts: [{ id: 'proof-a', filename: 'replacement.mp4', status: 'complete' }] }} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.queryByLabelText('Recorded proof review')).toBeNull();
});
@@ -242,12 +265,12 @@ describe('Production proof playback evidence', () => {
{ id: 'proof-a', filename: 'replacement.mp4' },
])('requires new playback notes when the proof artifact changes to $filename without a creative-basis change', ({ id, filename }) => {
const review = reviewFixture();
- const view = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
+ const view = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
recordPlayback();
expect(screen.getByRole('button', { name: proofAction }).disabled).toBe(false);
const replacement = { ...project, productionReview: { ...project.productionReview, proof: { ...project.productionReview.proof, excerptId: id } },
excerpts: [{ id, filename, status: 'complete' }] };
- view.rerender(<ProductionReviewPanel project={replacement} review={review} onOpenArtifact={vi.fn()} />);
+ view.rerender(<ProductionReviewPanel project={replacement} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
expect(screen.queryByRole('checkbox')).toBeNull();
expect(screen.getByLabelText('Playback energy compared with the saved plan').value).toBe('');
expect(screen.getByLabelText('Timecoded playback notes').value).toBe('');
@@ -262,7 +285,7 @@ describe('Production proof playback evidence', () => {
it('blocks approval and explains a failed proof player', () => {
const review = reviewFixture();
- render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
+ render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
recordPlayback();
fireEvent.error(screen.getByLabelText('Animated proof with master audio'));
expect(screen.getByRole('alert').textContent).toContain('could not be played');
@@ -271,38 +294,37 @@ describe('Production proof playback evidence', () => {
it('keeps failed choreography saves dirty and blocks approval', async () => {
const review = reviewFixture();
- render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} />);
- recordPlayback();
+ // The page owns the planning draft so unsaved edits on the art step still block the proof step.
+ function Steps({ stage }) {
+ const planning = useState(null);
+ return <ProductionReviewPanel key={stage} project={project} review={review} onOpenArtifact={vi.fn()} stage={stage} planning={planning} />;
+ }
+ const view = render(<Steps stage="art" />);
fireEvent.change(screen.getByLabelText('Timed choreography and energy plan'), { target: { value: 'Energy target: explosive. 0:04 — replace the turn with a leap.' } });
fireEvent.click(screen.getByRole('button', { name: 'Save planning edits', hidden: true }));
await waitFor(() => expect(review.save).toHaveBeenCalled());
expect(screen.getByText('Save edits before preparing, approving or rendering.')).toBeTruthy();
+ expect(screen.getByRole('button', { name: 'Approve art direction' }).disabled).toBe(true);
+ view.rerender(<Steps stage="proof" />);
+ fireEvent.loadedData(screen.getByLabelText('Animated proof with master audio'));
+ expect(screen.getByText('Save your planning edits before approving this revision.', { selector: '#mv-review-example-project-proof-approval-help' })).toBeTruthy();
expect(screen.getByLabelText('Timecoded playback notes').disabled).toBe(true);
expect(screen.getByRole('button', { name: proofAction }).disabled).toBe(true);
expect(review.approve).not.toHaveBeenCalled();
});
});
-describe('Stale alignment review', () => {
- it('labels historical verification and offers an explicit native button with the saved notes', () => {
- const vocal = { ...project, productionReview: { ...project.productionReview, draft: { ...project.productionReview.draft, lyricsMode: 'vocal' } } };
+describe('Lyric timing lives on the Song step', () => {
+ it('leaves song content and timing verification out of the storyboard planning editor', () => {
const review = reviewFixture();
review.readiness.alignment = { status: 'stale', basis: 'current-word-times' };
- review.reverifyAlignment = vi.fn();
- const view = render(<ProductionReviewPanel project={vocal} review={review} onOpenArtifact={vi.fn()} />);
- fireEvent.click(screen.getByText('Edit visual guide and storyboard'));
- expect(screen.getByRole('option', { name: 'Previously verified — needs re-review' }).selected).toBe(true);
- const button = screen.getByRole('button', { name: 'Reverify current timings' });
- expect(button.tagName).toBe('BUTTON');
- expect(button.disabled).toBe(false);
- expect(screen.getByText(/Listen to the current master and inspect its word timings/)).toBeTruthy();
- expect(review.reverifyAlignment).not.toHaveBeenCalled();
- fireEvent.click(button);
- expect(review.reverifyAlignment).toHaveBeenCalledWith('Synthetic master');
- fireEvent.change(screen.getByLabelText('Alignment notes / instrumental rationale'), { target: { value: 'New unsaved notes' } });
- expect(button.disabled).toBe(true);
- view.rerender(<ProductionReviewPanel project={vocal} review={{ ...review, busy: true }} onOpenArtifact={vi.fn()} />);
- expect(button.disabled).toBe(true);
+ render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="storyboard" />);
+ fireEvent.click(screen.getByText('Edit storyboard shots'));
+ expect(screen.queryByLabelText('Song content')).toBeNull();
+ expect(screen.queryByLabelText('Alignment status')).toBeNull();
+ expect(screen.queryByRole('button', { name: 'Reverify current timings' })).toBeNull();
+ // The storyboard source stays here: it is the storyboard's own input.
+ expect(screen.getByLabelText('Storyboard source')).toBeTruthy();
});
});
@@ -328,4 +350,18 @@ describe('Per-stage approval sections (#10151)', () => {
expect(screen.getByLabelText('Storyboard source')).toBeTruthy();
expect(screen.queryByLabelText('Cast guide')).toBeNull();
});
+
+ it('shows the approval on its step as an open box that closes the step, not a fold', () => {
+ const review = reviewFixture();
+ review.readiness.storyboard.approved = false;
+ const { container } = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="storyboard" />);
+ const box = screen.getByRole('region', { name: 'Approve: Lyric-timed storyboard' });
+ expect(box.id).toBe('mv-review-storyboard');
+ expect(box.tagName).toBe('SECTION');
+ expect(within(box).getByRole('heading', { name: 'Approve the lyric-timed storyboard' })).toBeTruthy();
+ expect(within(box).getByRole('button', { name: 'Approve lyric-timed storyboard' })).toBeTruthy();
+ expect(within(box).getByRole('button', { name: 'Request changes' })).toBeTruthy();
+ expect(container.querySelector('details#mv-review-storyboard')).toBeNull();
+ expect(screen.queryByText('About production approvals')).toBeNull();
+ });
});
diff --git a/client/src/components/musicVideo/ProjectActionGroups.jsx b/client/src/components/musicVideo/ProjectActionGroups.jsx
index fa5b67c9b1..f41bf0c443 100644
--- a/client/src/components/musicVideo/ProjectActionGroups.jsx
+++ b/client/src/components/musicVideo/ProjectActionGroups.jsx
@@ -8,10 +8,11 @@ import { projectServicesSummary } from '../../lib/musicVideoStages.js';
import { batchActive, batchSummary, scenesWaitingForFrame, videoBatchPreview, videosButtonLabel } from '../../lib/musicVideoBatchPlan.js';
/**
- * The board-level actions the old single toolbar carried, split by the stage
- * that owns them: analyze + MIDI (Setup), AI plan + auto-arrange (Board), the
- * frame/clip generators (Produce) and the final render (Review). The render
- * style select and the render pins are project options, edited in Setup. Each
+ * The board-level actions the old single toolbar carried, split by the step
+ * that owns them: analyze (Song; MIDI in Project settings › Audio), AI plan +
+ * auto-arrange (Storyboard), the frame/clip generators (Make) and the final
+ * render (Final render). The render style select and the render pins are
+ * project options, edited in Project settings. Each
* group takes the page's hook slots (`midi`, `videoSettings`, `sceneMedia`,
* `renderJob`) and the page-owned in-flight flags in `busy`.
*/
@@ -133,7 +134,7 @@ function BatchStatus({ noun, batch }) {
/**
* The batch generators, with the image and video services they render on (a
- * project option, edited in Setup › Project options; `onEditServices` goes there).
+ * project option, edited in Project settings › Project; `onEditServices` goes there).
*/
export function GenerationActions({ project, videoSettings, sceneMedia, onEditServices }) {
// The first click only opens the confirm line (count + estimate); nothing is
@@ -175,7 +176,7 @@ export function GenerationActions({ project, videoSettings, sceneMedia, onEditSe
<span className="flex min-w-0 flex-wrap items-center gap-1 text-xs text-port-text-muted">
{projectServicesSummary(project)}
{onEditServices && (
- <button type="button" onClick={onEditServices} className="min-h-[44px] px-1 text-port-accent sm:min-h-0">Change in Setup</button>
+ <button type="button" onClick={onEditServices} className="min-h-[44px] px-1 text-port-accent sm:min-h-0">Change in Project settings</button>
)}
</span>
<button
@@ -254,7 +255,7 @@ export function RenderFinalButton({ project, renderJob, readiness }) {
const eidoverseMode = mode === 'eidoverse';
const eidoverseBlocked = !eidoverseMode ? '' : noAudioOf(project) ? 'Link a track first'
: !(project.audioAnalysis?.durationSec > 0) ? 'Analyze the master song first'
- : !project.composition?.eidoverseScene?.inlineScript ? 'Save an Eidoverse scene in Compose first' : '';
+ : !project.composition?.eidoverseScene?.inlineScript ? 'Save an Eidoverse scene in Make first' : '';
const readySceneCount = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
const noAudio = noAudioOf(project);
const codeDuration = Math.max(
diff --git a/client/src/components/musicVideo/ProjectOptionsPanel.jsx b/client/src/components/musicVideo/ProjectOptionsPanel.jsx
index 4f009fe874..73ff1701ba 100644
--- a/client/src/components/musicVideo/ProjectOptionsPanel.jsx
+++ b/client/src/components/musicVideo/ProjectOptionsPanel.jsx
@@ -5,11 +5,10 @@ import RecordRenderPinRow from '../imageGen/RecordRenderPinRow.jsx';
import ToggleChip from '../ui/ToggleChip.jsx';
import Pill from '../ui/Pill.jsx';
import { RenderStyleSelect } from './ProjectActionGroups.jsx';
-import { renderStyleLabel, compositionDraft, RENDER_STYLE_HELP } from './compositionDraft.js';
+import { compositionDraft, RENDER_STYLE_HELP } from './compositionDraft.js';
import { normalizeMusicVideoProductionPolicy } from '../../../../server/lib/musicVideoMediumPlan.js';
import { MUSIC_VIDEO_AUTOMATION_TOOLS, automationDraftFrom, automationFromDraft } from '../../lib/musicVideoAutomation.js';
-import { MUSIC_VIDEO_MEDIA_MODE_LABELS, musicVideoMediaMode } from '../../../../server/lib/musicVideoMediaPolicy.js';
-import { projectServicesSummary } from '../../lib/musicVideoStages.js';
+import { musicVideoMediaMode } from '../../../../server/lib/musicVideoMediaPolicy.js';
import { formatUsd } from '../../utils/formatters.js';
const TOOL_GROUPS = [['image', 'Image'], ['video', 'Video'], ['code', 'Code']];
@@ -17,22 +16,13 @@ const rowCls = 'grid min-w-0 grid-cols-1 gap-1 sm:grid-cols-[9rem_minmax(0,1fr)]
const headCls = 'pt-1.5 text-xs font-medium text-port-text-muted';
/** One line naming the project's options, for the folded Setup section's summary. */
-export function projectOptionsSummary(project) {
- return [
- project?.automation ? 'Autopilot' : 'Director',
- MUSIC_VIDEO_MEDIA_MODE_LABELS[musicVideoMediaMode(project)],
- renderStyleLabel(project?.composition?.mode),
- projectServicesSummary(project),
- ].join(' · ');
-}
-
/**
- * Setup's "Project options": what kind of project this is and which services it
+ * Project settings › Project: what kind of project this is and which services it
* renders with, each editable in place — the workflow (autopilot or hands-on),
* the media the design may use (code / images / video), the render style, the
* image and video services, and, for an autopilot project, the tools the
* autopilot may spend on and its Cast & Sets check-in. Every change saves to the
- * project through the same paths the Produce and Compose controls use.
+ * project through the same paths the Make step's controls use.
*/
export default function ProjectOptionsPanel({
project, videoSettings, generatingVideos = false, onMediaMode, onRenderStyle, onSaveAutomation, onSavePolicy,
diff --git a/client/src/components/musicVideo/ProjectSettingsDrawer.jsx b/client/src/components/musicVideo/ProjectSettingsDrawer.jsx
new file mode 100644
index 0000000000..39edbce341
--- /dev/null
+++ b/client/src/components/musicVideo/ProjectSettingsDrawer.jsx
@@ -0,0 +1,118 @@
+import { Bot, FolderOpen, Music, SlidersHorizontal } from 'lucide-react';
+import Drawer from '../Drawer.jsx';
+import ProjectOptionsPanel from './ProjectOptionsPanel.jsx';
+import SongRevisionPanel from './SongRevisionPanel.jsx';
+import { AdvancedTrackControls } from './TrackPanel.jsx';
+import AudioTimingPanel from './AudioTimingPanel.jsx';
+import { MidiAction } from './ProjectActionGroups.jsx';
+import AutonomousRunPanel from './AutonomousRunPanel.jsx';
+import AutopilotPanel from './AutopilotPanel.jsx';
+import DevArtifactsPanel from './DevArtifactsPanel.jsx';
+import HandoffControls from './HandoffControls.jsx';
+import MakingOfExportPanel from './MakingOfExportPanel.jsx';
+
+const SETTINGS_TABS = [
+ { id: 'project', label: 'Project', icon: SlidersHorizontal },
+ { id: 'audio', label: 'Audio', icon: Music },
+ { id: 'autopilot', label: 'Autopilot', icon: Bot },
+ { id: 'files', label: 'Files', icon: FolderOpen },
+];
+export const SETTINGS_TAB_IDS = SETTINGS_TABS.map((tab) => tab.id);
+
+/**
+ * Everything that configures the project rather than moving it forward — kept
+ * out of the six steps so each step shows only its own work: the render style,
+ * media and services (Project), song forks, stems, MIDI and timing revisions
+ * (Audio), the automation brief, production runs and the autonomous run log
+ * (Autopilot), and every development file, the external handoff and the
+ * making-of export (Files). `tab` is the open tab, held in the page URL.
+ */
+export default function ProjectSettingsDrawer({ open, tab, onTabChange, onClose, board }) {
+ if (!board) return null;
+ const { project, locked, tracks, renderBound, midiBound, separation, midi, takes } = board;
+ return (
+ <Drawer
+ open={open}
+ onClose={onClose}
+ title="Project settings"
+ subtitle={project.name}
+ size="lg"
+ tabs={SETTINGS_TABS}
+ activeTab={tab}
+ onTabChange={onTabChange}
+ closeLabel="Close project settings"
+ >
+ {tab === 'project' && (
+ <ProjectOptionsPanel
+ project={project}
+ videoSettings={board.videoSettings}
+ generatingVideos={Object.keys(board.sceneMedia?.genVideoScenes || {}).length > 0}
+ onMediaMode={board.saveMediaMode}
+ onRenderStyle={board.onRenderStyle}
+ onSaveAutomation={board.saveAutomation}
+ onSavePolicy={(productionPolicy) => board.saveCreativeSetup({ productionPolicy })}
+ />
+ )}
+ {tab === 'audio' && (
+ <div className="space-y-3">
+ <SongRevisionPanel key={`song-${project.id}`} project={project} tracks={tracks} onUpdated={board.replaceProject} onFork={board.onForkSong} disabled={locked || renderBound || midiBound} />
+ <fieldset disabled={locked} className="min-w-0 space-y-2">
+ <AdvancedTrackControls project={project} tracks={tracks} renderBound={renderBound} onProjectUpdated={board.replaceProject} separation={separation} />
+ <MidiAction project={project} midi={midi} midiBound={midiBound} />
+ </fieldset>
+ <AudioTimingPanel key={`timing-${project.id}`} project={project} tracks={tracks} onApplied={board.replaceProject} disabled={locked || renderBound} />
+ </div>
+ )}
+ {tab === 'autopilot' && (
+ <div className="space-y-3">
+ {board.autopilotRun && (
+ <AutonomousRunPanel
+ key={`autonomous-${project.id}`}
+ project={project}
+ auto={board.autonomous}
+ readiness={board.productionReadiness}
+ selectedStage={board.runStage}
+ onSelectStage={board.onSelectStage}
+ framed
+ />
+ )}
+ <fieldset disabled={locked} className="min-w-0">
+ <AutopilotPanel
+ key={`autopilot-${project.id}`}
+ project={project}
+ production={board.production}
+ readiness={board.productionReadiness}
+ onSave={board.saveAutomation}
+ onKickoff={board.onKickoff}
+ onCancelKickoff={board.kickoff.running ? board.kickoff.cancel : undefined}
+ kickoffBusy={board.busy.analyzing || board.busy.planning || board.kickoff.running}
+ kickoffStep={board.kickoff.stepLabel}
+ kickoffBlockedReason={board.autopilotBlockedReason}
+ />
+ </fieldset>
+ </div>
+ )}
+ {tab === 'files' && (
+ <div className="space-y-3">
+ <div id="mv-review-development">
+ <DevArtifactsPanel project={project} busy={board.devArtifacts.busy} onOpen={board.openArtifact} onUpload={board.onUploadArtifact} />
+ </div>
+ <section aria-label="External handoff" className="space-y-2">
+ <h3 className="text-sm font-medium">External handoff</h3>
+ <HandoffControls
+ projectId={project.id}
+ busy={takes.busy}
+ onExport={takes.exportHandoff}
+ onExportBundle={takes.exportHandoffBundle}
+ onImport={takes.importHandoffFiles}
+ />
+ </section>
+ <section aria-label="Making-of export" className="space-y-2">
+ <h3 className="text-sm font-medium">Making-of export</h3>
+ <MakingOfExportPanel project={project} />
+ </section>
+ </div>
+ )}
+ </Drawer>
+ );
+}
diff --git a/client/src/components/musicVideo/ReviewDraftPanel.jsx b/client/src/components/musicVideo/ReviewDraftPanel.jsx
index 43a40712e5..44ac1f4ff4 100644
--- a/client/src/components/musicVideo/ReviewDraftPanel.jsx
+++ b/client/src/components/musicVideo/ReviewDraftPanel.jsx
@@ -6,7 +6,7 @@ export default function ReviewDraftPanel({ project, onOpen, draftState }) {
const localState = useMusicVideoReviewDraft(project, { enabled: !draftState });
const { draft, checking, unavailableCount } = draftState || localState;
if (checking) return <p role="status">Finding an available review draft…</p>;
- if (!draft) return unavailableCount ? <p role="alert">Imported drafts are unavailable. Choose an available development file below.</p> : null;
+ if (!draft) return unavailableCount ? <p role="alert">Imported drafts are unavailable. Choose an available development file in Project settings › Files.</p> : null;
const artifact = project.devArtifacts.find(item => item.id === draft.artifactId);
return <section aria-label="Imported review draft" className="min-w-0 space-y-2 rounded-lg border border-port-border bg-port-card p-3">
<div className="flex flex-wrap items-center justify-between gap-2">
diff --git a/client/src/components/musicVideo/ShotStatusStrip.jsx b/client/src/components/musicVideo/ShotStatusStrip.jsx
index 7f8397054b..3d5ed6c3d7 100644
--- a/client/src/components/musicVideo/ShotStatusStrip.jsx
+++ b/client/src/components/musicVideo/ShotStatusStrip.jsx
@@ -4,7 +4,7 @@ import { SCENE_ATTENTION_LABELS, sceneAttention } from '../../lib/musicVideoScen
/**
* One compact cell per shot, from the same `sceneAttention` answer the Board's
* scene rows use: green when nothing needs doing, amber otherwise, with the
- * reasons in the tooltip. Each cell opens that scene on the Board.
+ * reasons in the tooltip. Each cell opens that scene on the Storyboard.
*/
export default function ShotStatusStrip({ projectId, scenes, ctx }) {
if (!scenes?.length) return null;
diff --git a/client/src/components/musicVideo/SongRevisionPanel.jsx b/client/src/components/musicVideo/SongRevisionPanel.jsx
index c67f267601..cc93efa750 100644
--- a/client/src/components/musicVideo/SongRevisionPanel.jsx
+++ b/client/src/components/musicVideo/SongRevisionPanel.jsx
@@ -94,10 +94,10 @@ export default function SongRevisionPanel({ project, tracks = [], onUpdated, onF
{revision.status === 'selected' && <div className="space-y-2 text-sm" role="status">
<p>New master selected. Art and editable composition source are retained. Beat analysis, lyric alignment, shot timing, proofs and renders need fresh review.</p>
<ol className="list-inside list-decimal space-y-1">
- <li>Analyze the new song and align its lyrics below; verify by listening.</li>
- <li><Link className="text-port-accent" to={`/music-video/${project.id}/board`}>Review shot timing and retained or revised art on the Board.</Link></li>
- <li><Link className="text-port-accent" to={`/music-video/${project.id}/compose`}>Regenerate or reimport the composition against the new audio.</Link> Imported source can contain a fuller timeline than the Board; revise that source too.</li>
- <li><Link className="text-port-accent" to={`/music-video/${project.id}/review`}>Rebuild and review proofs before the full video.</Link></li>
+ <li><Link className="text-port-accent" to={`/music-video/${project.id}/setup#mv-lyric-timing`}>Analyze the new song and align its lyrics on the Song step; verify by listening.</Link></li>
+ <li><Link className="text-port-accent" to={`/music-video/${project.id}/board`}>Review shot timing and retained or revised art on the Storyboard.</Link></li>
+ <li><Link className="text-port-accent" to={`/music-video/${project.id}/produce#mv-composition`}>Regenerate or reimport the composition against the new audio.</Link> Imported source can contain a fuller timeline than the Storyboard; revise that source too.</li>
+ <li><Link className="text-port-accent" to={`/music-video/${project.id}/produce#mv-review-proof`}>Rebuild and review proofs before the full video.</Link></li>
</ol>
</div>}
</>}
diff --git a/client/src/components/musicVideo/SongRevisionPanel.test.jsx b/client/src/components/musicVideo/SongRevisionPanel.test.jsx
index b79ee3b3cc..e933800c3a 100644
--- a/client/src/components/musicVideo/SongRevisionPanel.test.jsx
+++ b/client/src/components/musicVideo/SongRevisionPanel.test.jsx
@@ -32,7 +32,9 @@ describe('song revision UI', () => {
const select = await screen.findByRole('button', { name: 'Use candidate 1' });
expect(select).toBeDisabled(); fireEvent.play(screen.getByLabelText('Listen to candidate 1')); fireEvent.click(select);
expect(await screen.findByText(/New master selected/)).toBeInTheDocument();
- expect(screen.getByRole('link', { name: /Regenerate or reimport/ })).toHaveAttribute('href', '/music-video/fork/compose');
+ expect(screen.getByRole('link', { name: /Regenerate or reimport/ })).toHaveAttribute('href', '/music-video/fork/produce#mv-composition');
+ expect(screen.getByRole('link', { name: /align its lyrics on the Song step/ })).toHaveAttribute('href', '/music-video/fork/setup#mv-lyric-timing');
+ expect(screen.getByRole('link', { name: /Rebuild and review proofs/ })).toHaveAttribute('href', '/music-video/fork/produce#mv-review-proof');
expect(api.act.mock.calls.map((call) => call[1])).toEqual(['generate', 'select']);
});
it('recovers a revision completed while Setup was closed and adopts its saved fields', async () => {
diff --git a/client/src/components/musicVideo/StoryboardAnimatic.jsx b/client/src/components/musicVideo/StoryboardAnimatic.jsx
new file mode 100644
index 0000000000..fe11c5e89d
--- /dev/null
+++ b/client/src/components/musicVideo/StoryboardAnimatic.jsx
@@ -0,0 +1,66 @@
+import { useEffect, useRef, useState } from 'react';
+import { formatDurationSec } from '../../utils/formatters.js';
+
+const timedShots = (scenes) => scenes.filter((scene) => Number.isFinite(scene?.startSec)).sort((a, b) => a.startSec - b.startSec);
+
+/** The shot on screen at song time `t`: the last one that has started. */
+export function shotAt(scenes, t) {
+ const timed = timedShots(scenes);
+ let current = timed[0] || null;
+ for (const scene of timed) {
+ if (scene.startSec <= t) current = scene;
+ else break;
+ }
+ return current;
+}
+
+/**
+ * Something to watch before anything is rendered: the master song under the
+ * storyboard, showing each shot's selected frame (or, without one, its label,
+ * time and intent) as the song reaches it. `seekRequest` (`{ t, n }`) is the
+ * scene-card seek the other preview sources honour too.
+ */
+export default function StoryboardAnimatic({ project, audioUrl, seekRequest, collapsed }) {
+ const audioRef = useRef(null);
+ const applied = useRef(null);
+ const [time, setTime] = useState(0);
+ const scenes = project.scenes || [];
+ useEffect(() => {
+ if (!seekRequest || applied.current === seekRequest.n || !audioRef.current) return;
+ applied.current = seekRequest.n;
+ audioRef.current.currentTime = seekRequest.t;
+ setTime(seekRequest.t);
+ }, [seekRequest]);
+ const shot = shotAt(scenes, time);
+ const timed = timedShots(scenes);
+ const index = shot ? timed.indexOf(shot) : -1;
+ return (
+ <div className={`space-y-2 ${collapsed ? 'max-xl:hidden' : ''}`}>
+ <figure aria-label="Storyboard animatic" className="relative aspect-video w-full overflow-hidden rounded border border-port-border bg-black">
+ {shot?.referenceImageId ? (
+ <img src={`/data/images/${shot.referenceImageId}`} alt="" className="h-full w-full object-contain" />
+ ) : (
+ <div className="flex h-full w-full flex-col items-center justify-center gap-1 p-4 text-center">
+ <span className="text-sm font-medium text-port-text">{shot ? shot.label || `Shot ${index + 1}` : 'No shots yet'}</span>
+ {shot?.visualIntent && <span className="line-clamp-3 text-xs text-port-text-muted">{shot.visualIntent}</span>}
+ </div>
+ )}
+ {shot && (
+ <figcaption className="port-media-overlay absolute bottom-1 left-1 rounded px-1.5 py-0.5 text-[11px]">
+ Shot {index + 1} of {timed.length} · {formatDurationSec(shot.startSec)}
+ </figcaption>
+ )}
+ </figure>
+ <audio
+ ref={audioRef}
+ src={audioUrl}
+ controls
+ preload="metadata"
+ aria-label="Song for the storyboard animatic"
+ onTimeUpdate={(e) => setTime(e.currentTarget.currentTime)}
+ onSeeked={(e) => setTime(e.currentTarget.currentTime)}
+ className="w-full"
+ />
+ </div>
+ );
+}
diff --git a/client/src/components/musicVideo/StoryboardAnimatic.test.jsx b/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
new file mode 100644
index 0000000000..59586e9822
--- /dev/null
+++ b/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
@@ -0,0 +1,30 @@
+import { describe, expect, it } from 'vitest';
+import { fireEvent, render, screen } from '@testing-library/react';
+import StoryboardAnimatic, { shotAt } from './StoryboardAnimatic.jsx';
+
+const scenes = [
+ { sceneId: 'b', label: 'Chorus', startSec: 10, endSec: 20, referenceImageId: 'frame-b.png' },
+ { sceneId: 'a', label: 'Opening', startSec: 0, endSec: 10, visualIntent: 'Lights come up' },
+];
+
+describe('StoryboardAnimatic', () => {
+ it('picks the last shot that has started at a song time', () => {
+ expect(shotAt(scenes, 0).sceneId).toBe('a');
+ expect(shotAt(scenes, 9.9).sceneId).toBe('a');
+ expect(shotAt(scenes, 10).sceneId).toBe('b');
+ expect(shotAt(scenes, 300).sceneId).toBe('b');
+ expect(shotAt([], 3)).toBeNull();
+ });
+
+ it('shows the shot card, then its frame, as the song plays', () => {
+ const { container } = render(<StoryboardAnimatic project={{ id: 'p', scenes }} audioUrl="/song.mp3" />);
+ expect(screen.getByText('Opening')).toBeTruthy();
+ expect(screen.getByText('Lights come up')).toBeTruthy();
+ expect(screen.getByText('Shot 1 of 2 · 0:00')).toBeTruthy();
+ const audio = screen.getByLabelText('Song for the storyboard animatic');
+ Object.defineProperty(audio, 'currentTime', { value: 12, configurable: true });
+ fireEvent.timeUpdate(audio);
+ expect(container.querySelector('img').getAttribute('src')).toBe('/data/images/frame-b.png');
+ expect(screen.getByText('Shot 2 of 2 · 0:10')).toBeTruthy();
+ });
+});
diff --git a/client/src/components/musicVideo/TreatmentPanel.jsx b/client/src/components/musicVideo/TreatmentPanel.jsx
index 5f41a9cbaa..d302e8c36d 100644
--- a/client/src/components/musicVideo/TreatmentPanel.jsx
+++ b/client/src/components/musicVideo/TreatmentPanel.jsx
@@ -65,16 +65,14 @@ export function treatmentSummary(project) {
* "Draft without AI" makes no provider call at all. Keyed by project id at the
* call site so a field draft never carries across projects.
*
- * `part` splits it by what each piece depends on: the brief (what the planner
- * reads) belongs in Setup, while compile / arc / shot direction / Apply need
- * scenes and live on the Board. Omit it to render both. The caller supplies
- * the collapsible section, so there is no fold of its own here.
+ * The brief (what the planner reads) needs no scenes, so it is always shown;
+ * compile / arc / shot direction / Apply need them and wait until shots are
+ * planned. The Storyboard step supplies the collapsible section, so there is
+ * no fold of its own here.
* `storyboardApproved` (from the server's readiness) warns that any treatment
* edit will need the storyboard re-approved (#10141).
*/
-export default function TreatmentPanel({ project, treatment: api, part = 'all', storyboardApproved = false }) {
- const showBrief = part !== 'direction';
- const showDirection = part !== 'brief';
+export default function TreatmentPanel({ project, treatment: api, storyboardApproved = false }) {
const hasScenes = (project.scenes || []).length > 0;
const t = project.treatment || null;
const brief = t?.brief || {};
@@ -116,8 +114,7 @@ export default function TreatmentPanel({ project, treatment: api, part = 'all',
The storyboard is approved. Editing the treatment will need re-approval of the storyboard.
</p>
)}
- {showBrief && (
- <>
+ <>
<div className="grid grid-cols-1 md:grid-cols-2 gap-2">
<BriefField id={idFor('audience')} label="Audience" value={brief.audience} maxLength={500}
placeholder="Who this is for — e.g. late-night city pop fans" onCommit={(v) => saveBrief({ audience: v })} />
@@ -182,19 +179,16 @@ export default function TreatmentPanel({ project, treatment: api, part = 'all',
</button>
</div>
</div>
- {part === 'brief' && (
- <p className="text-xs text-port-text-muted">
- The planner reads this brief when it plans shots. Compile the arc, direct each shot and apply it on the Board.
- </p>
- )}
- </>
- )}
+ <p className="text-xs text-port-text-muted">
+ The planner reads this brief when it plans shots.
+ </p>
+ </>
- {showDirection && !hasScenes && (
- <p className="text-sm text-port-text-muted">Plan shots on the Board to direct them — the treatment's shot direction needs scenes to direct.</p>
+ {!hasScenes && (
+ <p className="text-sm text-port-text-muted">Plan the shots to direct them one by one.</p>
)}
- {showDirection && hasScenes && (
+ {hasScenes && (
<>
<div className="flex flex-wrap items-center gap-2">
{providers.length > 0 && (
diff --git a/client/src/components/musicVideo/TreatmentPanel.test.jsx b/client/src/components/musicVideo/TreatmentPanel.test.jsx
index 07c168f8b3..284f80ba6a 100644
--- a/client/src/components/musicVideo/TreatmentPanel.test.jsx
+++ b/client/src/components/musicVideo/TreatmentPanel.test.jsx
@@ -241,30 +241,26 @@ it('shows union totals and explicit exceptions before Apply, and pins a director
expect(screen.getByText(/generated video 10 \/ 20 seconds/)).toBeTruthy();
});
-describe('TreatmentPanel split by dependency', () => {
+describe('TreatmentPanel brief and direction', () => {
const noop = { save: vi.fn(), compile: vi.fn(), compiling: false };
- it('Setup (brief) shows the brief without a fold or compile controls, and points to the Board', () => {
- const { container } = render(<TreatmentPanel project={PROJECT} treatment={noop} part="brief" />);
+ it('shows the brief without a fold before any shots, and explains what direction needs instead of compiling 0 shots', () => {
+ const { container } = render(<TreatmentPanel project={{ ...PROJECT, scenes: [] }} treatment={noop} />);
expect(container.querySelector('details')).toBeNull();
expect(screen.getByLabelText('Audience')).toBeTruthy();
+ expect(screen.getByText('The planner reads this brief when it plans shots.')).toBeTruthy();
+ expect(screen.getByText('Plan the shots to direct them one by one.')).toBeTruthy();
expect(screen.queryByText('Draft without AI')).toBeNull();
- expect(screen.getByText(/on the Board/)).toBeTruthy();
});
- it('the Board half explains what is needed instead of compiling 0 shots', () => {
- render(<TreatmentPanel project={{ ...PROJECT, scenes: [] }} treatment={noop} part="direction" />);
- expect(screen.getByText(/Plan shots on the Board to direct them/)).toBeTruthy();
- expect(screen.queryByText('Draft without AI')).toBeNull();
- expect(screen.queryByLabelText('Audience')).toBeNull();
- });
- it('the Board half offers compile once scenes exist', () => {
- render(<TreatmentPanel project={PROJECT} treatment={noop} part="direction" />);
+ it('offers compile beside the brief once scenes exist', () => {
+ render(<TreatmentPanel project={PROJECT} treatment={noop} />);
expect(screen.getByText('Draft without AI')).toBeTruthy();
- expect(screen.queryByLabelText('Audience')).toBeNull();
+ expect(screen.getByLabelText('Audience')).toBeTruthy();
+ expect(screen.queryByText('Plan the shots to direct them one by one.')).toBeNull();
});
it('warns before a treatment edit that an approved storyboard will need re-approval (#10141)', () => {
- const { rerender } = render(<TreatmentPanel project={PROJECT} treatment={noop} part="brief" storyboardApproved />);
+ const { rerender } = render(<TreatmentPanel project={PROJECT} treatment={noop} storyboardApproved />);
expect(screen.getByRole('note')).toHaveTextContent('Editing the treatment will need re-approval of the storyboard');
- rerender(<TreatmentPanel project={PROJECT} treatment={noop} part="brief" />);
+ rerender(<TreatmentPanel project={PROJECT} treatment={noop} />);
expect(screen.queryByRole('note')).toBeNull();
});
it('summarizes revision, applied state and gaps for the section header', () => {
diff --git a/client/src/components/musicVideo/TypographyPanel.jsx b/client/src/components/musicVideo/TypographyPanel.jsx
index 0dea977a3f..9640b74b1f 100644
--- a/client/src/components/musicVideo/TypographyPanel.jsx
+++ b/client/src/components/musicVideo/TypographyPanel.jsx
@@ -84,7 +84,7 @@ export default function TypographyPanel({ project, onEditLocal, onSave }) {
</div>
{composed && cues.length === 0 && <p className="mt-2 text-port-text-muted">No text cues yet — a composed render with none renders as plain cuts.</p>}
- {footage && cues.length > 0 && <p className="mt-2 text-port-warning" role="status">Footage renders plain cuts, so these text cues will not appear. Choose Composed in Setup to lay them over the footage.</p>}
+ {footage && cues.length > 0 && <p className="mt-2 text-port-warning" role="status">Footage renders plain cuts, so these text cues will not appear. Choose Composed in Project settings to lay them over the footage.</p>}
{codeMode && <p className="mt-2 text-port-text-muted">Code-rendered draws the song in code. Text cues stay stored and come back if you switch to Composed.</p>}
{composition.mode === 'document' && <p className="mt-2 text-port-text-muted">The composition document reads these cues from <code>PORTOS_MV.textCues</code>: the layered template draws Hero cues as kinetic words on their sung times and uses Subtitle cues (or, with none, the timed lyrics) as subtitles.</p>}
<div className="mt-2 max-h-72 overflow-y-auto space-y-1 pr-1">
diff --git a/client/src/components/musicVideo/compositionDraft.js b/client/src/components/musicVideo/compositionDraft.js
index 0d05f478e9..3d5db998fb 100644
--- a/client/src/components/musicVideo/compositionDraft.js
+++ b/client/src/components/musicVideo/compositionDraft.js
@@ -19,7 +19,7 @@ export const RENDER_STYLE_HELP = {
concat: 'Cuts the generated footage as is: needs footage generation, no live preview, output follows the clips. Typography cues do not render.',
composed: 'Lays timed text over the generated footage: needs footage generation, no live preview, output follows the clips.',
code: 'Draws the song in code with no footage: no generation needed, no live preview, limited 720p Canvas output.',
- document: 'Renders your composition document (Three.js or Canvas): no footage required, live preview in Compose, 1080p at 24 fps by default.',
+ document: 'Renders your composition document (Three.js or Canvas): no footage required, live preview in Make, 1080p at 24 fps by default.',
eidoverse: 'Renders an Eidoverse scene from a saved script: no footage required, no live preview, needs a track analyzed first.',
};
diff --git a/client/src/components/musicVideo/stages/BoardStage.jsx b/client/src/components/musicVideo/stages/BoardStage.jsx
index a3f106b909..03e45bfcc7 100644
--- a/client/src/components/musicVideo/stages/BoardStage.jsx
+++ b/client/src/components/musicVideo/stages/BoardStage.jsx
@@ -18,7 +18,8 @@ const FILTER_LABELS = [['all', 'All'], ['attention', 'Needs attention'], ['missi
const isTypingTarget = (el) => !!el && (el.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(el.tagName));
/**
- * Board: plan and arrange the shots, the beat timeline, and the scene cards —
+ * Storyboard: the treatment (the brief the planner reads, then per-shot
+ * direction), planning tools, the beat timeline, and the scene cards —
* one column on a phone, two and three as the column widens (a container
* query, so the docked preview narrowing the column is accounted for). Cards
* are collapsed to a thumbnail, lyric and status until tapped.
@@ -99,9 +100,12 @@ export default function BoardStage({ board }) {
<ShotPacingFields project={project} onEditLocal={board.editProjectLocal} onSave={board.saveProjectFields} />
</StageSection>
- <StageSection id="mv-board-treatment" title="Treatment" summary={scenes.length ? treatmentSummary(project) : 'Plan shots to direct them'}>
- <TreatmentPanel key={`treatment-${project.id}`} project={project} treatment={treatment} part="direction"
- storyboardApproved={!!board.productionReadiness?.storyboard?.approved} />
+ {/* The brief feeds the shot planner; the direction is applied per shot once they exist. */}
+ <StageSection id="mv-board-treatment" title="Treatment" summary={scenes.length ? treatmentSummary(project) : 'Write the brief the shot planner follows'}>
+ <div id="mv-setup-treatment">
+ <TreatmentPanel key={`treatment-${project.id}`} project={project} treatment={treatment}
+ storyboardApproved={!!board.productionReadiness?.storyboard?.approved} />
+ </div>
</StageSection>
{project.audioAnalysis && scenes.length > 0 && (
diff --git a/client/src/components/musicVideo/stages/CastSetsStage.jsx b/client/src/components/musicVideo/stages/CastSetsStage.jsx
index acb0f7f48b..b46fd2f191 100644
--- a/client/src/components/musicVideo/stages/CastSetsStage.jsx
+++ b/client/src/components/musicVideo/stages/CastSetsStage.jsx
@@ -1,14 +1,84 @@
import CastAndSetsCheckin from '../CastAndSetsCheckin.jsx';
import DevArtifactsPanel from '../DevArtifactsPanel.jsx';
+import StageSection from '../StageSection.jsx';
+import CreativeSetupPanel from '../CreativeSetupPanel.jsx';
+import LookReferencesPanel from '../LookReferencesPanel.jsx';
+import VisualSpecPanel from '../VisualSpecPanel.jsx';
+import AutoSizeTextarea from '../../ui/AutoSizeTextarea';
+import { formatCount } from '../../../utils/formatters.js';
+
+const directionSummary = (project) => {
+ const refs = (project.visualSpec?.references || []).length + (project.styleReferences || []).length;
+ return [
+ project.concept?.prompt?.trim() ? 'Concept written' : 'No concept yet',
+ project.concept?.style?.trim() ? 'Style set' : 'No style yet',
+ refs ? `${formatCount(refs)} look ${refs === 1 ? 'reference' : 'references'}` : 'No look references',
+ ].join(' · ');
+};
+
+/** Concept, style, universe and look references: what the cast and sets are built from. */
+function CreativeDirection({ board }) {
+ const { project, locked, conceptDraft, styleDraft } = board;
+ return (
+ <>
+ <CreativeSetupPanel
+ key={`creative-${project.id}`}
+ project={project}
+ onPendingChange={board.setCreativeSetupPending}
+ onSave={board.saveCreativeSetup}
+ />
+ <LookReferencesPanel key={`look-${project.id}`} project={project}
+ onSave={board.saveStyleReferences} onSaveSpec={board.saveVisualSpec} onAddReference={board.onAddReference}
+ onPendingChange={board.setStyleReferencesPending} />
+ <fieldset disabled={locked} className="min-w-0 space-y-2">
+ <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
+ <div>
+ <label htmlFor="mv-concept" className="mb-1 block text-xs text-port-text-muted">Concept</label>
+ <AutoSizeTextarea
+ id="mv-concept"
+ value={conceptDraft.value}
+ rows={2}
+ maxLength={8000}
+ onChange={conceptDraft.onChange}
+ onBlur={conceptDraft.onBlur}
+ placeholder="What the video is about: story, theme or thread for the plan to build on."
+ className="min-h-[44px] w-full rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm"
+ />
+ </div>
+ <div>
+ <label htmlFor="mv-style" className="mb-1 block text-xs text-port-text-muted">Visual style</label>
+ <AutoSizeTextarea
+ id="mv-style"
+ value={styleDraft.value}
+ rows={2}
+ maxLength={2000}
+ onChange={styleDraft.onChange}
+ onBlur={styleDraft.onBlur}
+ placeholder="Art style, palette and mood, added to every frame and shot prompt."
+ className="min-h-[44px] w-full rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm"
+ />
+ </div>
+ </div>
+ <VisualSpecPanel key={project.id} project={project} onSave={board.saveVisualSpec} />
+ </fieldset>
+ </>
+ );
+}
/**
- * Cast & Sets: the check-in the autopilot stops at before planning — approve,
- * regenerate with notes, resume or skip — and the sheets it saved.
+ * Look: the creative direction the cast and sets are built from, the check-in
+ * the autopilot stops at before planning (approve, regenerate with notes,
+ * resume or skip), and the sheets it saved. The art-direction approval closes
+ * the step at the bottom of the page.
*/
export default function CastSetsStage({ board }) {
const { project, locked, castSets, kickoff } = board;
return (
<div className="min-w-0 space-y-3">
+ <StageSection id="mv-setup-direction" title="Creative direction" summary={directionSummary(project)}
+ defaultOpen={!project.concept?.prompt?.trim() && !project.castAndSets}>
+ <CreativeDirection board={board} />
+ </StageSection>
{project.castAndSets ? (
<CastAndSetsCheckin
project={project}
@@ -26,10 +96,7 @@ export default function CastSetsStage({ board }) {
/>
) : (
<div className="rounded-lg border border-port-border bg-port-card p-3 space-y-3">
- <p className="text-sm text-port-text-muted">
- The cast and sets are built — and stop for your check-in — before the shots are planned.
- Build them now, or skip this stage and work from the sheets you add yourself.
- </p>
+ <p className="text-sm text-port-text-muted">Build the cast and sets from your direction, or skip and add your own sheets.</p>
<div className="flex flex-wrap gap-2">
<button type="button" onClick={() => castSets.start()} disabled={locked || castSets.busy || kickoff.running || !project.audioAnalysis}
title={project.audioAnalysis ? undefined : 'Analyze the track first'}
diff --git a/client/src/components/musicVideo/stages/ProduceStage.jsx b/client/src/components/musicVideo/stages/ProduceStage.jsx
index 89949858ce..7360e5fe8d 100644
--- a/client/src/components/musicVideo/stages/ProduceStage.jsx
+++ b/client/src/components/musicVideo/stages/ProduceStage.jsx
@@ -1,58 +1,44 @@
-import AutopilotPanel from '../AutopilotPanel.jsx';
import ContactSheetButton from '../ContactSheetButton.jsx';
-import HandoffControls from '../HandoffControls.jsx';
import StageSection from '../StageSection.jsx';
import { GenerationActions } from '../ProjectActionGroups.jsx';
import ShotStatusStrip from '../ShotStatusStrip.jsx';
+import CompositionPanel from '../CompositionPanel.jsx';
import { isLayeredComposition } from '../../../lib/musicVideoLayers.js';
import { FOOTAGE_OPTIONAL_MODES } from '../../../lib/musicVideoStages.js';
/**
- * Produce: the autopilot (brief, allowed routes, generation and spend caps,
- * the run log) and the manual "generate what's missing" frame and clip
- * buttons. Which image and video services they render on is a project
- * option, set in Setup.
+ * Make: the picture for every shot, then the composition over it. A render
+ * style that draws its own picture (code, document, Eidoverse) keeps the
+ * footage tools folded, since footage is optional there. The animated proof that closes the step sits at the bottom of
+ * the page with the other approvals; the autopilot and production runs live in
+ * Project settings › Autopilot.
*/
export default function ProduceStage({ board }) {
- const { project, locked, production, videoSettings, sceneMedia, kickoff, takes } = board;
+ const { project, locked, videoSettings, sceneMedia } = board;
+ const footageOptional = FOOTAGE_OPTIONAL_MODES.has(project.composition?.mode || 'concat');
+ const hasScenes = (project.scenes || []).length > 0;
return (
- <fieldset disabled={locked} className="min-w-0 space-y-3">
- <AutopilotPanel
- key={`autopilot-${project.id}`}
- project={project}
- production={production}
- readiness={board.productionReadiness}
- onSave={board.saveAutomation}
- onKickoff={board.onKickoff}
- onCancelKickoff={kickoff.running ? kickoff.cancel : undefined}
- kickoffBusy={board.busy.analyzing || board.busy.planning || kickoff.running}
- kickoffStep={kickoff.stepLabel}
- kickoffBlockedReason={board.autopilotBlockedReason}
- />
- {(project.scenes || []).length > 0 && (
- <StageSection title="Shot status" defaultOpen summary="Which shots still need work — tap one to open it on the Board">
- <ShotStatusStrip projectId={project.id} scenes={project.scenes} ctx={{
- layered: isLayeredComposition(project),
- footageOptional: FOOTAGE_OPTIONAL_MODES.has(project.composition?.mode || 'concat'),
- lipSyncBackend: videoSettings.audioReactiveSelected ? 'local' : videoSettings.settings.backend,
- songDurationSec: project.audioAnalysis?.durationSec ?? null,
- failed: sceneMedia.failedScenes,
- }} />
- </StageSection>
- )}
- <StageSection title="Generation" defaultOpen summary="Generate the frames and clips that are missing">
- <div className="mb-2 flex justify-end"><ContactSheetButton onOpen={board.openContactSheet} /></div>
- <GenerationActions project={project} videoSettings={videoSettings} sceneMedia={sceneMedia} onEditServices={() => board.goToStage('setup', 'mv-setup-options')} />
- </StageSection>
- <StageSection title="External handoff" summary="Export prompts, import files made in other tools">
- <HandoffControls
- projectId={project.id}
- busy={takes.busy}
- onExport={takes.exportHandoff}
- onExportBundle={takes.exportHandoffBundle}
- onImport={takes.importHandoffFiles}
- />
- </StageSection>
- </fieldset>
+ <div className="min-w-0 space-y-3">
+ <fieldset disabled={locked} className="min-w-0 space-y-3">
+ <StageSection id="mv-generation" title="Footage" defaultOpen={!footageOptional}
+ summary={footageOptional ? 'Optional for this render style: frames and clips the composition can use' : 'Make the frames and clips each shot still needs'}>
+ {hasScenes && (
+ <ShotStatusStrip projectId={project.id} scenes={project.scenes} ctx={{
+ layered: isLayeredComposition(project),
+ footageOptional,
+ lipSyncBackend: videoSettings.audioReactiveSelected ? 'local' : videoSettings.settings.backend,
+ songDurationSec: project.audioAnalysis?.durationSec ?? null,
+ failed: sceneMedia.failedScenes,
+ }} />
+ )}
+ <div className="flex justify-end"><ContactSheetButton onOpen={board.openContactSheet} /></div>
+ <GenerationActions project={project} videoSettings={videoSettings} sceneMedia={sceneMedia} onEditServices={() => board.openSettings('project')} />
+ </StageSection>
+ </fieldset>
+ <section id="mv-composition" aria-label="Composition" className="min-w-0 space-y-2">
+ <h4 className="text-sm font-medium">Composition</h4>
+ <CompositionPanel board={board} />
+ </section>
+ </div>
);
}
diff --git a/client/src/components/musicVideo/stages/ReviewStage.jsx b/client/src/components/musicVideo/stages/ReviewStage.jsx
index 7a9d88ae81..35d08ca7aa 100644
--- a/client/src/components/musicVideo/stages/ReviewStage.jsx
+++ b/client/src/components/musicVideo/stages/ReviewStage.jsx
@@ -2,8 +2,6 @@ import SharingCopyPanel from '../SharingCopyPanel.jsx';
import DependencyImpactPanel from '../DependencyImpactPanel.jsx';
import RenderStatusPanel, { RenderFailure } from '../RenderStatusPanel.jsx';
import ExcerptPanel from '../ExcerptPanel.jsx';
-import DevArtifactsPanel from '../DevArtifactsPanel.jsx';
-import MakingOfExportPanel from '../MakingOfExportPanel.jsx';
import StageSection from '../StageSection.jsx';
import { isFinalRenderStale } from '../../../lib/musicVideoStages.js';
import { RenderFinalButton } from '../ProjectActionGroups.jsx';
@@ -11,23 +9,22 @@ import ReviewDraftPanel from '../ReviewDraftPanel.jsx';
import { latestMusicVideoReviewDraft } from '../../../../../server/lib/musicVideoReviewDraft.js';
/**
- * Review & Export: the final render and its player, draft excerpts with review
- * notes, section revision and auto-review (they act on the excerpt window, so
- * they live beside it), and every development file. The external-tool handoff lives on Produce.
+ * Final render: the full render and its player first, then draft excerpts with
+ * review notes, section revision and auto-review (they act on the excerpt
+ * window, so they live beside it), then dependency repair. Development files,
+ * the external handoff and the making-of export are in Project settings › Files.
*/
export default function ReviewStage({ board }) {
const {
- project, locked, renderJob, renderBound, finalVideo, excerpts, revisions, autoReview, sceneMedia, devArtifacts,
+ project, locked, renderJob, renderBound, finalVideo, excerpts, revisions, autoReview, sceneMedia,
} = board;
const hasDraft = !!latestMusicVideoReviewDraft(project);
return (
<fieldset disabled={locked} className="min-w-0 space-y-3">
{!project.renderHistoryId && <ReviewDraftPanel project={project} onOpen={board.openArtifact} draftState={board.reviewDraftState} />}
<RenderFailure project={project} renderJob={renderJob} />
- <StageSection title="Dependency changes and repair"><DependencyImpactPanel project={project} busy={revisions.busy} onRepair={revisions.repair} /></StageSection>
- <StageSection id="mv-final-video" title="Native final render" defaultOpen={!hasDraft || !!project.renderHistoryId || renderBound}>
- <div className="flex flex-wrap items-center justify-between gap-2">
- <h3 className="text-sm font-medium">Final render</h3>
+ <section id="mv-final-video" aria-label="Final render" className="min-w-0 space-y-2 rounded-lg border border-port-border bg-port-card p-3">
+ <div className="flex justify-end">
<RenderFinalButton project={project} renderJob={renderJob} readiness={board.productionReadiness} />
</div>
<RenderStatusPanel
@@ -39,9 +36,9 @@ export default function ReviewStage({ board }) {
onOpenPreview={board.openPreview}
/>
{project.renderHistoryId && <SharingCopyPanel key={`${project.id}:${project.renderHistoryId}`} projectId={project.id} />}
- </StageSection>
+ </section>
- <StageSection title="Excerpt and revision tools" defaultOpen={!hasDraft || excerpts.rendering}>
+ <StageSection title="Drafts and revisions" summary="Render any range to check it, add notes, revise sections" defaultOpen={!hasDraft || excerpts.rendering}>
<ExcerptPanel
project={project}
rendering={excerpts.rendering}
@@ -63,17 +60,7 @@ export default function ReviewStage({ board }) {
/>
</StageSection>
- <div id="mv-review-development"><DevArtifactsPanel
- project={project}
- busy={devArtifacts.busy}
- onOpen={board.openArtifact}
- onUpload={board.onUploadArtifact}
- /></div>
-
- <StageSection title="Making-of export">
- <MakingOfExportPanel project={project} />
- </StageSection>
-
+ <StageSection title="Dependency changes and repair"><DependencyImpactPanel project={project} busy={revisions.busy} onRepair={revisions.repair} /></StageSection>
</fieldset>
);
}
diff --git a/client/src/components/musicVideo/stages/SetupStage.jsx b/client/src/components/musicVideo/stages/SetupStage.jsx
index 0fe17adf1f..dfd83d90b9 100644
--- a/client/src/components/musicVideo/stages/SetupStage.jsx
+++ b/client/src/components/musicVideo/stages/SetupStage.jsx
@@ -1,40 +1,16 @@
import { useState } from 'react';
-import AutonomousRunPanel from '../AutonomousRunPanel.jsx';
-import SongRevisionPanel from '../SongRevisionPanel.jsx';
-import LookReferencesPanel from '../LookReferencesPanel.jsx';
-import AutoSizeTextarea from '../../ui/AutoSizeTextarea';
-import CreativeSetupPanel from '../CreativeSetupPanel.jsx';
-import TrackPanel, { AdvancedTrackControls } from '../TrackPanel.jsx';
-import AudioTimingPanel from '../AudioTimingPanel.jsx';
+import TrackPanel from '../TrackPanel.jsx';
import AnalysisPanel from '../AnalysisPanel.jsx';
import LyricsPanel from '../LyricsPanel.jsx';
-import VisualSpecPanel from '../VisualSpecPanel.jsx';
-import TreatmentPanel, { treatmentSummary } from '../TreatmentPanel.jsx';
-import { AnalyzeAction, MidiAction } from '../ProjectActionGroups.jsx';
-import StageSection from '../StageSection.jsx';
-import ProjectOptionsPanel, { projectOptionsSummary } from '../ProjectOptionsPanel.jsx';
+import LyricTimingCheck from '../LyricTimingCheck.jsx';
+import { AnalyzeAction } from '../ProjectActionGroups.jsx';
import { Check } from 'lucide-react';
import { lyricSetupState, projectHasAudio } from '../../../lib/musicVideoStages.js';
-import { formatCount } from '../../../utils/formatters.js';
-
-const songSummary = (project, trackLabel) => {
- const lines = (project.lyricCues || []).length;
- const aligned = lines > 0 && project.lyricCues.every((cue) => cue.words?.length);
- const lyrics = lyricSetupState(project);
- const lyricText = lines
- ? [`${formatCount(lines)} lyric ${lines === 1 ? 'line' : 'lines'}`, aligned ? 'aligned' : null, lyrics.verified ? 'verified' : null].filter(Boolean).join(' · ')
- : lyrics.instrumental ? 'Instrumental' : 'No lyrics';
- return [
- projectHasAudio(project) ? trackLabel || 'Track attached' : 'No track yet',
- project.audioAnalysis ? 'Analyzed' : 'Not analyzed',
- lyricText,
- ].join(' · ');
-};
/** One numbered step of Song & lyrics, with a done state beside its title. */
-function SongStep({ number, title, done, children }) {
+function SongStep({ id, number, title, done, children }) {
return (
- <section aria-label={`Step ${number}: ${title}`} className="min-w-0 space-y-2 rounded-lg border border-port-border p-2">
+ <section id={id} aria-label={`Step ${number}: ${title}`} className="min-w-0 space-y-2 rounded-lg border border-port-border p-2">
<h3 className="flex items-center gap-2 text-sm font-medium">
<span aria-hidden="true" className={`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs ${done ? 'bg-port-success text-white' : 'bg-port-border text-port-text-muted'}`}>
{done ? <Check size={12} /> : number}
@@ -48,7 +24,7 @@ function SongStep({ number, title, done, children }) {
}
/** Whole-song word alignment; the page's handler is silent, so errors surface here. */
-function AlignWords({ disabled, aligning, status, onAlign }) {
+function AlignWords({ disabled, aligning, status, aligned, onAlign }) {
const [error, setError] = useState('');
const run = () => {
setError('');
@@ -57,11 +33,11 @@ function AlignWords({ disabled, aligning, status, onAlign }) {
return (
<>
<p className="text-xs text-port-text-muted">
- Align each word to the vocal, then listen back to confirm the timing. Word times can be fine-tuned per line in step 3.
+ {aligned ? 'Every word is placed. Listen back, fine-tune any line in step 3, then verify.' : 'Place each word on the vocal, then listen back.'}
</p>
<button type="button" onClick={run} disabled={aligning || disabled}
className="min-h-[44px] rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm text-port-accent disabled:opacity-50 sm:min-h-0">
- {aligning ? 'Aligning…' : 'Align all words'}
+ {aligning ? 'Aligning…' : aligned ? 'Re-align all words' : 'Align all words'}
</button>
{status && (
<div role="status" className="flex flex-wrap items-center gap-2 text-xs text-port-text-muted">
@@ -75,172 +51,73 @@ function AlignWords({ disabled, aligning, status, onAlign }) {
);
}
-const directionSummary = (project) => {
- const refs = (project.visualSpec?.references || []).length + (project.styleReferences || []).length;
- return [
- project.concept?.prompt?.trim() ? 'Concept written' : 'No concept yet',
- project.concept?.style?.trim() ? 'Style set' : 'No style yet',
- refs ? `${formatCount(refs)} look ${refs === 1 ? 'reference' : 'references'}` : 'No look references',
- ].join(' · ');
-};
-
/**
- * Setup, in folded sections so each part reads at a glance: Project options
- * (workflow, media, render style, image/video services, autopilot tools), Song
- * & lyrics (the track, its analysis/MIDI and lyrics), Creative direction
- * (universe, cast, places, mood board, concept & style, visual spec) and the
- * Treatment brief. A section opens by default when it holds the next thing to do;
- * an anchor inside a folded section unfolds it (see the page's hash effect).
+ * Song: the track, its analysis, the lyrics, and their word timing — four
+ * numbered parts, each marked done or to do, all open. Forking or revising the
+ * song, the vocal stem, MIDI and timing revisions live in Project settings ›
+ * Audio; the render style and services in Project settings › Project.
*/
export default function SetupStage({ board }) {
const {
- project, tracks, trackName, audioFilename, locked, youtube, separation, midi, midiBound, renderBound, tempo, busy,
- conceptDraft, styleDraft, importingLyrics, aligningLyrics, alignStatus, treatment,
- autopilotRun, autonomous, runStage, onSelectStage,
+ project, tracks, trackName, audioFilename, locked, youtube, midiBound, renderBound, tempo, busy,
+ importingLyrics, aligningLyrics, alignStatus,
} = board;
- const songOpen = !projectHasAudio(project) || !project.audioAnalysis || !lyricSetupState(project).ok;
const cues = project.lyricCues || [];
const aligned = cues.length > 0 && cues.every((cue) => cue.words?.length);
- const trackLabel = project.trackId ? trackName(project.trackId) : audioFilename;
+ const lyrics = lyricSetupState(project, board.productionReadiness);
return (
- <>
- {autopilotRun && (
- <AutonomousRunPanel
- key={`autonomous-${project.id}`}
- project={project}
- auto={autonomous}
- readiness={board.productionReadiness}
- selectedStage={runStage}
- onSelectStage={onSelectStage}
- framed
- />
- )}
- <StageSection
- id="mv-setup-options"
- title="Project options"
- summary={projectOptionsSummary(project)}
- defaultOpen
- >
- <ProjectOptionsPanel
- project={project}
- videoSettings={board.videoSettings}
- generatingVideos={Object.keys(board.sceneMedia?.genVideoScenes || {}).length > 0}
- onMediaMode={board.saveMediaMode}
- onRenderStyle={board.onRenderStyle}
- onSaveAutomation={board.saveAutomation}
- onSavePolicy={(productionPolicy) => board.saveCreativeSetup({ productionPolicy })}
- />
- </StageSection>
- <StageSection id="mv-setup-song" title="Song & lyrics" summary={songSummary(project, trackLabel)} defaultOpen={songOpen}>
- <fieldset disabled={locked} className="min-w-0">
- <div id="mv-track" className="space-y-2">
- <SongStep number={1} title="Track" done={projectHasAudio(project)}>
- <TrackPanel
- project={project}
- tracks={tracks}
- trackName={trackName}
- audioFilename={audioFilename}
- youtube={youtube}
- renderBound={renderBound}
- midiBound={midiBound}
- onChangeTrack={board.onChangeTrack}
- />
- </SongStep>
- <SongStep number={2} title="Analyze" done={Boolean(project.audioAnalysis)}>
- <AnalyzeAction project={project} busy={busy} onAnalyze={board.onAnalyze} />
- <AnalysisPanel
- audioAnalysis={project.audioAnalysis}
- scenes={project.scenes || []}
- tempo={tempo}
- onReanalyze={board.onAnalyze}
- analyzing={busy.analyzing}
- />
- </SongStep>
- <SongStep number={3} title="Lyrics" done={cues.length > 0}>
- <LyricsPanel
- inline
- project={project}
- onEditLocal={board.editProjectLocal}
- onSave={board.saveProjectFields}
- onImport={board.onImportLyrics}
- onImportTrack={board.onImportTrackLyrics}
- importing={importingLyrics}
- onAlign={board.onAlignLyrics}
- aligning={aligningLyrics}
- />
- </SongStep>
- <SongStep number={4} title="Align & verify" done={aligned}>
- <AlignWords
- disabled={cues.length === 0 || !projectHasAudio(project)}
- aligning={aligningLyrics}
- status={alignStatus}
- onAlign={board.onAlignLyrics}
- />
- </SongStep>
- </div>
- </fieldset>
- <StageSection id="mv-setup-advanced-audio" title="Advanced audio" summary="Fork & revise song, vocal stem, sound bed, MIDI, timing revision">
- <SongRevisionPanel key={`song-${project.id}`} project={project} tracks={tracks} onUpdated={board.replaceProject} onFork={board.onForkSong} disabled={locked || renderBound || midiBound} />
- <fieldset disabled={locked} className="min-w-0 space-y-2">
- <AdvancedTrackControls project={project} tracks={tracks} renderBound={renderBound} onProjectUpdated={board.replaceProject} separation={separation} />
- <MidiAction project={project} midi={midi} midiBound={midiBound} />
- </fieldset>
- <AudioTimingPanel key={`timing-${project.id}`} project={project} tracks={tracks} onApplied={board.replaceProject} disabled={locked || renderBound} />
- </StageSection>
- </StageSection>
- <StageSection id="mv-setup-direction" title="Creative direction" summary={directionSummary(project)}>
- <CreativeSetupPanel
- key={`creative-${project.id}`}
- project={project}
- onPendingChange={board.setCreativeSetupPending}
- onSave={board.saveCreativeSetup}
- />
- <LookReferencesPanel key={`look-${project.id}`} project={project}
- onSave={board.saveStyleReferences} onSaveSpec={board.saveVisualSpec} onAddReference={board.onAddReference}
- onPendingChange={board.setStyleReferencesPending} />
- <fieldset disabled={locked} className="min-w-0 space-y-2">
- {/* Concept & style — global direction for the video */}
- <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
- <div>
- <label htmlFor="mv-concept" className="mb-1 block text-xs text-port-text-muted">Concept</label>
- <AutoSizeTextarea
- id="mv-concept"
- value={conceptDraft.value}
- rows={2}
- maxLength={8000}
- onChange={conceptDraft.onChange}
- onBlur={conceptDraft.onBlur}
- placeholder="What is this video about — story, theme, or narrative thread for the AI plan to build on."
- className="min-h-[44px] w-full rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm"
- />
- </div>
- <div>
- <label htmlFor="mv-style" className="mb-1 block text-xs text-port-text-muted">Visual style</label>
- <AutoSizeTextarea
- id="mv-style"
- value={styleDraft.value}
- rows={2}
- maxLength={2000}
- onChange={styleDraft.onChange}
- onBlur={styleDraft.onBlur}
- placeholder="Art style, references, palette, mood — appended to every generated frame and shot prompt."
- className="min-h-[44px] w-full rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm"
- />
- </div>
- </div>
- <VisualSpecPanel
- key={project.id}
+ <fieldset disabled={locked} className="min-w-0">
+ <div id="mv-track" className="space-y-2">
+ <SongStep number={1} title="Track" done={projectHasAudio(project)}>
+ <TrackPanel
project={project}
- onSave={board.saveVisualSpec}
+ tracks={tracks}
+ trackName={trackName}
+ audioFilename={audioFilename}
+ youtube={youtube}
+ renderBound={renderBound}
+ midiBound={midiBound}
+ onChangeTrack={board.onChangeTrack}
/>
- </fieldset>
- </StageSection>
- <StageSection id="mv-setup-treatment" title="Treatment brief" summary={`${treatmentSummary(project)} · feeds the shot planner`}>
- <fieldset disabled={locked} className="min-w-0">
- <TreatmentPanel key={`treatment-${project.id}`} project={project} treatment={treatment} part="brief"
- storyboardApproved={!!board.productionReadiness?.storyboard?.approved} />
- </fieldset>
- </StageSection>
- </>
+ </SongStep>
+ <SongStep id="mv-analyze" number={2} title="Analyze" done={Boolean(project.audioAnalysis)}>
+ <AnalyzeAction project={project} busy={busy} onAnalyze={board.onAnalyze} />
+ <AnalysisPanel
+ audioAnalysis={project.audioAnalysis}
+ scenes={project.scenes || []}
+ tempo={tempo}
+ onReanalyze={board.onAnalyze}
+ analyzing={busy.analyzing}
+ />
+ </SongStep>
+ <SongStep number={3} title="Lyrics" done={cues.length > 0 || lyrics.instrumental}>
+ <LyricsPanel
+ inline
+ project={project}
+ onEditLocal={board.editProjectLocal}
+ onSave={board.saveProjectFields}
+ onImport={board.onImportLyrics}
+ onImportTrack={board.onImportTrackLyrics}
+ importing={importingLyrics}
+ onAlign={board.onAlignLyrics}
+ aligning={aligningLyrics}
+ />
+ </SongStep>
+ <SongStep number={4} title="Time and verify" done={lyrics.verified || lyrics.ok}>
+ {!lyrics.instrumental && (
+ <AlignWords
+ disabled={cues.length === 0 || !projectHasAudio(project)}
+ aligning={aligningLyrics}
+ status={alignStatus}
+ aligned={aligned}
+ onAlign={board.onAlignLyrics}
+ />
+ )}
+ {board.productionReview && (
+ <LyricTimingCheck project={project} review={board.productionReview} planning={board.planningDraft} disabled={locked} />
+ )}
+ </SongStep>
+ </div>
+ </fieldset>
);
}
diff --git a/client/src/components/musicVideo/stages/SetupStage.test.jsx b/client/src/components/musicVideo/stages/SetupStage.test.jsx
index 271be9fc91..ffc3ca3a0c 100644
--- a/client/src/components/musicVideo/stages/SetupStage.test.jsx
+++ b/client/src/components/musicVideo/stages/SetupStage.test.jsx
@@ -1,44 +1,86 @@
// @vitest-environment happy-dom
import { describe, it, expect, vi } from 'vitest';
-import { render, screen, within } from '@testing-library/react';
+import { fireEvent, render, screen, within } from '@testing-library/react';
import SetupStage from './SetupStage.jsx';
vi.mock('../../songs/MidiVisualization.jsx', () => ({ default: () => null }));
-vi.mock('../ProjectOptionsPanel.jsx', () => ({ default: () => null, projectOptionsSummary: () => '' }));
-vi.mock('../CreativeSetupPanel.jsx', () => ({ default: () => null }));
-vi.mock('../VisualSpecPanel.jsx', () => ({ default: () => null }));
-vi.mock('../TreatmentPanel.jsx', () => ({ default: () => null, treatmentSummary: () => 'Not started' }));
-vi.mock('../VocalStemControl.jsx', () => ({ default: () => <div>vocal-stem</div> }));
-vi.mock('../SoundBedControl.jsx', () => ({ default: () => <div>sound-bed</div> }));
-vi.mock('../SongRevisionPanel.jsx', () => ({ default: () => <div>song-revision</div> }));
-
-const board = (project) => ({
+
+const review = (over = {}) => ({ readiness: null, current: true, busy: false, error: null, save: vi.fn(async () => ({})), reverifyAlignment: vi.fn(async () => ({})), ...over });
+const board = (project, extra = {}) => ({
project, tracks: [], trackName: () => 'Song', tempo: { bpm: '', setBpm: vi.fn() }, audioFilename: 'a.wav', locked: false,
youtube: { editJob: {}, editUrl: '', setEditUrl: vi.fn(), startEdit: vi.fn() },
- midi: { model: 'base', active: false }, busy: {}, conceptDraft: {}, styleDraft: {}, treatment: {},
- onAnalyze: vi.fn(), onAlignLyrics: vi.fn(),
+ midi: { model: 'base', active: false }, busy: {},
+ onAnalyze: vi.fn(), onAlignLyrics: vi.fn(), ...extra,
});
-describe('SetupStage Song & lyrics', () => {
- it('lays out four numbered steps with done states and keeps advanced audio tools in a trailing fold', () => {
- const project = { id: 'p', trackId: 't', audioAnalysis: { durationSec: 10 }, lyricCues: [{ id: 'c', text: 'hi', words: [{ w: 'hi', startSec: 0, endSec: 1 }] }] };
- render(<SetupStage board={board(project)} />);
+describe('Song step', () => {
+ it('lays out four open numbered parts with done states and nothing else', () => {
+ const project = {
+ id: 'p', trackId: 't', audioAnalysis: { durationSec: 10 },
+ lyricCues: [{ id: 'c', text: 'hi', words: [{ w: 'hi', startSec: 0, endSec: 1 }] }],
+ productionReview: { draft: { lyricsMode: 'vocal', timingStatus: 'verified' } },
+ };
+ render(<SetupStage board={board(project, { productionReview: review() })} />);
const steps = screen.getAllByRole('region', { name: /^Step \d/ });
expect(steps.map((s) => s.getAttribute('aria-label'))).toEqual([
- 'Step 1: Track', 'Step 2: Analyze', 'Step 3: Lyrics', 'Step 4: Align & verify',
+ 'Step 1: Track', 'Step 2: Analyze', 'Step 3: Lyrics', 'Step 4: Time and verify',
]);
steps.forEach((s) => expect(within(s).getByText('Done')).toBeTruthy());
- const advanced = document.getElementById('mv-setup-advanced-audio');
- expect(advanced.contains(screen.getByText('vocal-stem'))).toBe(true);
- expect(advanced.contains(screen.getByText('song-revision'))).toBe(true);
- expect(advanced.contains(screen.getByText('Preview audio timing revision'))).toBe(true);
- steps.forEach((s) => expect(advanced.contains(s)).toBe(false));
- // The lyrics editor is inline in step 3, not a nested fold.
- expect(steps[2].contains(within(steps[2]).getByText(/Lyrics & phrases/).closest('details'))).toBe(false);
+ // Advanced audio and project options moved to Project settings; no folds here.
+ expect(document.getElementById('mv-setup-advanced-audio')).toBeNull();
+ expect(document.querySelector('details#mv-setup-song')).toBeNull();
+ expect(within(steps[3]).getByText('Word timing verified against the current master.')).toBeTruthy();
});
- it('marks later steps to do for an empty project', () => {
+ it('marks every part to do for an empty project', () => {
render(<SetupStage board={board({ id: 'p' })} />);
expect(screen.getAllByText('To do')).toHaveLength(4);
});
+
+ it('verifies the timing on the step itself, keeping an unsaved planning draft in step', async () => {
+ const save = vi.fn(async () => ({}));
+ const setPlanning = vi.fn();
+ const project = { id: 'p', trackId: 't', audioAnalysis: {}, lyricCues: [{ id: 'c', text: 'hi', words: [{ w: 'hi' }] }],
+ productionReview: { draft: { cast: 'kept', lyricsMode: 'vocal', timingStatus: 'provisional', timingNotes: '' } } };
+ render(<SetupStage board={board(project, { productionReview: review({ save }), planningDraft: [{ cast: 'edited', lyricsMode: 'vocal' }, setPlanning] })} />);
+ fireEvent.change(screen.getByLabelText(/What you checked/), { target: { value: 'Listened through twice' } });
+ await fireEvent.click(screen.getByRole('button', { name: 'Mark timing verified' }));
+ expect(save).toHaveBeenCalledWith(expect.objectContaining({ cast: 'kept', lyricsMode: 'vocal', timingStatus: 'verified', timingNotes: 'Listened through twice' }));
+ await vi.waitFor(() => expect(setPlanning).toHaveBeenCalledWith({ cast: 'edited', lyricsMode: 'vocal', timingStatus: 'verified', timingNotes: 'Listened through twice' }));
+ });
+
+ it('re-verifies a stale timing through the alignment route and needs a note to do it', () => {
+ const reverifyAlignment = vi.fn(async () => ({}));
+ const project = { id: 'p', trackId: 't', audioAnalysis: {}, lyricCues: [{ id: 'c', text: 'hi' }], productionReview: { draft: { lyricsMode: 'vocal', timingStatus: 'verified' } } };
+ render(<SetupStage board={board(project, { productionReview: review({ reverifyAlignment, readiness: { alignment: { status: 'stale' } } }) })} />);
+ const button = screen.getByRole('button', { name: 'Re-verify timing' });
+ expect(button).toBeDisabled();
+ fireEvent.change(screen.getByLabelText(/What you checked/), { target: { value: 'New master checked' } });
+ fireEvent.click(button);
+ expect(reverifyAlignment).toHaveBeenCalledWith('New master checked');
+ });
+
+ it('keeps an unsaved planning draft in step after a re-verify', async () => {
+ const setPlanning = vi.fn();
+ const project = { id: 'p', trackId: 't', audioAnalysis: {}, lyricCues: [{ id: 'c', text: 'hi' }], productionReview: { draft: { lyricsMode: 'vocal', timingStatus: 'verified', timingNotes: 'old' } } };
+ render(<SetupStage board={board(project, {
+ productionReview: review({ readiness: { alignment: { status: 'stale' } } }),
+ planningDraft: [{ cast: 'edited', timingStatus: 'verified', timingNotes: 'old' }, setPlanning],
+ })} />);
+ fireEvent.change(screen.getByLabelText(/What you checked/), { target: { value: 'New master checked' } });
+ fireEvent.click(screen.getByRole('button', { name: 'Re-verify timing' }));
+ await vi.waitFor(() => expect(setPlanning).toHaveBeenCalledWith({ cast: 'edited', timingStatus: 'verified', timingNotes: 'New master checked' }));
+ });
+
+ it('confirms an instrumental with a reason', () => {
+ const save = vi.fn(async () => ({}));
+ const project = { id: 'p', trackId: 't', audioAnalysis: {}, productionReview: { draft: {} } };
+ render(<SetupStage board={board(project, { productionReview: review({ save }) })} />);
+ fireEvent.click(screen.getByRole('radio', { name: 'Instrumental' }));
+ const confirm = screen.getByRole('button', { name: 'Confirm instrumental' });
+ expect(confirm).toBeDisabled();
+ fireEvent.change(screen.getByLabelText('Why this song has no lyrics'), { target: { value: 'No vocals at all' } });
+ fireEvent.click(confirm);
+ expect(save).toHaveBeenCalledWith(expect.objectContaining({ lyricsMode: 'instrumental', timingNotes: 'No vocals at all' }));
+ });
});
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index 42b6e7e0bf..72fbbbfd36 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -66,7 +66,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `musicVideoTakes.js` | Music-video scene takes view helpers (#8965): `sceneTakeList(scene, kind)` lists a scene's image/video takes with an un-materialized pre-takes selection appended as a read-only `legacy` take; `takePreviewKey`, `takeThumbUrl`, `takeClipUrl` (hover-preview clip), `sceneHasPendingDecision` (contact-sheet filter), `takeProvenance`; `TAKE_SLOT` maps a take kind to its selection field. Used by `components/musicVideo/SceneTakeStrip.jsx` and `pages/MusicVideo.jsx`. |
| `musicVideoSceneAttention.js` | Music Video per-scene attention model (#10152): `sceneAttention(scene, ctx)` returns the codes (`missing-frame`, `missing-clip`, `under-covered`, `contract-problem`, `perf-blocked`, `candidates-pending`, `plate-unverified`, `no-span`, `last-failure`) behind the collapsed scene-row chips, the Board `?scenes=attention\|missing\|all` filter (`parseSceneFilter`, `sceneMatchesFilter`) and the Produce per-shot strip; `SCENE_ATTENTION_LABELS`. Used by `components/musicVideo/SceneCard.jsx`, `stages/BoardStage.jsx` and `stages/ProduceStage.jsx`. |
| `musicVideoShotTiming.js` | Re-export of `server/lib/musicVideoShotTiming.js` (#8977) — shot modes, the verified source-audio lip-sync capability table, `performanceBlockedReason`, `planPerformanceRepair` (measured accepted-prefix boundary, suffix interval and next spend), `planPerformanceWindow`, `grokCoverage`, `approximateMotionCues`, `shotSplitLimit` (when a scene offers a lyric-boundary split), `falSceneTake` (a fal take's model, length, resolution and estimated cost). Used by `hooks/useMusicVideoSceneMedia.js` and `components/musicVideo/SceneCard.jsx`. |
-| `musicVideoStages.js` | Music Video page stage model: `MUSIC_VIDEO_STAGES` (setup → cast-sets → board → produce → compose → review), `resolveStageParam(value)` for the `:stage` route param, `deriveStages(project)` (per-stage `done`/`active`/`blocked`/`todo` + `current`, the first incomplete stage; a live production run pins Produce), `deriveNextAction(project, ctx)` (the one primary action the sticky header offers — approve Cast & Sets, stop/resume production, render final, …), `projectSpend(project)` (paid generation used vs. cap), `projectShotSummary(project)` (document shots or scene counts), `stageChecklist(stageId, project, readiness)` (what one stage tab still needs, with the open approval's reason and a scroll anchor), `projectServicesSummary(project)` (the saved image/video render services), `compareMusicVideoProjectsNewestFirst(a, b)` (sort projects newest created / updated first for project cards and pickers), and `currentProductionRun`; `productionReviewStopGuidance` separates current approval blockers from historical run stops. Used by `components/musicVideo/MusicVideoLayout.jsx` and `pages/MusicVideo.jsx`. |
+| `musicVideoStages.js` | Music Video page stage model: `MUSIC_VIDEO_STAGES` (six steps: Song `setup` → Look `cast-sets` → Storyboard `board` → Make `produce` → Final render `review` → Publish; a retired `compose` link resolves to Make), `resolveStageParam(value)` for the `:stage` route param, `deriveStages(project)` (per-stage `done`/`active`/`blocked`/`todo` + `current`, the first incomplete step; a live production run pins Make), `deriveNextAction(project, ctx)` (the one primary action the sticky header offers — approve Cast & Sets, verify lyric timing, stop/resume production, render final, …), `describeProjectStatus` (the header line and the step that needs the director), `autopilotStatus` (the header Autopilot button), `projectSpend(project)` (paid generation used vs. cap), `projectShotSummary(project)` (document shots or scene counts), `stageChecklist(stageId, project, readiness)` (what one step still needs, with the open approval's reason and a scroll anchor), `stepNotes(project, readiness, publish)` (one fact per step for the step list), `listPreviewSources` (final, live composition, drafts, then the storyboard animatic), `projectServicesSummary(project)` (the saved image/video render services), `compareMusicVideoProjectsNewestFirst(a, b)` (sort projects newest created / updated first for project cards and pickers), and `currentProductionRun`; `productionReviewStopGuidance` separates current approval blockers from historical run stops. Used by `components/musicVideo/MusicVideoLayout.jsx` and `pages/MusicVideo.jsx`. |
| `musicVideoAttention.js` | Music Video "Needs attention" model (#9940): `deriveAttentionItems(project, live)` returns the banner rows for server-held states a client-orchestrated workflow can strand — an open/rendering revision, an interrupted Cast & Sets stage, a running auto-review waiting on its revised sections, a final render nobody is watching — derived from the persisted record so they survive a reload (healthy work this tab can see progressing is not flagged); `openRevisionOf(project)`; `ATTENTION_ANCHOR_ID` + `revealAttention()` scroll a refusal toast to the banner. Used by `components/musicVideo/NeedsAttentionBanner.jsx` and `pages/MusicVideo.jsx`. |
| `musicVideoProjectList.js` | Music Video project index model (#10167): `projectRunPill(project)` (Running / Needs you / Interrupted / Done, from the same next-action and attention logic as the header), `groupMusicVideoProjects(projects, query)` (collapse forks under their root, newest version first, name filter, groups ordered by last touch), and `compareMusicVideoProjectsRecentlyTouched`. Used by `pages/MusicVideo.jsx` and `components/musicVideo/MusicVideoProjectCard.jsx`. |
| `musicVideoPreview.js` | Pick the representative produced asset for a Music Video project card (`selectMusicVideoPreview`: final video → latest excerpt → latest rendered scene clip → latest scene reference frame → visual spec reference) for the main project grid. Pure, computed off the project record, with image path and fallback helpers (`musicVideoImageSrc`, `musicVideoImageFallback`). |
diff --git a/client/src/lib/musicVideoAttention.js b/client/src/lib/musicVideoAttention.js
index 41836272e2..b51644ea5f 100644
--- a/client/src/lib/musicVideoAttention.js
+++ b/client/src/lib/musicVideoAttention.js
@@ -135,7 +135,7 @@ const STALE_APPROVALS = [
['castAndSets', 'Cast & Sets check-in', 'cast-sets'],
['art', 'Art direction', 'cast-sets#mv-review-art'],
['storyboard', 'Timed storyboard', 'board#mv-review-storyboard'],
- ['proof', 'Animated proof', 'compose#mv-review-proof'],
+ ['proof', 'Animated proof', 'produce#mv-review-proof'],
];
// One row for every approval given on inputs that have changed since (#10141),
@@ -172,7 +172,7 @@ export function parkedAutoReview(project) {
return run && AUTO_REVIEW_PARKED.has(run.status) ? run : null;
}
-/** Whether the Review tab's "Revision and automatic review tools" section should open on its own: a run is live or parked. */
+/** Whether Final render's "Revision and automatic review tools" section should open on its own: a run is live or parked. */
export const autoReviewNeedsUser = (project) => asList(project?.autoReviews).some((r) => r.status === 'running' && !r.productionRunId) || !!parkedAutoReview(project);
// Rows for runs the server holds that nobody is watching: an autonomous run
@@ -194,7 +194,8 @@ function parkedRunItems(project) {
projectId: project.id,
canResume: !awaiting,
resumeLabel: auto.status === 'failed' ? 'Retry' : 'Resume',
- openTo: awaiting ? 'setup#mv-auto-edit' : auto.stage === 'produce' ? 'produce' : 'setup',
+ // The run's log and its checkpoint editor live in Project settings › Autopilot.
+ openTo: `${auto.stage === 'produce' ? 'produce' : 'setup'}?mvPanel=autopilot${awaiting ? '#mv-auto-edit' : ''}`,
});
}
const production = currentProductionRun(project);
@@ -207,13 +208,13 @@ function parkedRunItems(project) {
kind: 'production',
tone: 'warn',
title: production.status === 'limit-reached' ? 'Production stopped at its limit' : production.status === 'needs-human' ? 'Production needs you' : 'Production is paused',
- detail: reason || 'Open Produce to see what it is waiting on.',
+ detail: reason || 'Open Autopilot to see what it is waiting on.',
projectId: project.id,
runId: production.id,
- // Same exits as the header's next action: a needs-human run is cleared on the Produce tab.
+ // Same exits as the header's next action; the run's controls are in Project settings › Autopilot.
canResume: RESUMABLE_RUN_STATUSES.has(production.status),
acceptBasis: production.status === 'needs-replan',
- openTo: 'produce',
+ openTo: 'produce?mvPanel=autopilot',
});
}
const review = parkedAutoReview(project);
@@ -223,7 +224,7 @@ function parkedRunItems(project) {
kind: 'auto-review-parked',
tone: 'warn',
title: review.status === 'limit-reached' ? 'Auto-review stopped at its limit' : review.status === 'stopped' ? 'Auto-review is stopped' : 'Auto-review needs you',
- detail: review.stopReason || review.error || 'Open the Review tab to resume it or take over.',
+ detail: review.stopReason || review.error || 'Open Final render to resume it or take over.',
projectId: project.id,
runId: review.id,
canResume: review.status !== 'limit-reached',
diff --git a/client/src/lib/musicVideoAttention.test.js b/client/src/lib/musicVideoAttention.test.js
index 1cda700fba..264481a4fd 100644
--- a/client/src/lib/musicVideoAttention.test.js
+++ b/client/src/lib/musicVideoAttention.test.js
@@ -118,9 +118,9 @@ describe('openRevisionOf', () => {
});
describe('parked runs (#10156)', () => {
- it('lists an autonomous run awaiting approval with an Open target and no Resume', () => {
+ it('lists an autonomous run awaiting approval with an Open target (its checkpoint editor in Project settings) and no Resume', () => {
const [item] = deriveAttentionItems(project({ name: 'Example', autonomousRun: { id: 'auto-1', status: 'awaiting-approval', awaiting: 'lyrics', stage: 'style' } }));
- expect(item).toMatchObject({ kind: 'autonomous', canResume: false, openTo: 'setup#mv-auto-edit', projectId: 'mv-example' });
+ expect(item).toMatchObject({ kind: 'autonomous', canResume: false, openTo: 'setup?mvPanel=autopilot#mv-auto-edit', projectId: 'mv-example' });
expect(item.detail).toContain('lyrics');
});
@@ -128,7 +128,8 @@ describe('parked runs (#10156)', () => {
const stopped = deriveAttentionItems(project({ autonomousRun: { id: 'a', status: 'stopped', stage: 'song' } }));
const failed = deriveAttentionItems(project({ autonomousRun: { id: 'a', status: 'failed', stage: 'produce', error: 'boom' } }));
expect(stopped[0]).toMatchObject({ kind: 'autonomous', canResume: true, resumeLabel: 'Resume' });
- expect(failed[0]).toMatchObject({ canResume: true, resumeLabel: 'Retry', openTo: 'produce' });
+ expect(stopped[0].openTo).toBe('setup?mvPanel=autopilot');
+ expect(failed[0]).toMatchObject({ canResume: true, resumeLabel: 'Retry', openTo: 'produce?mvPanel=autopilot' });
});
it('lists a stopped or limit-reached auto-review but not older superseded or healthy ones', () => {
@@ -143,7 +144,7 @@ describe('parked runs (#10156)', () => {
it('lists a production run at its limit, once, even when an autonomous run is parked on it', () => {
const production = { id: 'prod-1', status: 'limit-reached', stopReason: 'Spend limit' };
const alone = deriveAttentionItems(project({ productionRuns: [production] }));
- expect(alone).toEqual([expect.objectContaining({ kind: 'production', runId: 'prod-1', openTo: 'produce', detail: 'Spend limit', canResume: true })]);
+ expect(alone).toEqual([expect.objectContaining({ kind: 'production', runId: 'prod-1', openTo: 'produce?mvPanel=autopilot', detail: 'Spend limit', canResume: true })]);
const owned = deriveAttentionItems(project({ productionRuns: [production], autonomousRun: { id: 'a', status: 'needs-human', stage: 'produce', output: { productionRunId: 'prod-1' } } }));
expect(owned.map((i) => i.kind)).toEqual(['autonomous']);
});
diff --git a/client/src/lib/musicVideoPreview.test.js b/client/src/lib/musicVideoPreview.test.js
index b323574d17..f70b594322 100644
--- a/client/src/lib/musicVideoPreview.test.js
+++ b/client/src/lib/musicVideoPreview.test.js
@@ -16,8 +16,8 @@ it('surfaces a pinned imported animatic in both full and summary cards without c
const progress = deriveStages(project, null);
expect(progress.stages.find(stage => stage.id === 'review').state).not.toBe('done');
const status = describeProjectStatus(project, { progress, reviewingDraft: true });
- expect(status.headline).toBe('Imported draft for review');
- expect(status.facts.find(fact => fact.id === 'render').label).toContain('pending review');
+ // The draft's own review state is shown by ReviewDraftPanel on Final render; the header names the task.
+ expect(status).toMatchObject({ headline: 'Imported draft for review', tone: 'muted', needsYouStage: null });
expect(project.renderHistoryId).toBeUndefined();
});
@@ -38,15 +38,15 @@ it('uses version creation time rather than later notes to choose the latest impo
expect(selectMusicVideoPreview({ id: 'review-project', devArtifacts: [newer, old] })).toMatchObject({ artifactId: 'new-film', reviewStatus: 'changes-requested' });
});
-it('describes the resolved review snapshot, including missing newer drafts and all-unavailable media', () => {
+it('names the review-draft task in the header while checking, resolved or with every draft unavailable', () => {
const project = { id: 'example', devArtifacts: [animatic('new-film', 3)], scenes: [] };
const progress = deriveStages(project, null);
const resolved = { draft: { version: 2, reviewStatus: 'approved' }, unavailableCount: 1, checking: false };
const status = describeProjectStatus(project, { progress, reviewingDraft: true, reviewDraftState: resolved });
- expect(status.facts.find(fact => fact.id === 'render').label).toBe('Imported animatic v2 · draft reviewed');
+ expect(status.headline).toBe('Imported draft for review');
+ expect(describeProjectStatus(project, { progress, reviewingDraft: true, reviewDraftState: { ...resolved, checking: true } }).headline).toBe('Checking review draft');
const missing = describeProjectStatus(project, { progress, reviewingDraft: true, reviewDraftState: { ...resolved, draft: null } });
expect(missing.headline).toBe('Choose an available review file');
- expect(missing.facts.find(fact => fact.id === 'render').label).toBe('Imported drafts unavailable');
});
describe('selectMusicVideoPreview', () => {
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.js
index 39f4e5111e..e560c0d518 100644
--- a/client/src/lib/musicVideoStages.js
+++ b/client/src/lib/musicVideoStages.js
@@ -8,22 +8,32 @@ import { isLayeredComposition, isSelfDrawnLayer, sceneRenderReady, sceneVisualLa
import {
AUTONOMOUS_CHECKPOINT_LABELS, AUTONOMOUS_LYRICS_STEP_LABELS, AUTONOMOUS_SONG_STEP_LABELS, AUTONOMOUS_STATUS_LABELS,
} from './musicVideoAutonomous.js';
-import { formatCount, formatTimecode } from '../utils/formatters.js';
+import { formatCount, formatDurationSec, formatTimecode } from '../utils/formatters.js';
import { isNonBlankStr } from './textUtils';
import { modeLabel } from './imageGenModes.js';
import { falSceneTake } from './musicVideoShotTiming.js';
import { latestMusicVideoReviewDraft } from '../../../server/lib/musicVideoReviewDraft.js';
+/**
+ * The six steps of a music video, in the order the director decides them. The
+ * ids are the route's `:stage` values and stay stable across the relabel
+ * (#10297 follow-up): Song is `setup`, Look is `cast-sets`, Storyboard is
+ * `board`, Make is `produce` (footage, composition and the proof that closes
+ * them) and Final render is `review`. `doneWhen` is the one line a step
+ * shows under its title.
+ */
export const MUSIC_VIDEO_STAGES = [
- { id: 'setup', label: 'Setup', title: 'Setup' },
- { id: 'cast-sets', label: 'Cast & Sets', title: 'Cast & Sets' },
- { id: 'board', label: 'Board', title: 'Board' },
- { id: 'produce', label: 'Produce', title: 'Produce' },
- { id: 'compose', label: 'Compose', title: 'Compose' },
- { id: 'review', label: 'Review', title: 'Review & Export' },
- { id: 'publish', label: 'Publish', title: 'Publish' },
+ { id: 'setup', label: 'Song', title: 'Song', doneWhen: 'Done when the track is analyzed and every lyric word is timed to the vocal.' },
+ { id: 'cast-sets', label: 'Look', title: 'Look', doneWhen: 'Done when the art direction is written, a visual guide is chosen, and you approve it.' },
+ { id: 'board', label: 'Storyboard', title: 'Storyboard', doneWhen: 'Done when shots cover the whole song and you approve the timed storyboard.' },
+ { id: 'produce', label: 'Make', title: 'Make', doneWhen: 'Done when every shot has its picture and you approve a proof watched with sound.' },
+ { id: 'review', label: 'Final render', title: 'Final render', doneWhen: 'Done when the full video is rendered from the approved plan and is up to date.' },
+ { id: 'publish', label: 'Publish', title: 'Publish', doneWhen: 'Done when every platform you turned on has a post.' },
];
+// Old links name the Compose tab, which is now part of Make.
+const LEGACY_STAGE_IDS = { compose: 'produce' };
+
export const isStageId = (value) => MUSIC_VIDEO_STAGES.some((stage) => stage.id === value);
@@ -128,8 +138,10 @@ export function boardJobEstimate(project) {
* then each finished draft excerpt, newest first. While editing the
* composition (`liveFirst`, the Compose stage) the live document leads so an
* old final render is not what the user sees by default. A final render whose
- * inputs changed is labelled out of date. Each entry has a stable `id`
- * (the `?play=` value) and a `label` for the source picker.
+ * inputs changed is labelled out of date. Last comes the storyboard animatic —
+ * the song under each shot's frame or card — so a project with a track and
+ * shots always has something to watch. Each entry has a stable `id` (the
+ * `?play=` value) and a `label` for the source picker.
*/
export function listPreviewSources(project, { finalVideoSrc = null, liveFirst = false } = {}) {
const sources = [];
@@ -148,6 +160,9 @@ export function listPreviewSources(project, { finalVideoSrc = null, liveFirst =
label: `${excerpt.dependencyState?.status === 'stale' ? 'Older draft' : 'Draft'} ${formatTimecode(excerpt.startSec)}–${formatTimecode(excerpt.endSec)} · ${excerpt.id.slice(-6)}`,
});
}
+ if (projectHasAudio(project) && (project?.scenes || []).length > 0) {
+ sources.push({ id: 'animatic', kind: 'animatic', label: 'Storyboard animatic' });
+ }
return sources;
}
@@ -157,39 +172,14 @@ const PRODUCTION_RUN_LABELS = {
'limit-reached': 'Production at its limit', 'needs-replan': 'Production needs a replan',
};
-const APPROVAL_LABELS = { art: 'art', storyboard: 'storyboard', proof: 'proof' };
-
-/** One line for the production-approval gate: which of the three approvals the current revision holds. */
-export function approvalSummary(readiness) {
- if (!readiness) return null;
- const keys = Object.keys(APPROVAL_LABELS);
- const approved = keys.filter((key) => readiness[key]?.approved).length;
- const missing = keys.filter((key) => !readiness[key]?.approved).map((key) => APPROVAL_LABELS[key]);
- return approved === keys.length ? 'All 3 approved' : `${approved} of 3 approved · needs ${missing.join(', ')}`;
-}
-
/**
- * The project's "where does it stand" line for the sticky header: the stage it
- * is in (and whether that stage is waiting on the director), plus short facts
- * for the autopilot run, the production run, the approvals and what there is to
- * watch. `progress` is `deriveStages(…)`; `nextAction` is `deriveNextAction(…)`.
- * Fact tones are `ok`, `warn` or `muted`.
+ * What the header's Autopilot button says: the autonomous run's current step or
+ * state, else a live or parked production run, else just "Autopilot". Tones are
+ * `ok`, `warn` or `muted`; `short` is the phone label.
*/
-export function describeProjectStatus(project, { progress, nextAction = null, readiness = project?.productionReadiness, reviewingDraft = false, reviewDraftState } = {}) {
- if (!project || !progress) return null;
- const index = MUSIC_VIDEO_STAGES.findIndex((stage) => stage.id === progress.current);
- const entry = progress.stages.find((stage) => stage.id === progress.current);
- const allDone = progress.stages.every((stage) => stage.state === 'done');
- // A goto into Production review is a human approval, not something the app does by itself.
- const needsYou = entry?.state === 'blocked' || nextAction?.id === 'review-production' || nextAction?.id === 'approve-cast-sets';
- const activeEvidence = ['draft-progress', 'proof-progress'].includes(nextAction?.id);
- const reviewDraft = reviewingDraft && reviewDraftState ? reviewDraftState.draft : latestMusicVideoReviewDraft(project);
- const headline = reviewingDraft ? reviewDraftState?.checking ? 'Checking review draft' : reviewDraft ? 'Imported draft for review' : 'Choose an available review file' : activeEvidence ? 'Review render in progress' : allDone
- ? 'Published'
- : `Stage ${index + 1} of ${MUSIC_VIDEO_STAGES.length}: ${entry?.label || ''}${needsYou ? ' · needs you' : ''}`;
- const facts = [];
- const auto = project.autonomousRun;
- if (auto && nextAction?.id !== 'review-production' && !activeEvidence) {
+export function autopilotStatus(project) {
+ const auto = project?.autonomousRun;
+ if (auto && auto.status !== 'canceled') {
let label;
if (auto.status === 'running' && !auto.interrupted) {
const step = auto.stages?.[auto.stage]?.step;
@@ -202,24 +192,47 @@ export function describeProjectStatus(project, { progress, nextAction = null, re
label = `Autonomous run ${statusLabel}`;
}
const tone = auto.status === 'completed' ? 'ok' : auto.status === 'running' && !auto.interrupted ? 'muted' : 'warn';
- facts.push({ id: 'autopilot', label, tone });
+ if (auto.status !== 'completed') return { label, short: tone === 'warn' ? 'Autopilot needs you' : 'Autopilot running', tone };
}
const run = currentProductionRun(project);
if (run && RESUMABLE_RUN_STATUSES.has(run.status)) {
- facts.push({ id: 'production', label: PRODUCTION_RUN_LABELS[run.status] || 'Production paused', tone: run.status === 'running' ? 'muted' : 'warn' });
+ const running = run.status === 'running';
+ return { label: PRODUCTION_RUN_LABELS[run.status] || 'Production paused', short: running ? 'Autopilot running' : 'Autopilot needs you', tone: running ? 'muted' : 'warn' };
}
- const approvals = approvalSummary(readiness);
- const showApprovals = progress.current !== 'setup' || (project.scenes || []).length > 0;
- if (approvals && showApprovals) facts.push({ id: 'approvals', label: `Approvals: ${approvals}`, tone: readiness.readyForProduction ? 'ok' : 'warn' });
- const drafts = (project.excerpts || []).filter((e) => e.status === 'complete' && e.filename).length;
- if (isFinalRenderStale(project)) facts.push({ id: 'render', label: STALE_RENDER_MESSAGE, tone: 'warn' });
- else if (project.renderHistoryId) facts.push({ id: 'render', label: 'Final render ready', tone: 'ok' });
- else if (reviewingDraft && reviewDraftState?.checking) facts.push({ id: 'render', label: 'Checking imported media availability', tone: 'muted' });
- else if (reviewingDraft && reviewDraftState?.unavailableCount && !reviewDraft) facts.push({ id: 'render', label: 'Imported drafts unavailable', tone: 'warn' });
- else if (reviewDraft) facts.push({ id: 'render', label: `Imported animatic v${reviewDraft.version} · ${reviewDraft.reviewStatus === 'pending' ? 'pending review' : reviewDraft.reviewStatus === 'approved' ? 'draft reviewed' : 'changes requested'}`, tone: 'muted' });
- else if (drafts) facts.push({ id: 'render', label: `${drafts} draft ${drafts === 1 ? 'excerpt' : 'excerpts'}, no final render`, tone: 'muted' });
- else facts.push({ id: 'render', label: 'Nothing rendered yet', tone: 'muted' });
- return { headline, tone: reviewingDraft ? 'muted' : activeEvidence ? 'muted' : allDone ? 'ok' : needsYou ? 'warn' : 'muted', facts };
+ return { label: 'Autopilot', short: 'Autopilot', tone: 'muted' };
+}
+
+/**
+ * The project's "where does it stand" line for the sticky header: the step it
+ * is in, or the step waiting on the director (`needsYouStage`, also marked in
+ * the step list). A stopped step, an approval to give (`review-production`,
+ * which may sit on a later step than the first unfinished one), a Cast & Sets
+ * check-in or an autonomous checkpoint all need the director. `progress` is
+ * `deriveStages(…)`; `nextAction` is `deriveNextAction(…)`.
+ */
+export function describeProjectStatus(project, { progress, nextAction = null, reviewingDraft = false, reviewDraftState } = {}) {
+ if (!project || !progress) return null;
+ const entry = progress.stages.find((stage) => stage.id === progress.current);
+ const allDone = progress.stages.every((stage) => stage.state === 'done');
+ const blocked = entry?.state === 'blocked';
+ const asksForYou = ['review-production', 'approve-cast-sets', 'review-autonomous'].includes(nextAction?.id);
+ const needsYou = blocked || asksForYou;
+ const needsYouStage = !needsYou ? null : blocked ? progress.current
+ : nextAction.id === 'approve-cast-sets' ? 'cast-sets' : nextAction.stage || progress.current;
+ const shownId = needsYouStage || progress.current;
+ const index = MUSIC_VIDEO_STAGES.findIndex((stage) => stage.id === shownId);
+ const shown = progress.stages.find((stage) => stage.id === shownId);
+ const activeEvidence = ['draft-progress', 'proof-progress'].includes(nextAction?.id);
+ const reviewDraft = reviewingDraft && reviewDraftState ? reviewDraftState.draft : latestMusicVideoReviewDraft(project);
+ const headline = reviewingDraft ? reviewDraftState?.checking ? 'Checking review draft' : reviewDraft ? 'Imported draft for review' : 'Choose an available review file' : activeEvidence ? 'Review render in progress' : allDone
+ ? 'Published'
+ : `Step ${index + 1} of ${MUSIC_VIDEO_STAGES.length}: ${shown?.label || ''}${needsYou ? ' needs you' : ''}`;
+ const quiet = reviewingDraft || activeEvidence || allDone;
+ return {
+ headline,
+ tone: reviewingDraft || activeEvidence ? 'muted' : allDone ? 'ok' : needsYou ? 'warn' : 'muted',
+ needsYouStage: quiet ? null : needsYouStage,
+ };
}
export const STALE_RENDER_MESSAGE = 'Final render is out of date — re-render';
@@ -243,8 +256,8 @@ export function publishPlatformProgress(project, publish = {}) {
return { rows, posted, total: rows.length, done: rows.length ? posted === rows.length : posted > 0 };
}
-/** Resolve the `:stage` route param; an unknown or missing value is null. */
-export const resolveStageParam = (value) => (isStageId(value) ? value : null);
+/** Resolve the `:stage` route param (a retired id maps to its step); an unknown or missing value is null. */
+export const resolveStageParam = (value) => (isStageId(value) ? value : LEGACY_STAGE_IDS[value] || null);
// Footage-optional modes draw their own picture, so scene footage never gates Produce.
export const FOOTAGE_OPTIONAL_MODES = new Set(['code', 'document', 'eidoverse']);
@@ -287,11 +300,10 @@ export function lyricSetupState(project, readiness = project?.productionReadines
* changed since — plus `current`, the first stage that is not done. A live production
* run owns the project, so it pins `current` to Produce.
*
- * The animated proof is the last step of Compose (#10140): its basis covers the
- * whole composition (typography, grade), so it can only be judged once that
- * work exists. Produce is done on footage alone; Compose needs the composition
- * work and an approved proof over it. A later typography or grade edit makes
- * the proof stale on Compose without reopening Produce.
+ * Make (`produce`) holds the footage, the composition over it and the animated
+ * proof that closes both (#10140): the proof's basis covers the whole
+ * composition (typography, grade), so it is judged last. A later typography or
+ * grade edit marks Make stale until the proof is approved again.
*/
export function deriveStages(project, readiness = project?.productionReadiness, publish = {}) {
const scenes = project?.scenes || [];
@@ -311,8 +323,7 @@ export function deriveStages(project, readiness = project?.productionReadiness,
setup: projectHasAudio(project) && !!project?.audioAnalysis && lyricSetupState(project, readiness).ok,
'cast-sets': castDone,
board: planned,
- produce: produceDone,
- compose: composeDone(project || {}, mode) && !!readiness?.proof.approved,
+ produce: produceDone && composeDone(project || {}, mode) && !!readiness?.proof.approved,
// A render made before later scene edits no longer counts as the final video.
review: !!project?.renderHistoryId && !isFinalRenderStale(project),
// #9281/#9282: published once every enabled platform has a recorded post.
@@ -327,7 +338,7 @@ export function deriveStages(project, readiness = project?.productionReadiness,
const stale = {
'cast-sets': !!readiness?.art?.stale || !!readiness?.castAndSets?.stale,
board: !!readiness?.storyboard?.stale,
- compose: !!readiness?.proof?.stale,
+ produce: !!readiness?.proof?.stale,
};
const current = liveRun
? 'produce'
@@ -343,7 +354,8 @@ export function deriveStages(project, readiness = project?.productionReadiness,
/**
* The single primary action the sticky header offers. `kind: 'run'` calls a
- * handler the page owns (keyed by `id`); `kind: 'goto'` opens a stage (and
+ * handler the page owns (keyed by `id`); `kind: 'open'` opens a Project
+ * settings tab (`review-autonomous` → Autopilot); `kind: 'goto'` opens a stage (and
* optionally scrolls to `anchor`). `label` is the full control name; `shortLabel`
* is what a phone shows so the project name keeps room. `disabled` carries the
* reason it can't run yet. A live production run, a render in flight and a
@@ -360,7 +372,7 @@ export function deriveNextAction(project, {
const cast = project.castAndSets || null;
const scenes = project.scenes || [];
- if (proofActive) return { id: 'proof-progress', kind: 'goto', stage: 'compose', anchor: 'mv-review-render', label: 'View review render', shortLabel: 'Review' };
+ if (proofActive) return { id: 'proof-progress', kind: 'goto', stage: 'produce', anchor: 'mv-review-render', label: 'View review render', shortLabel: 'Review' };
if (draftActive) return { id: 'draft-progress', kind: 'goto', stage: 'review', anchor: 'mv-draft-excerpts', label: 'View draft render', shortLabel: 'Draft' };
const art = !readiness?.art.approved;
const board = !readiness?.storyboard.approved;
@@ -369,13 +381,16 @@ export function deriveNextAction(project, {
// or interrupted check-in offers Approve / Resume — those come from the stage switch below.
const castNeedsOwnAction = art && ((!cast && scenes.length === 0) || (cast && (cast.status === 'review' || cast.interrupted || cast.status === 'failed')));
const boardNeedsOwnAction = !art && board && scenes.length === 0;
- // The proof closes Compose, so it waits until Produce is done — unless a
- // production run is parked on its pilot proof, which only the approval frees.
- const proofDue = current !== 'produce' || (!!run && RESUMABLE_RUN_STATUSES.has(run.status));
+ // The proof closes Make, so it waits for Make's footage — unless a production
+ // run is parked on its pilot proof, which only the approval frees.
+ const footageOptional = FOOTAGE_OPTIONAL_MODES.has(project.composition?.mode || 'concat');
+ const layered = isLayeredComposition(project);
+ const footageDone = footageOptional || scenes.every((scene) => sceneRenderReady(scene, { layered }));
+ const proofDue = current !== 'produce' || footageDone || (!!run && RESUMABLE_RUN_STATUSES.has(run.status));
if (projectHasAudio(project) && project.audioAnalysis && !CAST_WORKING.has(cast?.status) && !readiness?.readyForProduction && (art || board || proofDue)
&& run?.status !== 'running' && !renderActive && !kickoffRunning
&& !castNeedsOwnAction && !boardNeedsOwnAction) {
- return { id: 'review-production', kind: 'goto', stage: art ? 'cast-sets' : board ? 'board' : 'compose',
+ return { id: 'review-production', kind: 'goto', stage: art ? 'cast-sets' : board ? 'board' : 'produce',
anchor: art ? 'mv-review-art' : board ? 'mv-review-storyboard' : 'mv-review-proof',
label: art ? 'Review art direction' : board ? 'Review timed storyboard' : 'Review animated proof',
shortLabel: art ? 'Review art' : board ? 'Review storyboard' : 'Review proof' };
@@ -409,7 +424,8 @@ export function deriveNextAction(project, {
}
if (auto.status === 'awaiting-approval') {
const target = AUTONOMOUS_CHECKPOINT_LABELS[auto.awaiting] || auto.awaiting || 'checkpoint';
- return { id: 'review-autonomous', kind: 'goto', stage: 'setup', anchor: 'mv-auto-edit', label: `Review ${target}`, shortLabel: 'Review' };
+ // The checkpoint editor is in Project settings › Autopilot; the page opens it.
+ return { id: 'review-autonomous', kind: 'open', label: `Review ${target}`, shortLabel: 'Review' };
}
if (auto.interrupted || auto.status === 'stopped' || auto.status === 'needs-human') {
return { id: 'resume-autonomous', kind: 'run', label: 'Resume autonomous run', shortLabel: 'Resume' };
@@ -425,7 +441,11 @@ export function deriveNextAction(project, {
if (project.automation && scenes.length === 0) {
return { id: 'kickoff', kind: 'run', label: 'Run autopilot', shortLabel: 'Autopilot', disabled: !!kickoffBlockedReason, reason: kickoffBlockedReason || undefined };
}
- return { id: 'analyze', kind: 'run', label: 'Analyze song', shortLabel: 'Analyze' };
+ if (!project.audioAnalysis) return { id: 'analyze', kind: 'run', label: 'Analyze song', shortLabel: 'Analyze' };
+ // Analyzed: what keeps Song open is the lyrics or their timing, finished on the step itself.
+ return lyricSetupState(project, readiness).imported
+ ? { id: 'verify-timing', kind: 'goto', stage: 'setup', anchor: 'mv-lyric-timing', label: 'Verify lyric timing', shortLabel: 'Timing' }
+ : { id: 'import-lyrics', kind: 'goto', stage: 'setup', anchor: 'mv-lyrics-import', label: 'Add the lyrics', shortLabel: 'Lyrics' };
case 'cast-sets':
if (cast?.status === 'review') return { id: 'approve-cast-sets', kind: 'run', label: 'Approve cast & sets', shortLabel: 'Approve' };
if (cast && (cast.interrupted || cast.status === 'failed')) return { id: 'resume-cast-sets', kind: 'run', label: 'Resume cast & sets', shortLabel: 'Resume' };
@@ -434,13 +454,12 @@ export function deriveNextAction(project, {
return { id: 'kickoff', kind: 'run', label: 'Run autopilot', shortLabel: 'Autopilot', disabled: !!kickoffBlockedReason, reason: kickoffBlockedReason || undefined };
case 'board':
return { id: 'plan', kind: 'run', label: 'Plan the shots', shortLabel: 'Plan', disabled: !project.audioAnalysis, reason: project.audioAnalysis ? undefined : 'Analyze the track first' };
- case 'produce':
+ case 'produce': {
if (run?.status === 'needs-human') return { id: 'goto-review', kind: 'goto', stage: 'review', label: 'Review the draft', shortLabel: 'Review' };
- return { id: 'goto-produce', kind: 'goto', stage: 'produce', anchor: 'mv-production-start', label: 'Set up production', shortLabel: 'Produce' };
- case 'compose': {
+ if (!footageDone) return { id: 'goto-produce', kind: 'goto', stage: 'produce', anchor: 'mv-generation', label: 'Make the footage', shortLabel: 'Make' };
const label = { document: 'Attach a composition', eidoverse: 'Save the Eidoverse scene', code: 'Generate the code video' }[project.composition?.mode] || 'Add typography';
const shortLabel = { document: 'Attach', eidoverse: 'Save', code: 'Generate' }[project.composition?.mode] || 'Type';
- return { id: 'goto-compose', kind: 'goto', stage: 'compose', label, shortLabel };
+ return { id: 'goto-compose', kind: 'goto', stage: 'produce', anchor: 'mv-composition', label, shortLabel };
}
case 'publish':
return project.publishKit?.builtAt
@@ -474,15 +493,15 @@ export function changedFieldsText(changedFields, limit = 4) {
return `${changedFields.slice(0, limit).join(', ')}${more}`;
}
const APPROVAL_ANCHORS = { art: 'mv-review-art', storyboard: 'mv-review-storyboard', proof: 'mv-review-proof' };
-const APPROVAL_STAGES = { art: 'cast-sets', storyboard: 'board', proof: 'compose' };
+const APPROVAL_STAGES = { art: 'cast-sets', storyboard: 'board', proof: 'produce' };
const PUBLISH_ANCHOR = 'mv-publish-kit';
// Storyboard readiness problems, grouped by what the user has to go fix. The
// server returns plain sentences; the first matching rule picks the group.
const STORYBOARD_PROBLEM_GROUPS = [
{ id: 'art', label: 'Art direction', test: /art direction|art feedback/i, action: { label: 'Review art direction', anchor: APPROVAL_ANCHORS.art } },
- { id: 'lyrics', label: 'Lyrics', test: /lyrics|instrumental/i, action: { label: 'Import lyrics', anchor: 'mv-lyrics-import' } },
- { id: 'timing', label: 'Lyric timing', test: /alignment|timing|vocal|master song/i, action: { label: 'Verify timing', anchor: APPROVAL_ANCHORS.storyboard } },
+ { id: 'lyrics', label: 'Lyrics', test: /lyrics|instrumental/i, action: { label: 'Import lyrics', stage: 'setup', anchor: 'mv-lyrics-import' } },
+ { id: 'timing', label: 'Lyric timing', test: /alignment|timing|vocal|master song/i, action: { label: 'Verify timing', stage: 'setup', anchor: 'mv-lyric-timing' } },
{ id: 'coverage', label: 'Shot coverage', test: /cover the master|gaps or overlaps|create a timed/i, action: { label: 'Open the treatment', anchor: 'mv-board-treatment' } },
{ id: 'shots', label: 'Shot details', test: /./, action: { label: 'Edit the storyboard', anchor: APPROVAL_ANCHORS.storyboard } },
];
@@ -534,16 +553,16 @@ export function stageChecklist(stageId, project, readiness = project?.production
return [
{ id: 'track', label: 'Track attached', done: hasAudio, detail: !hasAudio && autoSong ? 'The autonomous run is making the song.' : null,
action: hasAudio || autoSong ? null : { label: 'Attach a track', anchor: 'mv-track' } },
- { id: 'analysis', label: 'Song analyzed', done: !!project.audioAnalysis, detail: project.audioAnalysis ? null : 'Analyze the song from the header or Song & lyrics.',
- action: project.audioAnalysis ? null : { label: 'Open Song & lyrics', anchor: 'mv-setup-song' } },
- { id: 'lyrics', label: lyrics.instrumental ? 'Instrumental — no lyrics needed' : 'Lyrics imported', done: lyrics.imported || lyrics.ok,
- detail: 'Import the lyrics, or mark the song instrumental in Production approvals.',
+ { id: 'analysis', label: 'Song analyzed', done: !!project.audioAnalysis,
+ action: project.audioAnalysis ? null : { label: 'Analyze', anchor: 'mv-analyze' } },
+ { id: 'lyrics', label: lyrics.instrumental ? 'Instrumental, no lyrics needed' : 'Lyrics imported', done: lyrics.imported || lyrics.ok,
+ detail: 'Import the lyrics, or mark the song instrumental under Time and verify.',
action: autoSong ? null : { label: 'Import lyrics', anchor: 'mv-lyrics-import' } },
- { id: 'timing', label: lyrics.instrumental ? 'Instrumental exception confirmed' : 'Lyric timing verified', done: lyrics.verified || lyrics.ok,
+ { id: 'timing', label: lyrics.instrumental ? 'Instrumental confirmed' : 'Lyric timing verified', done: lyrics.verified || lyrics.ok,
detail: lyrics.alignment === 'stale' ? 'Word timings or the master changed since you verified them; verify again.'
- : lyrics.instrumental ? 'Explain the instrumental exception in Production approvals.'
- : 'Align the words, listen to them against the vocal, then verify the timing in Production approvals.',
- action: autoSong ? null : { label: 'Verify timing', anchor: APPROVAL_ANCHORS.storyboard } },
+ : lyrics.instrumental ? 'Say why the song has no lyrics under Time and verify.'
+ : 'Align the words, listen back, then mark the timing verified under Time and verify.',
+ action: autoSong ? null : { label: 'Verify timing', anchor: 'mv-lyric-timing' } },
];
}
case 'cast-sets': {
@@ -568,22 +587,19 @@ export function stageChecklist(stageId, project, readiness = project?.production
];
}
case 'produce': {
- if (FOOTAGE_OPTIONAL_MODES.has(mode)) {
- const planned = !!readiness?.storyboard?.approved;
- return [{ id: 'footage', label: 'No footage needed for this render style', done: planned,
- action: planned ? null : { label: 'Review timed storyboard', anchor: APPROVAL_ANCHORS.storyboard } }];
+ // Make: footage (unless the render style draws its own picture), the
+ // composition over it, then the proof that closes both (see deriveStages).
+ const items = [];
+ if (!FOOTAGE_OPTIONAL_MODES.has(mode)) {
+ const layered = isLayeredComposition(project);
+ const ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
+ const footageDone = scenes.length > 0 && ready === scenes.length;
+ items.push({ id: 'footage', label: `Footage for every shot (${formatCount(ready)} of ${formatCount(scenes.length)})`, done: footageDone,
+ action: footageDone ? null : { label: 'Make the footage', anchor: 'mv-generation' } });
}
- const layered = isLayeredComposition(project);
- const ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
- const footageDone = scenes.length > 0 && ready === scenes.length;
- return [{ id: 'footage', label: `Footage for every shot (${formatCount(ready)} of ${formatCount(scenes.length)})`, done: footageDone,
- action: footageDone ? null : { label: 'Show shots missing footage', stage: 'board', params: { scenes: 'missing' }, anchor: 'mv-scene-board' } }];
- }
- case 'compose': {
- // The proof closes Compose: it is judged over the finished composition (see deriveStages).
const proof = approval('proof', 'Animated proof', 'Render the proof over this composition, watch it with sound, then approve it below.');
const composition = project.composition || {};
- let work = { id: 'composition', label: 'Nothing to compose for this render style', done: true };
+ let work = null;
if (mode === 'composed') work = { id: 'composition', label: 'Timed typography added', done: (composition.textCues || []).length > 0, action: { label: 'Add typography', anchor: 'mv-typo-font' } };
else if (mode === 'document') work = { id: 'composition', label: 'Composition document attached', done: !!composition.document, action: { label: 'Attach a document', anchor: 'mv-doc-folder' } };
else if (mode === 'eidoverse') {
@@ -595,7 +611,7 @@ export function stageChecklist(stageId, project, readiness = project?.production
detail: done ? null : 'Generate the code video from the Code Video panel.',
action: done ? null : { label: 'Open Code Video', anchor: 'mv-code-section' } };
}
- return [work, proof];
+ return [...items, ...(work ? [work] : []), proof];
}
case 'review':
return [{
@@ -624,6 +640,40 @@ export function stageChecklist(stageId, project, readiness = project?.production
}
}
+/**
+ * One short fact per step for the step list, so where the project stands reads
+ * without opening any step: the song's length and lyric count, the visual
+ * guide, the shot count, how many shots have their picture, the final render's
+ * state and how many platforms have a post. Keyed by stage id; a step with
+ * nothing to say yet maps to an empty string.
+ */
+export function stepNotes(project, readiness = project?.productionReadiness, publish = {}) {
+ if (!project) return {};
+ const scenes = project.scenes || [];
+ const lines = (project.lyricCues || []).filter((cue) => isNonBlankStr(cue.text)).length;
+ const duration = project.audioAnalysis?.durationSec;
+ const lyrics = lyricSetupState(project, readiness);
+ const song = [
+ Number.isFinite(duration) ? formatDurationSec(duration) : projectHasAudio(project) ? 'Track attached' : 'No track yet',
+ lyrics.instrumental ? 'instrumental' : lines ? `${formatCount(lines)} lyric ${lines === 1 ? 'line' : 'lines'}` : null,
+ ].filter(Boolean).join(' · ');
+ const draft = project.productionReview?.draft || {};
+ const guide = (project.devArtifacts || []).find((a) => a.id === draft.guideArtifactId && !a.deleted);
+ const look = guide ? 'Visual guide chosen' : project.castAndSets ? 'Cast and sets built' : '';
+ const board = scenes.length ? `${formatCount(scenes.length)} ${scenes.length === 1 ? 'shot' : 'shots'}` : '';
+ const mode = project.composition?.mode || 'concat';
+ let make = '';
+ if (scenes.length && !FOOTAGE_OPTIONAL_MODES.has(mode)) {
+ const layered = isLayeredComposition(project);
+ const ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
+ make = `${formatCount(ready)} of ${formatCount(scenes.length)} shots have their picture`;
+ } else if (scenes.length) make = 'Picture drawn by the composition';
+ const review = isFinalRenderStale(project) ? 'Out of date' : project.renderHistoryId ? 'Rendered' : '';
+ const posts = publishPlatformProgress(project, publish);
+ const publishNote = posts.total ? `${formatCount(posts.posted)} of ${formatCount(posts.total)} posted` : posts.posted ? 'Posted' : '';
+ return { setup: song, 'cast-sets': look, board, produce: make, review, publish: publishNote };
+}
+
/**
* Sort comparator to organize Music Video projects so the newest one is first.
* Compares `createdAt` descending (newest created first), falling back to
diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.js
index 30cd6d7830..3baf5f5111 100644
--- a/client/src/lib/musicVideoStages.test.js
+++ b/client/src/lib/musicVideoStages.test.js
@@ -1,6 +1,7 @@
import { describe, it, expect } from 'vitest';
+import { summarizeMusicVideoProject } from '../../../server/lib/musicVideoSummary.js';
import {
- MUSIC_VIDEO_STAGES, currentProductionRun, deriveNextAction, deriveStages, projectSpend, boardJobEstimate, listPreviewSources, describeProjectStatus, resolveStageParam, stageChecklist, compareMusicVideoProjectsNewestFirst,
+ MUSIC_VIDEO_STAGES, currentProductionRun, deriveNextAction, deriveStages, projectSpend, boardJobEstimate, listPreviewSources, describeProjectStatus, resolveStageParam, stageChecklist, stepNotes, autopilotStatus, compareMusicVideoProjectsNewestFirst,
} from './musicVideoStages.js';
const APPROVED = { art: { approved: true }, storyboard: { approved: true }, proof: { approved: true }, readyForProduction: true };
@@ -27,12 +28,21 @@ describe('deriveStages / deriveNextAction', () => {
expect(deriveNextAction({ id: 'p', trackId: 't1', scenes: [] })).toMatchObject({ id: 'analyze' });
});
+ it('sends an analyzed song to its lyrics, then to verifying their timing, instead of re-analyzing (#10305 review)', () => {
+ const analyzed = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [] };
+ expect(deriveStages(analyzed).current).toBe('setup');
+ expect(deriveNextAction(analyzed)).toMatchObject({ id: 'import-lyrics', kind: 'goto', stage: 'setup', anchor: 'mv-lyrics-import' });
+ const unverified = { ...analyzed, lyricCues: [{ id: 'l1', text: 'la la' }] };
+ expect(deriveNextAction(unverified)).toMatchObject({ id: 'verify-timing', kind: 'goto', stage: 'setup', anchor: 'mv-lyric-timing', label: 'Verify lyric timing' });
+ expect(deriveNextAction({ ...analyzed, audioAnalysis: null })).toMatchObject({ id: 'analyze' });
+ });
+
it('reflects an autonomous run in the header next action instead of asking to attach a track', () => {
const autoRunning = { id: 'p', autonomousRun: { status: 'running', stage: 'lyrics', stages: { lyrics: { step: 'draft' } } } };
expect(deriveNextAction(autoRunning)).toMatchObject({ id: 'busy', label: 'Writing the lyric draft…', disabled: true });
const autoAwaiting = { id: 'p', autonomousRun: { status: 'awaiting-approval', awaiting: 'lyrics' } };
- expect(deriveNextAction(autoAwaiting)).toMatchObject({ id: 'review-autonomous', kind: 'goto', stage: 'setup', anchor: 'mv-auto-edit', label: 'Review Lyrics' });
+ expect(deriveNextAction(autoAwaiting)).toMatchObject({ id: 'review-autonomous', kind: 'open', label: 'Review Lyrics' });
const autoStopped = { id: 'p', autonomousRun: { status: 'stopped' } };
expect(deriveNextAction(autoStopped)).toMatchObject({ id: 'resume-autonomous', kind: 'run', label: 'Resume autonomous run' });
@@ -78,10 +88,10 @@ describe('deriveStages / deriveNextAction', () => {
expect(deriveNextAction(interrupted)).toMatchObject({ id: 'resume-production' });
});
- it('walks Board → Produce → Compose → Review, then reports a finished project', () => {
+ it('walks Storyboard → Make → Final render, then reports a finished project', () => {
const planned = { productionReadiness: APPROVED, id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene({ referenceImageId: null, videoHistoryId: null })] };
expect(deriveStages(planned).current).toBe('produce');
- expect(deriveNextAction(planned)).toMatchObject({ id: 'goto-produce', kind: 'goto', stage: 'produce' });
+ expect(deriveNextAction(planned)).toMatchObject({ id: 'goto-produce', kind: 'goto', stage: 'produce', anchor: 'mv-generation', label: 'Make the footage' });
const ready = { ...planned, scenes: [scene()] };
expect(deriveStages(ready).current).toBe('review');
@@ -89,13 +99,13 @@ describe('deriveStages / deriveNextAction', () => {
expect(deriveNextAction(ready, { renderBlockedByOther: true })).toMatchObject({ id: 'render-final', disabled: true });
expect(deriveNextAction(ready, { renderActive: true, renderProgress: 41.6 })).toMatchObject({ id: 'render-progress', disabled: true, label: 'Rendering… 42%' });
- // A composed render needs its text cues before it is ready to render.
+ // A composed render needs its text cues before Make is done.
const composed = { ...ready, composition: { mode: 'composed', textCues: [] } };
- expect(deriveStages(composed).current).toBe('compose');
- expect(deriveNextAction(composed)).toMatchObject({ id: 'goto-compose', stage: 'compose' });
+ expect(deriveStages(composed).current).toBe('produce');
+ expect(deriveNextAction(composed)).toMatchObject({ id: 'goto-compose', stage: 'produce', anchor: 'mv-composition' });
const finished = { ...ready, renderHistoryId: 'rh-1' };
- expect(stateOf(finished)).toMatchObject({ setup: 'done', board: 'done', produce: 'done', compose: 'done', review: 'done', publish: 'active' });
+ expect(stateOf(finished)).toEqual({ setup: 'done', 'cast-sets': 'done', board: 'done', produce: 'done', review: 'done', publish: 'active' });
// #9281: a rendered project moves on to the release.
expect(deriveNextAction(finished)).toMatchObject({ id: 'goto-publish', kind: 'goto', stage: 'publish', label: 'Build the publishing kit' });
expect(deriveNextAction({ ...finished, publishKit: { builtAt: '2026-01-01T00:00:00.000Z' } })).toMatchObject({ label: 'Publish the release' });
@@ -110,8 +120,9 @@ describe('deriveStages / deriveNextAction', () => {
expect(stateOf(stale).review).toBe('active');
expect(deriveNextAction(stale)).toMatchObject({ id: 'render-final', label: 'Re-render final video' });
expect(stageChecklist('review', stale)[0]).toMatchObject({ done: false, detail: 'Final render is out of date — re-render.' });
- expect(describeProjectStatus(stale, { progress: deriveStages(stale) }).facts.find((f) => f.id === 'render'))
- .toMatchObject({ label: 'Final render is out of date — re-render', tone: 'warn' });
+ expect(stepNotes(stale).review).toBe('Out of date');
+ // The project index agrees: a stale render does not finish Final render.
+ expect(summarizeMusicVideoProject(stale, APPROVED).stage).toBe('review');
});
it('counts Publish per enabled platform, done only when each has a post (#10143)', () => {
@@ -131,34 +142,34 @@ describe('deriveStages / deriveNextAction', () => {
expect(stageChecklist('publish', { ...ready, renderHistoryId: 'rh-2' }, undefined, publish)[0].done).toBe(false);
});
- it('derives Produce and Compose for all five render styles (#10139)', () => {
+ it('derives Make for all five render styles (#10139)', () => {
const bare = { productionReadiness: APPROVED, id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene({ referenceImageId: null, videoHistoryId: null })] };
const withMode = (composition) => ({ ...bare, composition });
// Footage styles still need footage; composed also needs cues.
expect(deriveStages(withMode({ mode: 'concat' })).current).toBe('produce');
expect(deriveStages(withMode({ mode: 'composed', textCues: [] })).current).toBe('produce');
- // Eidoverse: Produce done without footage; Compose waits on a saved scene.
- expect(stateOf(withMode({ mode: 'eidoverse' })).produce).toBe('done');
- expect(deriveStages(withMode({ mode: 'eidoverse' })).current).toBe('compose');
- expect(stageChecklist('produce', withMode({ mode: 'eidoverse' }), APPROVED).map((i) => [i.id, i.done])).toEqual([['footage', true]]);
- expect(stageChecklist('compose', withMode({ mode: 'eidoverse' }), APPROVED)[0])
+ // Eidoverse needs no footage; Make waits on a saved scene.
+ expect(deriveStages(withMode({ mode: 'eidoverse' })).current).toBe('produce');
+ expect(stageChecklist('produce', withMode({ mode: 'eidoverse' }), APPROVED).map((i) => [i.id, i.done])).toEqual([['composition', false], ['approve-proof', true]]);
+ expect(stageChecklist('produce', withMode({ mode: 'eidoverse' }), APPROVED)[0])
.toMatchObject({ label: 'Save the Eidoverse scene', done: false, action: { anchor: 'mv-eidoverse-scene' } });
const saved = withMode({ mode: 'eidoverse', eidoverseScene: { inlineScript: 'scene()' } });
expect(deriveStages(saved).current).toBe('review');
- expect(stageChecklist('compose', saved, APPROVED)[0].done).toBe(true);
+ expect(stageChecklist('produce', saved, APPROVED)[0].done).toBe(true);
// Code: composed only once generated (or sections exist).
- expect(deriveStages(withMode({ mode: 'code' })).current).toBe('compose');
- expect(stageChecklist('compose', withMode({ mode: 'code' }), APPROVED)[0].done).toBe(false);
+ expect(deriveStages(withMode({ mode: 'code' })).current).toBe('produce');
+ expect(stageChecklist('produce', withMode({ mode: 'code' }), APPROVED)[0]).toMatchObject({ id: 'composition', done: false });
expect(deriveStages(withMode({ mode: 'code', codeVideo: { generatedAt: '2026-01-01T00:00:00.000Z', sections: [] } })).current).toBe('review');
// Document: composed once the document is attached.
- expect(deriveStages(withMode({ mode: 'document' })).current).toBe('compose');
+ expect(deriveStages(withMode({ mode: 'document' })).current).toBe('produce');
});
it('does not require scene footage for code-rendered or document projects', () => {
const bare = { productionReadiness: APPROVED, id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene({ referenceImageId: null, videoHistoryId: null })] };
- expect(stateOf({ ...bare, composition: { mode: 'code' } }).produce).toBe('done');
+ // Make lists no footage row for them; only the composition and its proof remain.
+ expect(stageChecklist('produce', { ...bare, composition: { mode: 'code' } }, APPROVED).map((i) => i.id)).toEqual(['composition', 'approve-proof']);
const doc = { ...bare, composition: { mode: 'document' } };
- expect(deriveStages(doc).current).toBe('compose');
+ expect(deriveStages(doc).current).toBe('produce');
expect(deriveNextAction(doc).label).toBe('Attach a composition');
expect(deriveStages({ ...doc, composition: { mode: 'document', document: { directory: 'd' } } }).current).toBe('review');
});
@@ -170,14 +181,14 @@ describe('deriveStages / deriveNextAction', () => {
it('never promotes placeholder scenes or imported schematic documents to final production', () => {
const project = { id: 'example', trackId: 'song', audioAnalysis: ANALYSIS, ...LYRICS, scenes: [scene()], composition: { mode: 'document', document: { directory: 'draft' } } };
- expect(stateOf(project)).toMatchObject({ 'cast-sets': 'active', board: 'todo', produce: 'todo', compose: 'todo' });
+ expect(stateOf(project)).toMatchObject({ 'cast-sets': 'active', board: 'todo', produce: 'todo' });
expect(deriveNextAction(project)).toMatchObject({ id: 'review-production', stage: 'cast-sets' });
const planned = { ...project, productionReadiness: { ...APPROVED, proof: { approved: false }, readyForProduction: false } };
- expect(deriveNextAction(planned)).toMatchObject({ id: 'review-production', stage: 'compose' });
+ expect(deriveNextAction(planned)).toMatchObject({ id: 'review-production', stage: 'produce' });
});
-// #10140: the proof is the last step of Compose. Following the tabs in order
-// must never send an earlier stage back to not done.
+// #10140: the proof is the last part of Make. Following the steps in order
+// must never send an earlier step back to not done.
describe('following the tab order', () => {
// The server's proof basis covers the whole composition (productionReview.js),
// so an approval holds only while the composition it was given over is unchanged.
@@ -187,7 +198,7 @@ describe('following the tab order', () => {
};
const doneSet = (project, readiness) => new Set(deriveStages(project, readiness).stages.filter((s) => s.state === 'done').map((s) => s.id));
- it('walks setup → cast & sets → board → produce → compose → proof → render without a stage going backwards', () => {
+ it('walks song → look → storyboard → footage → composition → proof → render without a step going backwards', () => {
let project = { id: 'p', scenes: [], composition: { mode: 'composed', textCues: [] } };
let approvals = {};
const steps = [
@@ -205,16 +216,16 @@ describe('following the tab order', () => {
const readiness = readinessFor(project, approvals);
const after = doneSet(project, readiness);
for (const id of before) expect(after.has(id), `${id} regressed after ${step}`).toBe(true);
- // Each step finishes its own stage, except that typography alone leaves
- // Compose open: the proof over it closes the stage.
- if (step === 'compose') expect(after.has('compose'), 'compose done before its proof').toBe(false);
- else expect(after.has(step === 'proof' ? 'compose' : step), `${step} not done`).toBe(true);
+ // Each action finishes its own step, except that footage and typography
+ // leave Make open: the proof over the composition closes it.
+ if (step === 'produce' || step === 'compose') expect(after.has('produce'), `Make done after ${step}, before its proof`).toBe(false);
+ else expect(after.has(step === 'proof' ? 'produce' : step), `${step} not done`).toBe(true);
before = after;
}
expect(deriveStages(project, readinessFor(project, approvals)).current).toBe('publish');
});
- it('a typography edit after proof approval reopens Compose only and sends the header there', () => {
+ it('a typography edit after proof approval reopens Make only and sends the header to its proof', () => {
const composition = { mode: 'composed', textCues: [{ id: 'c1', text: 'Hello', startSec: 0, endSec: 2 }] };
const project = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene()], composition };
const approvals = { art: true, storyboard: true, approvedComposition: JSON.stringify(composition) };
@@ -223,18 +234,17 @@ describe('following the tab order', () => {
const edited = { ...project, composition: { ...composition, textCues: [...composition.textCues, { id: 'c2', text: 'World', startSec: 2, endSec: 4 }] } };
const readiness = readinessFor(edited, approvals);
expect(Object.fromEntries(deriveStages(edited, readiness).stages.map((s) => [s.id, s.state])))
- .toMatchObject({ board: 'done', produce: 'done', compose: 'active', review: 'todo' });
- expect(deriveNextAction(edited, { readiness })).toMatchObject({ id: 'review-production', stage: 'compose', anchor: 'mv-review-proof' });
- expect(stageChecklist('produce', edited, readiness).every((i) => i.done)).toBe(true);
- expect(stageChecklist('compose', edited, readiness).map((i) => [i.id, i.done])).toEqual([['composition', true], ['approve-proof', false]]);
+ .toMatchObject({ board: 'done', produce: 'active', review: 'todo' });
+ expect(deriveNextAction(edited, { readiness })).toMatchObject({ id: 'review-production', stage: 'produce', anchor: 'mv-review-proof' });
+ expect(stageChecklist('produce', edited, readiness).map((i) => [i.id, i.done])).toEqual([['footage', true], ['composition', true], ['approve-proof', false]]);
});
- it('keeps the header on Produce until the footage is in, unless a run is parked on its pilot proof', () => {
+ it('keeps the header on the footage until it is in, unless a run is parked on its pilot proof', () => {
const project = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene({ videoHistoryId: null })] };
const readiness = readinessFor(project, { art: true, storyboard: true });
expect(deriveNextAction(project, { readiness })).toMatchObject({ id: 'goto-produce', stage: 'produce' });
const parked = { ...project, productionRuns: [run({ status: 'blocked' })] };
- expect(deriveNextAction(parked, { readiness })).toMatchObject({ id: 'review-production', stage: 'compose' });
+ expect(deriveNextAction(parked, { readiness })).toMatchObject({ id: 'review-production', stage: 'produce' });
});
});
@@ -288,6 +298,12 @@ describe('stage route param', () => {
expect(resolveStageParam(undefined)).toBeNull();
});
+ it('opens Make for an old Compose link, and lists six steps each saying what done means', () => {
+ expect(resolveStageParam('compose')).toBe('produce');
+ expect(MUSIC_VIDEO_STAGES.map((stage) => stage.label)).toEqual(['Song', 'Look', 'Storyboard', 'Make', 'Final render', 'Publish']);
+ for (const stage of MUSIC_VIDEO_STAGES) expect(stage.doneWhen).toMatch(/^Done when /);
+ });
+
it('picks the live run over an older completed one', () => {
expect(currentProductionRun({ productionRuns: [run({ id: 'live' }), run({ id: 'done', status: 'completed' })] }).id).toBe('live');
expect(currentProductionRun({})).toBeNull();
@@ -320,59 +336,51 @@ describe('describeProjectStatus', () => {
current,
stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: overrides[stage.id] || (stage.id === current ? 'active' : 'todo') })),
});
- const readiness = (art, storyboard, proof) => ({
- art: { approved: art }, storyboard: { approved: storyboard }, proof: { approved: proof }, readyForProduction: proof,
+
+ it('names the step and flags the one waiting on the director', () => {
+ const status = describeProjectStatus({ excerpts: [] },
+ { progress: stages('cast-sets', { setup: 'done' }), nextAction: { id: 'review-production', stage: 'cast-sets' } });
+ expect(status).toEqual({ headline: 'Step 2 of 6: Look needs you', tone: 'warn', needsYouStage: 'cast-sets' });
+ // A blocked step needs the director even with no approval to give.
+ expect(describeProjectStatus({}, { progress: stages('produce', { produce: 'blocked' }) }))
+ .toMatchObject({ headline: 'Step 4 of 6: Make needs you', needsYouStage: 'produce' });
});
- it('names the stage, flags a pending approval and says nothing has been rendered', () => {
- const status = describeProjectStatus(
- { autonomousRun: { status: 'stopped' }, excerpts: [] },
- { progress: stages('cast-sets', { setup: 'done' }), nextAction: { id: 'review-production' }, readiness: readiness(false, false, false) },
- );
- expect(status.headline).toBe('Stage 2 of 7: Cast & Sets · needs you');
- expect(status.tone).toBe('warn');
- expect(status.facts.map((fact) => fact.label)).toEqual([
- 'Approvals: 0 of 3 approved · needs art, storyboard, proof', 'Nothing rendered yet',
- ]);
+ it('names the step an approval sits on, even when an earlier step is still open', () => {
+ // Song is not done yet, but the header asks for the art approval on Look.
+ const status = describeProjectStatus({}, { progress: stages('setup'), nextAction: { id: 'review-production', stage: 'cast-sets' } });
+ expect(status).toMatchObject({ headline: 'Step 2 of 6: Look needs you', needsYouStage: 'cast-sets' });
+ expect(describeProjectStatus({}, { progress: stages('setup'), nextAction: { id: 'approve-cast-sets', kind: 'run' } }).needsYouStage).toBe('cast-sets');
});
- it('says why a stopped production run is waiting rather than calling every stop a pause', () => {
- const fact = (status) => describeProjectStatus({ productionRuns: [{ id: 'r1', status }] }, { progress: stages('produce') })
- .facts.find((entry) => entry.id === 'production').label;
- expect(fact('stopped')).toBe('Production paused');
- expect(fact('blocked')).toBe('Production blocked');
- expect(fact('limit-reached')).toBe('Production at its limit');
- expect(fact('needs-replan')).toBe('Production needs a replan');
+ it('reads plainly when nothing waits on the director', () => {
+ expect(describeProjectStatus({}, { progress: stages('review') })).toEqual({ headline: 'Step 5 of 6: Final render', tone: 'muted', needsYouStage: null });
+ const done = describeProjectStatus({ renderHistoryId: 'r1' }, { progress: { current: 'publish', stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: 'done' })) } });
+ expect(done).toEqual({ headline: 'Published', tone: 'ok', needsYouStage: null });
});
+});
- it('reports drafts and the final render', () => {
- const drafts = describeProjectStatus({ excerpts: [{ id: 'a', status: 'complete', filename: 'a.mp4' }] }, { progress: stages('review') });
- expect(drafts.headline).toBe('Stage 6 of 7: Review');
- expect(drafts.facts.at(-1).label).toBe('1 draft excerpt, no final render');
- const done = describeProjectStatus({ renderHistoryId: 'r1' }, {
- progress: { current: 'publish', stages: MUSIC_VIDEO_STAGES.map((stage) => ({ ...stage, state: 'done' })) },
- readiness: readiness(true, true, true),
- });
- expect(done.headline).toBe('Published');
- expect(done.facts.map((fact) => fact.label)).toEqual(['Approvals: All 3 approved', 'Final render ready']);
- });
-
- it('shows detailed autopilot progress and omits approvals during setup without scenes', () => {
- const status = describeProjectStatus(
- { autonomousRun: { status: 'running', stage: 'lyrics', stages: { lyrics: { step: 'draft' } } }, excerpts: [] },
- { progress: stages('setup'), readiness: readiness(false, false, false) },
- );
- expect(status.headline).toBe('Stage 1 of 7: Setup');
- expect(status.facts.map((fact) => fact.label)).toEqual([
- 'Autonomous run: writing the lyric draft', 'Nothing rendered yet',
- ]);
+describe('autopilotStatus', () => {
+ it('says what the autonomous run is doing, then a parked production run, else just Autopilot', () => {
+ expect(autopilotStatus({ autonomousRun: { status: 'running', stage: 'lyrics', stages: { lyrics: { step: 'draft' } } } }))
+ .toEqual({ label: 'Autonomous run: writing the lyric draft', short: 'Autopilot running', tone: 'muted' });
+ expect(autopilotStatus({ autonomousRun: { status: 'awaiting-approval', awaiting: 'lyrics' } })).toMatchObject({ short: 'Autopilot needs you', tone: 'warn' });
+ // The button keeps the run's state while the header asks for an approval (no suppression).
+ const blocked = (status) => autopilotStatus({ productionRuns: [{ id: 'r1', status }] });
+ expect(blocked('stopped').label).toBe('Production paused');
+ expect(blocked('blocked').label).toBe('Production blocked');
+ expect(blocked('limit-reached').label).toBe('Production at its limit');
+ expect(blocked('needs-replan').label).toBe('Production needs a replan');
+ expect(blocked('running')).toMatchObject({ short: 'Autopilot running', tone: 'muted' });
+ expect(autopilotStatus({ autonomousRun: { status: 'completed' } })).toEqual({ label: 'Autopilot', short: 'Autopilot', tone: 'muted' });
+ expect(autopilotStatus({})).toEqual({ label: 'Autopilot', short: 'Autopilot', tone: 'muted' });
});
});
it('links active draft and proof jobs to their own evidence controls before offering approval', () => {
const project = { id: 'example', trackId: 'song', audioAnalysis: {}, scenes: [] };
expect(deriveNextAction(project, { draftActive: true })).toMatchObject({ id: 'draft-progress', anchor: 'mv-draft-excerpts' });
- expect(deriveNextAction(project, { proofActive: true })).toMatchObject({ id: 'proof-progress', stage: 'compose', anchor: 'mv-review-render' });
+ expect(deriveNextAction(project, { proofActive: true })).toMatchObject({ id: 'proof-progress', stage: 'produce', anchor: 'mv-review-render' });
const nextAction = deriveNextAction(project, { draftActive: true });
expect(describeProjectStatus(project, { progress: deriveStages(project), nextAction })).toMatchObject({ headline: 'Review render in progress', tone: 'muted' });
});
@@ -411,7 +419,7 @@ describe('stageChecklist', () => {
expect(items[2].detail).toBe('Attach a visual cast/environment sheet from Development artifacts.');
});
- it('covers Setup, Board, Produce and Compose with the same done answers deriveStages uses', () => {
+ it('covers Song, Storyboard and Make with the same done answers deriveStages uses', () => {
expect(stageChecklist('setup', { id: 'p' }).map((i) => i.done)).toEqual([false, false, false, false]);
expect(stageChecklist('setup', { id: 'p' })[0].action).toEqual({ label: 'Attach a track', anchor: 'mv-track' });
// A running autonomous run writes the song itself, so there is nothing to attach.
@@ -420,15 +428,15 @@ describe('stageChecklist', () => {
.toEqual([['shots', true], ['board-art', false], ['approve-storyboard', false]]);
expect(stageChecklist('produce', castProject({ scenes: [scene(), scene({ sceneId: 's2', videoHistoryId: null })] }), APPROVED)[0])
.toMatchObject({ id: 'footage', label: 'Footage for every shot (1 of 2)', done: false,
- action: { stage: 'board', params: { scenes: 'missing' } } });
+ action: { label: 'Make the footage', anchor: 'mv-generation' } });
// A code-typed shot (#10297) is drawn by the composition, so it never reads as missing footage.
expect(stageChecklist('produce', castProject({ composition: { mode: 'composed' }, scenes: [scene(), scene({ sceneId: 's2', videoHistoryId: null, visualLayer: 'code', startSec: 0, endSec: 2 })] }), APPROVED)[0])
.toMatchObject({ id: 'footage', label: 'Footage for every shot (2 of 2)', done: true });
- // A code render draws its own picture: no footage to wait on.
- expect(stageChecklist('produce', castProject({ composition: { mode: 'code' } }), APPROVED).map((i) => [i.id, i.done])).toEqual([['footage', true]]);
- // The proof closes Compose, after the composition work it is judged over.
- expect(stageChecklist('compose', castProject({ composition: { mode: 'composed', textCues: [] } }), APPROVED).map((i) => [i.id, i.done]))
- .toEqual([['composition', false], ['approve-proof', true]]);
+ // A code render draws its own picture: no footage row, just its composition and proof.
+ expect(stageChecklist('produce', castProject({ composition: { mode: 'code' } }), APPROVED).map((i) => i.id)).toEqual(['composition', 'approve-proof']);
+ // The proof closes Make, after the composition work it is judged over.
+ expect(stageChecklist('produce', castProject({ scenes: [scene()], composition: { mode: 'composed', textCues: [] } }), APPROVED).map((i) => [i.id, i.done]))
+ .toEqual([['footage', true], ['composition', false], ['approve-proof', true]]);
});
it('keeps Setup open until lyrics are imported and their timing verified, unless the song is instrumental', () => {
const base = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS };
@@ -436,7 +444,8 @@ describe('stageChecklist', () => {
expect(setup(base)).not.toBe('done');
expect(stageChecklist('setup', base).filter((i) => !i.done).map((i) => i.id)).toEqual(['lyrics', 'timing']);
const imported = { ...base, lyricCues: [{ id: 'l1', text: 'la' }] };
- expect(stageChecklist('setup', imported).find((i) => i.id === 'timing')).toMatchObject({ done: false, action: { anchor: 'mv-review-storyboard' } });
+ // Timing is verified on the Song step itself (LyricTimingCheck), not in a review panel elsewhere.
+ expect(stageChecklist('setup', imported).find((i) => i.id === 'timing')).toMatchObject({ done: false, action: { anchor: 'mv-lyric-timing' } });
expect(setup(imported)).not.toBe('done');
// The server's verdict wins over a stale draft: previously verified, timings changed since.
const verified = { ...imported, ...LYRICS };
@@ -509,3 +518,48 @@ describe('stale approval text (#10141)', () => {
expect(stages.filter((s) => s.stale).map((s) => s.id)).toEqual(['cast-sets']);
});
});
+
+describe('stepNotes', () => {
+ it('gives each step one fact from the project, and nothing for a step with nothing to say yet', () => {
+ const project = {
+ id: 'p', trackId: 't1', audioAnalysis: { durationSec: 280 }, lyricCues: [{ id: 'a', text: 'One' }, { id: 'b', text: 'Two' }],
+ scenes: [scene(), scene({ sceneId: 's2', videoHistoryId: null })],
+ devArtifacts: [{ id: 'g', title: 'Guide' }], productionReview: { draft: { guideArtifactId: 'g' } },
+ };
+ expect(stepNotes(project)).toEqual({
+ setup: '4:40 · 2 lyric lines', 'cast-sets': 'Visual guide chosen', board: '2 shots',
+ produce: '1 of 2 shots have their picture', review: '', publish: '',
+ });
+ expect(stepNotes({ ...project, composition: { mode: 'document' } }).produce).toBe('Picture drawn by the composition');
+ expect(stepNotes({ id: 'p' })).toMatchObject({ setup: 'No track yet', board: '', produce: '' });
+ expect(stepNotes({ ...project, renderHistoryId: 'r', renderDependencyState: { status: 'stale' } }).review).toBe('Out of date');
+ });
+});
+
+describe('storyboard animatic preview source', () => {
+ it('is offered last once the project has a track and shots', () => {
+ expect(listPreviewSources({ trackId: 't1', scenes: [scene()] }).map((s) => s.id)).toEqual(['animatic']);
+ expect(listPreviewSources({ trackId: 't1', scenes: [] })).toEqual([]);
+ expect(listPreviewSources({ scenes: [scene()] })).toEqual([]);
+ const excerpts = [{ id: 'a', status: 'complete', filename: 'a.mp4', startSec: 0, endSec: 5 }];
+ expect(listPreviewSources({ trackId: 't1', scenes: [scene()], excerpts }).map((s) => s.id)).toEqual(['excerpt:a', 'animatic']);
+ });
+});
+
+describe('server project summary', () => {
+ it('reports the same current step the page derives, for every step', () => {
+ const base = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, ...LYRICS };
+ const projects = [
+ { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS },
+ base,
+ { ...base, scenes: [scene({ videoHistoryId: null })] },
+ { ...base, scenes: [scene()], composition: { mode: 'composed', textCues: [] } },
+ { ...base, scenes: [scene()] },
+ { ...base, scenes: [scene()], renderHistoryId: 'rh-1' },
+ ];
+ const readinesses = [undefined, { ...APPROVED, art: { approved: false, problems: [] } }, APPROVED, APPROVED, APPROVED, APPROVED];
+ const stages = projects.map((project, i) => [summarizeMusicVideoProject(project, readinesses[i]).stage, deriveStages(project, readinesses[i]).current]);
+ for (const [summary, page] of stages) expect(summary).toBe(page);
+ expect(stages.map(([summary]) => summary)).toEqual(['setup', 'cast-sets', 'produce', 'produce', 'review', 'publish']);
+ });
+});
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 6c51d8eabd..98b3a10ab7 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -60,11 +60,10 @@ import MidiGatedModal from '../components/install/MidiGatedModal.jsx';
import { listTracks, trackAudioUrl } from '../services/apiTracks.js';
import CreateProjectDrawer from '../components/musicVideo/CreateProjectDrawer.jsx';
import AutonomousStartDrawer from '../components/musicVideo/AutonomousStartDrawer.jsx';
-import AutonomousRunPanel from '../components/musicVideo/AutonomousRunPanel.jsx';
import { automationDraftFrom, automationFromDraft } from '../lib/musicVideoAutomation.js';
import { listUniverseNames } from '../services/apiUniverseBuilder.js';
import MusicVideoLayout, { MUSIC_VIDEO_SCROLL_ID } from '../components/musicVideo/MusicVideoLayout.jsx';
-import StageSection from '../components/musicVideo/StageSection.jsx';
+import ProjectSettingsDrawer, { SETTINGS_TAB_IDS } from '../components/musicVideo/ProjectSettingsDrawer.jsx';
import MusicVideoProjectCard from '../components/musicVideo/MusicVideoProjectCard.jsx';
import PreviewDock from '../components/musicVideo/PreviewDock.jsx';
import NeedsAttentionBanner from '../components/musicVideo/NeedsAttentionBanner.jsx';
@@ -73,7 +72,6 @@ import StageChecklist from '../components/musicVideo/StageChecklist.jsx';
import CastSetsStage from '../components/musicVideo/stages/CastSetsStage.jsx';
import BoardStage from '../components/musicVideo/stages/BoardStage.jsx';
import ProduceStage from '../components/musicVideo/stages/ProduceStage.jsx';
-import ComposeStage from '../components/musicVideo/stages/ComposeStage.jsx';
import ReviewStage from '../components/musicVideo/stages/ReviewStage.jsx';
import { PUBLISH_TARGETS } from '../components/musicVideo/PublishPostingPanel.jsx';
import PublishStage from '../components/musicVideo/stages/PublishStage.jsx';
@@ -90,10 +88,10 @@ import { deriveAttentionItems } from '../lib/musicVideoAttention.js';
import { latestMusicVideoReviewDraft } from '../../../server/lib/musicVideoReviewDraft.js';
import { useMusicVideoReviewDraft } from '../hooks/useMusicVideoReviewDraft.js';
import {
- productionReviewStopGuidance, deriveNextAction, deriveStages, projectShotSummary, describeProjectStatus, listPreviewSources, projectSpend, resolveStageParam, stageChecklist, compareMusicVideoProjectsNewestFirst,
+ deriveNextAction, deriveStages, projectShotSummary, describeProjectStatus, listPreviewSources, projectSpend, resolveStageParam, stageChecklist, stepNotes, autopilotStatus, compareMusicVideoProjectsNewestFirst,
} from '../lib/musicVideoStages.js';
import { groupMusicVideoProjects } from '../lib/musicVideoProjectList.js';
-import { AUTONOMOUS_STATUS_LABELS, AUTONOMOUS_VIEWABLE_STAGES } from '../lib/musicVideoAutonomous.js';
+import { AUTONOMOUS_VIEWABLE_STAGES } from '../lib/musicVideoAutonomous.js';
// Automation first: a new project defaults to autopilot with the free tools.
const emptyCreateForm = () => ({
@@ -112,18 +110,13 @@ function autopilotBlocker(project) {
// A saved art draft needs every field the server schema requires.
const EMPTY_PRODUCTION_DRAFT = { cast: '', environments: '', visualLanguage: '', motionLanguage: '', guideArtifactId: null,
lyricsMode: 'vocal', timingStatus: 'provisional', timingNotes: '', storyboard: [] };
-// The tab that owns each production approval (#10151).
-const APPROVAL_STAGE_BY_TAB = { 'cast-sets': 'art', board: 'storyboard', compose: 'proof' };
+// The step each production approval closes (#10151); it sits at the bottom of that step.
+const APPROVAL_STAGE_BY_TAB = { 'cast-sets': 'art', board: 'storyboard', produce: 'proof' };
const STAGE_VIEWS = {
- setup: SetupStage, 'cast-sets': CastSetsStage, board: BoardStage, produce: ProduceStage, compose: ComposeStage, review: ReviewStage, publish: PublishStage,
+ setup: SetupStage, 'cast-sets': CastSetsStage, board: BoardStage, produce: ProduceStage, review: ReviewStage, publish: PublishStage,
};
-// Keep active work open; historical runs remain available behind their summary.
-const autopilotSummary = (run, readiness) => {
- const label = run.interrupted ? 'Interrupted — resume to continue' : AUTONOMOUS_STATUS_LABELS[run.status] || run.status;
- const guidance = productionReviewStopGuidance(run, readiness);
- return run.error ? `${label} — ${guidance?.current || run.error}` : label;
-};
+
export default function MusicVideo() {
// Deep-linkable project selection: the selected project lives in the URL
@@ -931,7 +924,7 @@ export default function MusicVideo() {
items.push(videoItem(take.assetId, `${take.assetId}.mp4`, take.prompt || scene.prompt || ''));
}
}
- // Scenes can reuse the same frame/clip (the Produce tab's generation controls surface a
+ // Scenes can reuse the same frame/clip (Make's generation controls surface a
// "Repetition: N unique frames" badge). Dedupe by key so prev/next and
// openPreview's .find() land on a single item rather than the first of
// several identical keys with different prompts.
@@ -966,6 +959,16 @@ export default function MusicVideo() {
const search = next.toString();
navigate(`/music-video/${encodeURIComponent(selected.id)}/${stage}${search ? `?${search}` : ''}${anchor ? `#${anchor}` : ''}`, { replace: activeStage === stage });
};
+ // Project settings (render style, audio tools, autopilot, files) is a drawer
+ // over the open step; `?mvPanel=<tab>` says it is open and on which tab.
+ const settingsParam = searchParams.get('mvPanel');
+ const settingsTab = SETTINGS_TAB_IDS.includes(settingsParam) ? settingsParam : null;
+ const setSettingsTab = (tab) => setSearchParams((prev) => {
+ const next = new URLSearchParams(prev);
+ if (tab) next.set('mvPanel', tab);
+ else next.delete('mvPanel');
+ return next;
+ }, { replace: !!tab && !!settingsTab });
// The docked preview: scene cards seek it; on a phone it is a mini-player
// that starts collapsed. Both reset with the project.
@@ -1002,7 +1005,7 @@ export default function MusicVideo() {
? { id: 'review-imported', kind: 'goto', stage: 'review', label: 'Checking review draft', disabled: true, reason: 'Checking exact-version media availability' }
: reviewDraft
? { id: 'review-imported', kind: 'goto', stage: 'review', label: 'Review imported draft', shortLabel: 'Review draft' }
- : { id: 'review-files', kind: 'goto', stage: 'review', anchor: 'mv-review-development', label: 'Choose review file', shortLabel: 'Choose file' }
+ : { id: 'review-files', kind: 'open', label: 'Choose review file', shortLabel: 'Choose file' }
: productionNextAction;
// What the server holds that this tab might not be showing (#9940): derived
// from the saved record, so it survives a reload. Work this tab can see
@@ -1017,6 +1020,8 @@ export default function MusicVideo() {
const runNextAction = () => {
if (!selected || !nextAction || nextAction.disabled || compositionSavePending > 0) return;
if (nextAction.id === 'review-imported') { openArtifact(reviewDraft.artifactId); return; }
+ if (nextAction.id === 'review-files') { setSettingsTab('files'); return; }
+ if (nextAction.id === 'review-autonomous') { setSettingsTab('autopilot'); return; }
if (nextAction.kind === 'goto') { goToStage(nextAction.stage, nextAction.anchor); return; }
switch (nextAction.id) {
case 'kickoff': handleKickoff(); break;
@@ -1133,14 +1138,22 @@ export default function MusicVideo() {
// Choose a Development file as the art-direction visual guide (saved with the rest of the draft).
useAsGuide: (artifactId) => productionReview.save({ ...EMPTY_PRODUCTION_DRAFT, ...(selected.productionReview?.draft || {}), guideArtifactId: artifactId }),
goToStage,
+ openSettings: setSettingsTab,
+ productionReview,
+ planningDraft,
openArtifact,
openPreview,
openContactSheet: () => setContactSheetOpen(true),
seekToScene,
} : null;
const StageView = STAGE_VIEWS[activeStage];
+ const projectStatus = !selected ? null : statusKnown && productionReview.readiness
+ ? describeProjectStatus(selected, { progress, nextAction: productionNextAction, reviewingDraft, reviewDraftState })
+ : statusKnown
+ ? { headline: `Status unavailable: ${productionReview.readinessError}`, tone: 'warn', needsYouStage: null }
+ : { headline: 'Loading status…', tone: 'muted', needsYouStage: null };
- const previewSources = selected ? listPreviewSources(selected, { finalVideoSrc: finalVideo.src, liveFirst: activeStage === 'compose' }) : [];
+ const previewSources = selected ? listPreviewSources(selected, { finalVideoSrc: finalVideo.src, liveFirst: activeStage === 'produce' }) : [];
return (
<div className="flex h-full flex-col">
@@ -1425,6 +1438,9 @@ export default function MusicVideo() {
)}
</div>
)}
+ {selected && (
+ <ProjectSettingsDrawer open={!!settingsTab} tab={settingsTab || 'project'} onTabChange={setSettingsTab} onClose={() => setSettingsTab(null)} board={board} />
+ )}
{selected && (
<MusicVideoLayout
project={selected}
@@ -1435,11 +1451,10 @@ export default function MusicVideo() {
nextAction={compositionSavePending > 0 && nextAction ? { ...nextAction, disabled: true, reason: 'Saving composition…' } : nextAction}
onNextAction={runNextAction}
spend={projectSpend(selected)}
- status={statusKnown && productionReview.readiness
- ? describeProjectStatus(selected, { progress, nextAction: productionNextAction, readiness: productionReview.readiness, reviewingDraft, reviewDraftState })
- : statusKnown
- ? { headline: `Status unavailable: ${productionReview.readinessError}`, tone: 'warn', facts: [] }
- : { headline: 'Loading status…', tone: 'muted', facts: [] }}
+ status={projectStatus}
+ notes={stepNotes(selected, productionReview.readiness, publish)}
+ autopilot={autopilotStatus(selected)}
+ onOpenSettings={setSettingsTab}
attention={(
<NeedsAttentionBanner
items={attentionItems}
@@ -1456,7 +1471,7 @@ export default function MusicVideo() {
}}
/>
)}
- dock={previewSources.length ? (
+ dock={(
<PreviewDock
project={selected}
sources={previewSources}
@@ -1465,42 +1480,26 @@ export default function MusicVideo() {
collapsed={dockCollapsed}
onToggleCollapsed={() => setDockCollapsed((c) => !c)}
/>
- ) : null}
- projectPanels={<div className="space-y-3 min-w-0">
- {autopilotRun && activeStage !== 'setup' && (
- <StageSection
- id="mv-autonomous-run"
- key={`autonomous-${selected.id}`}
- title="Autonomous run"
- summary={autopilotSummary(autopilotRun, productionReview.readiness)}
- defaultOpen={!!runStage || autopilotRun.interrupted || ['running', 'awaiting-approval', 'needs-human', 'failed'].includes(autopilotRun.status)}
- >
- <AutonomousRunPanel project={selected} auto={autonomous} readiness={productionReview.readiness} selectedStage={runStage} onSelectStage={setRunStage} framed={false} />
- </StageSection>
- )}
- </div>}
+ )}
>
- <StageSection title="Native production prerequisites">
<StageChecklist
items={stageChecklist(activeStage, selected, productionReview.readiness, publish)}
onAction={(action) => goToStage(action.stage || activeStage, action.anchor, action.params)}
onRevert={productionReview.revert}
headerAnchor={nextAction?.kind === 'goto' ? nextAction.anchor : null}
/>
- </StageSection>
+ <StageView key={selected.id} board={board} />
{APPROVAL_STAGE_BY_TAB[activeStage] && (
<ProductionReviewPanel
key={`${selected.id}-${activeStage}`}
project={selected}
review={productionReview}
onOpenArtifact={openArtifact}
- framed={false}
stage={APPROVAL_STAGE_BY_TAB[activeStage]}
planning={planningDraft}
onNavigate={goToStage}
/>
)}
- <StageView key={selected.id} board={board} />
</MusicVideoLayout>
)}
</div>
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index 46a5062b5f..1bab0f187c 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -335,11 +335,19 @@ const selectProject = async (projectId) => {
return picker;
};
-// The page is a set of stage tabs (deep-linked as /music-video/:id/:stage); a
-// control is only on screen while its stage is open, so tests say which one.
+// The page is a set of steps (deep-linked as /music-video/:id/:stage); a
+// control is only on screen while its step is open, so tests say which one.
+// Compose is part of Make now. The phone's step bar is the tablist.
const STAGE_TABS = {
- setup: /^Setup/, 'cast-sets': /^Cast & Sets/, board: /^Board/, produce: /^Produce/, compose: /^Compose/, review: /^Review/,
+ setup: /^Song/, 'cast-sets': /^Look/, board: /^Storyboard/, produce: /^Make/, compose: /^Make/, review: /^Final render/,
};
+// Project settings (render style, audio tools, autopilot, files) is a drawer over the step.
+const openSettings = async (tab = 'Project') => {
+ fireEvent.click(screen.getByRole('button', { name: 'Project settings' }));
+ const drawerTab = await screen.findByRole('tab', { name: new RegExp(`^${tab}`) });
+ fireEvent.click(drawerTab);
+};
+const closeSettings = () => fireEvent.click(screen.getByRole('button', { name: 'Close project settings' }));
const openStage = async (stage, selectFirstScene = true) => {
const tab = await screen.findByRole('tab', { name: STAGE_TABS[stage] });
fireEvent.click(tab);
@@ -467,7 +475,7 @@ describe('MusicVideo project load recovery (#9761)', () => {
expect(screen.getByTestId('mv-project-grid')).toHaveTextContent(PROJECT_NO_CLIP.name);
} else {
expect(screen.getByRole('heading', { level: 2, name: PROJECT_NO_CLIP.name })).toBeInTheDocument();
- expect(screen.getByRole('tab', { name: /^Board/ })).toHaveAttribute('aria-selected', 'true');
+ expect(screen.getByRole('tab', { name: /^Storyboard/ })).toHaveAttribute('aria-selected', 'true');
}
});
@@ -749,13 +757,13 @@ describe('MusicVideo render control (#1760)', () => {
expect(renderBtn).toHaveProperty('disabled', true);
});
- it('keeps full-quality and sharing controls together in the compact native-final disclosure', async () => {
+ it('keeps full-quality and sharing controls together in the final render section', async () => {
await openProject({ ...PROJECT_WITH_CLIP, renderHistoryId: 'rh-9' }, 'review');
const fullQuality = await screen.findByRole('link', { name: /Download MP4/i });
const sharing = await screen.findByRole('button', { name: 'Prepare sharing copy' });
- const disclosure = fullQuality.closest('details');
- expect(disclosure).toHaveAttribute('id', 'mv-final-video');
- expect(disclosure).toContainElement(sharing);
+ const section = fullQuality.closest('#mv-final-video');
+ expect(section).toHaveAccessibleName('Final render');
+ expect(section).toContainElement(sharing);
expect(sharing).toHaveClass('min-h-[44px]');
const link = await screen.findByText(/Open in Media History/i);
// Media History matches video items by their `video:<id>` key via ?preview=.
@@ -956,9 +964,11 @@ describe('MusicVideo project video renderer', () => {
await openProject({
...PROJECT_NO_CLIP,
videoSettings: { modelId: 'ltx23_distilled_q4' },
- }, 'setup');
+ });
+ await openSettings('Project');
expect(await screen.findByLabelText('Scene video renderer')).toHaveProperty('value', '');
+ closeSettings();
await openStage('board');
fireEvent.click(screen.getByRole('button', { name: /^Generate video$/ }));
await waitFor(() => expect(generateVideo).toHaveBeenCalled());
@@ -967,7 +977,8 @@ describe('MusicVideo project video renderer', () => {
});
it('clears an existing backend pin with the Install default option', async () => {
- await openProject(PROJECT_NO_CLIP, 'setup');
+ await openProject(PROJECT_NO_CLIP);
+ await openSettings('Project');
fireEvent.change(await screen.findByLabelText('Scene video renderer'), {
target: { value: '' },
@@ -982,7 +993,8 @@ describe('MusicVideo project video renderer', () => {
it('persists the local model and uses it for scene generation', async () => {
generateVideo.mockResolvedValue({ jobId: 'video-job-1' });
- await openProject(PROJECT_NO_CLIP, 'setup');
+ await openProject(PROJECT_NO_CLIP);
+ await openSettings('Project');
const model = await screen.findByLabelText('Local video model');
fireEvent.change(model, { target: { value: 'ltx23_distilled_q4' } });
@@ -992,6 +1004,7 @@ describe('MusicVideo project video renderer', () => {
{ silent: true },
));
+ closeSettings();
await openStage('board');
fireEvent.click(screen.getByRole('button', { name: /^Generate video$/ }));
await waitFor(() => expect(generateVideo).toHaveBeenCalledWith(expect.objectContaining({
@@ -1020,7 +1033,8 @@ describe('MusicVideo project video renderer', () => {
it('uses project audio as no-vocals conditioning at the scene song offset', async () => {
generateVideo.mockResolvedValue({ jobId: 'audio-reactive-job' });
- await openProject(PROJECT_NO_CLIP, 'setup');
+ await openProject(PROJECT_NO_CLIP);
+ await openSettings('Project');
fireEvent.change(await screen.findByLabelText('Scene generation mode'), {
target: { value: 'audioReactive' },
@@ -1037,6 +1051,7 @@ describe('MusicVideo project video renderer', () => {
{ silent: true },
));
+ closeSettings();
await openStage('board');
fireEvent.click(screen.getByRole('button', { name: /^Generate video$/ }));
await waitFor(() => expect(generateVideo).toHaveBeenCalledWith(expect.objectContaining({
@@ -1062,7 +1077,8 @@ describe('MusicVideo project video renderer', () => {
audioReactiveLora: 'audio-reactive-v2.safetensors',
audioReactiveScale: 1.2,
},
- }, 'setup');
+ });
+ await openSettings('Project');
const lora = await screen.findByLabelText('Audio reactive LoRA');
expect(lora.value).toBe('audio-reactive-v2.safetensors');
@@ -1082,7 +1098,8 @@ describe('MusicVideo project video renderer', () => {
falEnabled: true,
models: [{ id: 'ltx23_distilled_q4', name: 'LTX-2.3 Distilled Q4', runtime: 'ltx2' }],
});
- await openProject(PROJECT_NO_CLIP, 'setup');
+ await openProject(PROJECT_NO_CLIP);
+ await openSettings('Project');
fireEvent.change(await screen.findByLabelText('Scene video renderer'), {
target: { value: 'fal' },
@@ -1121,9 +1138,11 @@ describe('MusicVideo project video renderer', () => {
await openProject({
...PROJECT_NO_CLIP,
videoSettings: { backend: 'fal', falDuration: 6 },
- }, 'setup');
+ });
+ await openSettings('Project');
expect(await screen.findByLabelText('fal.ai scene clip duration')).toHaveProperty('value', '6');
+ closeSettings();
await openStage('board');
// No model pin: the default Hailuo-02 image-to-video take, priced before it is paid for.
expect((await screen.findByTestId('fal-cutaway-plan')).textContent).toContain('est. $0.27 (6s at 768P)');
@@ -1157,7 +1176,7 @@ describe('MusicVideo project video renderer', () => {
})));
// Switching model clears the resolution pin — its alphabet is per model.
- await openStage('setup');
+ await openSettings('Project');
fireEvent.change(await screen.findByLabelText('fal.ai cutaway model'), {
target: { value: 'fal-ai/kling-video/v3/pro/image-to-video' },
});
@@ -1193,9 +1212,11 @@ describe('MusicVideo project video renderer', () => {
});
it('labels Grok cutaway-only and blocks a performance shot on it without calling the provider', async () => {
- await openProject(performanceProject({ backend: 'grok', grokDuration: 6 }), 'setup');
+ await openProject(performanceProject({ backend: 'grok', grokDuration: 6 }));
+ await openSettings('Project');
expect(await screen.findByRole('option', { name: 'Grok video (cutaway only)' })).toBeTruthy();
+ closeSettings();
await openStage('board');
expect(await screen.findByText(/Grok video is cutaway-only/)).toBeTruthy();
const generate = await screen.findByRole('button', { name: /^Generate video$/ });
@@ -1391,13 +1412,15 @@ describe('MusicVideo musical timeline', () => {
describe('MusicVideo audio → MIDI transcription (MuScriptor)', () => {
it('disables the MIDI button when the project has no audio source', async () => {
- await openProject({ ...PROJECT_WITH_CLIP, trackId: null, uploadedAudioFilename: null }, 'setup');
+ await openProject({ ...PROJECT_WITH_CLIP, trackId: null, uploadedAudioFilename: null });
+ await openSettings('Audio');
const btn = await screen.findByRole('button', { name: /^MIDI$/ });
expect(btn).toHaveProperty('disabled', true);
});
it('kicks off a transcription for the selected project with the default model', async () => {
- await openProject(PROJECT_WITH_CLIP, 'setup');
+ await openProject(PROJECT_WITH_CLIP);
+ await openSettings('Audio');
const btn = await screen.findByRole('button', { name: /^MIDI$/ });
expect(btn).toHaveProperty('disabled', false);
fireEvent.click(btn);
@@ -1405,7 +1428,8 @@ describe('MusicVideo audio → MIDI transcription (MuScriptor)', () => {
});
it('kicks off a transcription with the chosen model size', async () => {
- await openProject(PROJECT_WITH_CLIP, 'setup');
+ await openProject(PROJECT_WITH_CLIP);
+ await openSettings('Audio');
fireEvent.change(await screen.findByLabelText('MuScriptor model size'), { target: { value: 'large' } });
fireEvent.click(await screen.findByRole('button', { name: /^MIDI$/ }));
await waitFor(() => expect(transcribeMusicVideoMidi).toHaveBeenCalledWith('mv-1', { model: 'large' }, { silent: true }));
@@ -1413,7 +1437,8 @@ describe('MusicVideo audio → MIDI transcription (MuScriptor)', () => {
it('shows the MIDI download link once the project carries a transcription pointer', async () => {
listTracks.mockResolvedValue([{ id: 't1', title: 'Neon Song', audioFilename: 'neon.mp3' }]);
- await openProject({ ...PROJECT_WITH_CLIP, midiTranscription: { filename: 'neon-midi.mid', model: 'medium' } }, 'setup');
+ await openProject({ ...PROJECT_WITH_CLIP, midiTranscription: { filename: 'neon-midi.mid', model: 'medium' } });
+ await openSettings('Audio');
// Two links now: the download button and the MidiVisualization panel's
// download icon (#2477) — both serve from the music dir (same static route
// as the master audio) so the federated .mid resolves on peers too.
@@ -1464,7 +1489,7 @@ describe('MusicVideo AI Plan on a board that already has scenes (#10144)', () =>
});
describe('MusicVideo autonomous mode setup experience', () => {
- it('renders autonomous run at top of setup, hides lyrics fork callout when no lyrics exist, and reflects progress in next action', async () => {
+ it('opens the autonomous run from the header Autopilot button, hides the lyrics fork callout when no lyrics exist, and reflects progress in next action', async () => {
const autoProject = {
id: 'mv-auto-1',
name: 'Autonomous MV',
@@ -1485,11 +1510,16 @@ describe('MusicVideo autonomous mode setup experience', () => {
};
await openProject(autoProject, 'setup');
- const runRegion = screen.getByRole('region', { name: 'Autonomous run' });
+ // The header's Autopilot button names what the run is doing and opens its panel in Project settings › Autopilot.
+ fireEvent.click(screen.getByRole('button', { name: /Autonomous run: writing the lyric draft/i }));
+ const runRegion = await screen.findByRole('region', { name: 'Autonomous run' });
expect(runRegion).toBeInTheDocument();
+ // No lyrics yet: the song fork callout (Project settings › Audio) stays hidden.
+ fireEvent.click(screen.getByRole('tab', { name: /^Audio/ }));
expect(screen.queryByRole('heading', { name: 'Revise lyrics & song' })).toBeNull();
expect(screen.queryByRole('button', { name: 'Fork & revise song' })).toBeNull();
+ closeSettings();
expect(screen.queryByRole('button', { name: 'Attach a track' })).toBeNull();
expect(screen.getByRole('button', { name: 'Writing the lyric draft…' })).toBeDisabled();
@@ -1669,7 +1699,7 @@ describe('MusicVideo section layers (#8985)', () => {
describe('MusicVideo concept & style editor (#3168)', () => {
it('seeds the fields from the project and persists each on blur', async () => {
const withConcept = { ...PROJECT_NO_CLIP, concept: { prompt: 'A road trip through neon ruins', style: 'Cyberpunk anime' } };
- await openProject(withConcept, 'setup');
+ await openProject(withConcept, 'cast-sets');
const conceptField = await screen.findByLabelText('Concept');
const styleField = screen.getByLabelText('Visual style');
@@ -1695,7 +1725,7 @@ describe('MusicVideo concept & style editor (#3168)', () => {
it('does not re-PATCH when a field is focused and blurred without an edit', async () => {
const withConcept = { ...PROJECT_NO_CLIP, concept: { prompt: 'Unchanged', style: 'Unchanged' } };
- await openProject(withConcept, 'setup');
+ await openProject(withConcept, 'cast-sets');
const conceptField = await screen.findByLabelText('Concept');
fireEvent.focus(conceptField);
fireEvent.blur(conceptField);
@@ -1712,11 +1742,14 @@ describe('MusicVideo concept & style editor (#3168)', () => {
listMusicVideoProjects.mockResolvedValue([PROJECT_NO_CLIP, projectB]);
renderMV();
await selectProject(PROJECT_NO_CLIP.id);
+ // Concept and style are creative direction, on the Look step.
+ await openStage('cast-sets');
const conceptField = await screen.findByLabelText('Concept');
fireEvent.change(conceptField, { target: { value: 'A unsaved draft' } });
// No blur — switch projects while the edit is still pending.
await selectProject(projectB.id);
+ await openStage('cast-sets');
await waitFor(() => expect(screen.getByLabelText('Concept')).toHaveValue('B original'));
fireEvent.blur(screen.getByLabelText('Concept'));
@@ -1729,7 +1762,7 @@ describe('MusicVideo concept & style editor (#3168)', () => {
});
it('starts empty and enables AI Plan to use them once set', async () => {
- await openProject(PROJECT_ANALYZED, 'setup');
+ await openProject(PROJECT_ANALYZED, 'cast-sets');
const conceptField = await screen.findByLabelText('Concept');
expect(conceptField).toHaveValue('');
@@ -2045,7 +2078,8 @@ describe('MusicVideo YouTube audio import (#1945)', () => {
// An instrumental track: nothing to import, so nothing to separate or align.
importMusicVideoTrackLyrics.mockResolvedValue({ project: analyzed, imported: 0, markers: 0, skipped: 'no-track-lyrics' });
planMusicVideoProject.mockResolvedValue({ project: analyzed, scenesAdded: 3, promptsSeeded: true });
- await openProject(project, 'produce');
+ await openProject(project);
+ await openSettings('Autopilot');
fireEvent.click(screen.getByRole('button', { name: /Analyze & plan/ }));
await waitFor(() => expect(planMusicVideoProject).toHaveBeenCalledWith(project.id, { seedPrompts: true }, { silent: true }));
expect(analyzeMusicVideoProject).toHaveBeenCalledWith(project.id, { silent: true });
@@ -2060,7 +2094,8 @@ describe('MusicVideo YouTube audio import (#1945)', () => {
automation: { tools: ['code:render'], guidance: '', budgetUsd: null, checkins: { castAndSets: 'review' } } };
const directing = { ...project, castAndSets: { status: 'directing', revision: 1, plan: {}, images: {} } };
startMusicVideoCastAndSets.mockResolvedValue({ project: directing, stage: directing.castAndSets });
- await openProject(project, 'produce');
+ await openProject(project);
+ await openSettings('Autopilot');
fireEvent.click(screen.getByRole('button', { name: /Analyze & plan/ }));
// The server directs it procedurally (no image backend for a code-only brief); the run still gates on it.
await waitFor(() => expect(startMusicVideoCastAndSets).toHaveBeenCalledWith(project.id, {}, { silent: true }));
@@ -2076,11 +2111,13 @@ describe('MusicVideo YouTube audio import (#1945)', () => {
const approved = { ...reviewing, castAndSets: { ...reviewing.castAndSets, status: 'approved' }, devArtifacts: [{ ...sheet, status: 'approved' }] };
approveMusicVideoCastAndSets.mockResolvedValue({ project: approved, stage: approved.castAndSets });
planMusicVideoProject.mockResolvedValue({ project: approved, scenesAdded: 2, promptsSeeded: true });
- await openProject(project, 'produce');
+ await openProject(project);
+ await openSettings('Autopilot');
fireEvent.click(screen.getByRole('button', { name: /Analyze & plan/ }));
await waitFor(() => expect(startMusicVideoCastAndSets).toHaveBeenCalledWith(project.id, {}, { silent: true }));
await pushSocket('music-video:cast-and-sets', { projectId: project.id, project: reviewing, stage: reviewing.castAndSets });
+ closeSettings();
// Existing Cast & Sets controls still apply references; Production review separately authorizes work.
await openStage('cast-sets');
expect(await screen.findByText('Waiting for your check-in.')).toBeTruthy();
@@ -2098,7 +2135,8 @@ describe('MusicVideo YouTube audio import (#1945)', () => {
startMusicVideoCastAndSets.mockResolvedValue({ project: directing, stage: directing.castAndSets });
const approved = { ...project, castAndSets: { status: 'approved', revision: 1, plan: {}, images: {} } };
planMusicVideoProject.mockResolvedValue({ project: approved, scenesAdded: 2, promptsSeeded: true });
- await openProject(project, 'produce');
+ await openProject(project);
+ await openSettings('Autopilot');
fireEvent.click(screen.getByRole('button', { name: /Analyze & plan/ }));
await waitFor(() => expect(startMusicVideoCastAndSets).toHaveBeenCalled());
@@ -2322,7 +2360,9 @@ describe('MusicVideo visual spec, takes and handoff (#8965)', () => {
imported: [{ sceneId: 's1', takeId: 't-mj', kind: 'image', assetId: 'upload-0001.png', originalName: 'S01-s1-harbor.png' }],
skipped: [],
});
- await openProject(SPEC_PROJECT, 'produce');
+ await openProject(SPEC_PROJECT);
+ // The external handoff lives in Project settings › Files.
+ await openSettings('Files');
const file = new File(['png-bytes'], 'S01-s1-harbor.png', { type: 'image/png' });
fireEvent.change(screen.getByLabelText('Import generated files'), { target: { files: [file] } });
@@ -2332,6 +2372,7 @@ describe('MusicVideo visual spec, takes and handoff (#8965)', () => {
}, { silent: true }));
expect(uploadGalleryImage).toHaveBeenCalledTimes(1);
await waitFor(() => expect(toast.success).toHaveBeenCalledWith('Imported 1 take from midjourney'));
+ closeSettings();
// The imported take filled the empty slot on the board.
await openStage('board');
expect(await screen.findByRole('button', { name: 'View scene 1 reference frame full size' })).toBeTruthy();
@@ -2339,7 +2380,9 @@ describe('MusicVideo visual spec, takes and handoff (#8965)', () => {
it('downloads the ZIP handoff bundle from Export bundle (#8978)', async () => {
getMusicVideoHandoffBundle.mockResolvedValueOnce(new ArrayBuffer(8));
- await openProject(SPEC_PROJECT, 'produce');
+ await openProject(SPEC_PROJECT);
+ // The external handoff lives in Project settings › Files.
+ await openSettings('Files');
fireEvent.click(await screen.findByRole('button', { name: /^Export bundle$/ }));
await waitFor(() => expect(getMusicVideoHandoffBundle).toHaveBeenCalledWith('mv-spec', { silent: true }));
await waitFor(() => expect(downloadBlob).toHaveBeenCalledWith(
@@ -2363,7 +2406,7 @@ describe('MusicVideo pull references from universe (#8978)', () => {
places: [{ id: 'p1', name: 'Harbor', imageRefs: ['harbor.png'] }], // already a reference
objects: [],
});
- await openProject(UNIVERSE_PROJECT, 'setup');
+ await openProject(UNIVERSE_PROJECT, 'cast-sets');
fireEvent.click(await screen.findByRole('button', { name: /^Pull from universe$/ }));
await waitFor(() => expect(getUniverse).toHaveBeenCalledWith('u1', { silent: true }));
@@ -2384,7 +2427,7 @@ describe('MusicVideo pull references from universe (#8978)', () => {
getUniverse.mockResolvedValue({
characters: [], places: [{ id: 'p1', name: 'Harbor', imageRefs: ['harbor.png'] }], objects: [],
});
- await openProject(UNIVERSE_PROJECT, 'setup');
+ await openProject(UNIVERSE_PROJECT, 'cast-sets');
fireEvent.click(await screen.findByRole('button', { name: /^Pull from universe$/ }));
await waitFor(() => expect(getUniverse).toHaveBeenCalledTimes(1));
expect(updateMusicVideoProject).not.toHaveBeenCalled();
@@ -2394,7 +2437,7 @@ describe('MusicVideo pull references from universe (#8978)', () => {
it('applies the pull against the latest references, not a stale click-time snapshot (race guard)', async () => {
let resolveUniverse;
getUniverse.mockReturnValueOnce(new Promise((resolve) => { resolveUniverse = resolve; }));
- await openProject(UNIVERSE_PROJECT, 'setup');
+ await openProject(UNIVERSE_PROJECT, 'cast-sets');
fireEvent.click(await screen.findByRole('button', { name: /^Pull from universe$/ }));
await waitFor(() => expect(getUniverse).toHaveBeenCalledTimes(1));
@@ -2420,7 +2463,7 @@ describe('MusicVideo pull references from universe (#8978)', () => {
});
it('does not offer Pull from universe when the project has no linked universe', async () => {
- await openProject(PROJECT_NO_CLIP, 'setup');
+ await openProject(PROJECT_NO_CLIP, 'cast-sets');
expect(screen.queryByRole('button', { name: /Pull from universe/i })).toBeNull();
});
});
@@ -2472,30 +2515,55 @@ describe('MusicVideo stage tabs (#9243)', () => {
);
const selectedTab = () => screen.getByRole('tab', { selected: true });
- it('puts the selected stage before the shared run panel, shows only its own approval, and keeps unsaved planning edits across tabs', async () => {
+ it('opens Project settings › Autopilot at the checkpoint editor from an attention deep link', async () => {
+ listMusicVideoProjects.mockResolvedValue([{ ...PROJECT_WITH_CLIP,
+ autonomousRun: { id: 'auto-1', status: 'awaiting-approval', awaiting: 'lyrics', stage: 'lyrics', output: { lyrics: 'Example lyric line' }, brief: {} },
+ }]);
+ renderAt('/music-video/mv-1/setup?mvPanel=autopilot#mv-auto-edit');
+ await screen.findByRole('heading', { level: 2, name: PROJECT_WITH_CLIP.name });
+ const dialog = await screen.findByRole('dialog');
+ expect(within(dialog).getByRole('tab', { name: /^Autopilot/ })).toHaveAttribute('aria-selected', 'true');
+ await waitFor(() => expect(document.getElementById('mv-auto-edit')).toHaveFocus());
+ expect(dialog.contains(document.getElementById('mv-auto-edit'))).toBe(true);
+ });
+
+ it('puts the selected step before its own approval, keeps the run in Project settings, and keeps unsaved planning edits across steps', async () => {
listMusicVideoProjects.mockResolvedValue([{ ...PROJECT_WITH_CLIP,
autonomousRun: { status: 'needs-human', stage: 'video', output: {}, brief: {} },
}]);
renderAt('/music-video/mv-1/cast-sets');
await screen.findByRole('heading', { level: 2, name: PROJECT_WITH_CLIP.name });
const review = screen.getByRole('region', { name: 'Production review' });
- expect(within(review).getByText('Art direction')).toBeInTheDocument();
- expect(within(review).queryByText('Lyric-timed storyboard')).toBeNull();
+ expect(within(review).getByRole('region', { name: 'Approve: Art direction' })).toBeInTheDocument();
+ expect(within(review).queryByRole('region', { name: 'Approve: Lyric-timed storyboard' })).toBeNull();
expect(screen.queryByText('Production approvals')).toBeNull();
const castDraft = within(review).getByLabelText('Cast guide');
fireEvent.change(castDraft, { target: { value: 'Example unsaved cast direction' } });
+ const approvals = { 'cast-sets': 'Art direction', board: 'Lyric-timed storyboard', produce: 'Animated proof' };
for (const stage of ['board', 'produce', 'cast-sets']) {
await openStage(stage);
const panel = screen.getByRole('tabpanel');
- expect(within(panel).getByRole('heading', { level: 3, name: selectedTab().textContent })).toBeInTheDocument();
- const run = screen.getByRole('region', { name: 'Autonomous run' });
- expect(panel.contains(run)).toBe(false);
- expect(panel.compareDocumentPosition(run) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
- if (stage === 'board') expect(within(panel).getByText('Lyric-timed storyboard')).toBeInTheDocument();
- if (stage === 'produce') expect(screen.queryByRole('region', { name: 'Production review' })).toBeNull();
+ // The selected tab also reads its state (", Done") to screen readers; the panel is labelled by the step's heading.
+ const title = selectedTab().textContent.split(',')[0];
+ expect(within(panel).getByRole('heading', { level: 3, name: title })).toBeInTheDocument();
+ expect(panel).toHaveAccessibleName(title);
+ // The step's own work comes first; the one approval that closes it sits at the bottom.
+ const stageReview = within(panel).getByRole('region', { name: 'Production review' });
+ expect(panel.lastElementChild).toBe(stageReview);
+ expect(within(stageReview).getAllByRole('region', { name: /^Approve: / })).toHaveLength(1);
+ expect(within(stageReview).getByRole('region', { name: `Approve: ${approvals[stage]}` })).toBeInTheDocument();
+ // The run is no longer a shared panel under every step.
+ expect(screen.queryByRole('region', { name: 'Autonomous run' })).toBeNull();
}
expect(screen.getByLabelText('Cast guide')).toHaveValue('Example unsaved cast direction');
+
+ // The run lives in Project settings › Autopilot, opened from the header.
+ fireEvent.click(screen.getByRole('button', { name: /^Autonomous run/ }));
+ const drawer = await screen.findByRole('dialog', { name: 'Project settings' });
+ expect(within(drawer).getByRole('region', { name: 'Autonomous run' })).toBeInTheDocument();
+ closeSettings();
+ expect(screen.getByLabelText('Cast guide')).toHaveValue('Example unsaved cast direction');
});
it('uses the newly selected project making-of notes and links when drafting publication copy', async () => {
@@ -2525,12 +2593,12 @@ describe('MusicVideo stage tabs (#9243)', () => {
listMusicVideoProjects.mockResolvedValue([PROJECT_WITH_CLIP]);
renderAt('/music-video/mv-1/produce');
await screen.findByRole('heading', { level: 2, name: PROJECT_WITH_CLIP.name });
- expect(selectedTab()).toHaveTextContent(/^Produce/);
- expect(screen.getByRole('button', { name: 'Set up automation brief' })).toBeTruthy();
+ expect(selectedTab()).toHaveTextContent(/^Make/);
+ expect(screen.getByRole('region', { name: 'Composition' })).toBeTruthy();
fireEvent.click(screen.getByRole('tab', { name: STAGE_TABS.board }));
await waitFor(() => expect(screen.getByTestId('loc').textContent).toBe('/music-video/mv-1/board'));
- expect(selectedTab()).toHaveTextContent(/^Board/);
+ expect(selectedTab()).toHaveTextContent(/^Storyboard/);
expect(screen.getByRole('button', { name: /Add scene/ })).toBeTruthy();
});
@@ -2539,50 +2607,78 @@ describe('MusicVideo stage tabs (#9243)', () => {
listMusicVideoProjects.mockResolvedValue([PROJECT_WITH_CLIP]);
renderAt('/music-video/mv-1/not-a-stage');
await screen.findByRole('heading', { level: 2, name: PROJECT_WITH_CLIP.name });
- expect(selectedTab()).toHaveTextContent(/^Setup/);
+ expect(selectedTab()).toHaveTextContent(/^Song/);
});
it('keeps the open tab when a stage completes, while the header moves on to the next action', async () => {
const analyzed = { ...PROJECT_NO_CLIP, audioAnalysis: PROJECT_ANALYZED.audioAnalysis };
analyzeMusicVideoProject.mockResolvedValue(analyzed);
await openProject(PROJECT_NO_CLIP);
- expect(selectedTab()).toHaveTextContent(/^Setup/);
+ expect(selectedTab()).toHaveTextContent(/^Song/);
fireEvent.click(screen.getByRole('button', { name: 'Analyze song' }));
await waitFor(() => expect(analyzeMusicVideoProject).toHaveBeenCalledWith('mv-2', { silent: true }));
- // Analysis is done and the shot has no frame or clip: the header now points at production…
- expect(await screen.findByRole('button', { name: 'Set up production' })).toBeTruthy();
+ // Analysis is done and the shot has no frame or clip: the header now points at making the footage…
+ expect(await screen.findByRole('button', { name: 'Make the footage' })).toBeTruthy();
// …but the tab the director is working in is not pulled out from under them.
- expect(selectedTab()).toHaveTextContent(/^Setup/);
+ expect(selectedTab()).toHaveTextContent(/^Song/);
});
- it('every control has exactly one home tab', async () => {
+ it('every control has exactly one home step or Project settings tab', async () => {
const project = { ...PROJECT_WITH_CLIP, castAndSets: { status: 'review', revision: 1, plan: {}, images: {} }, audioAnalysis: PROJECT_ANALYZED.audioAnalysis };
- const landmarks = {
+ // Each finder searches `root` (the page, or the open settings drawer).
+ const steps = {
setup: {
- 'Change track': () => screen.queryByLabelText('Change track'), 'Concept': () => screen.queryByLabelText('Concept'), MIDI: () => screen.queryByRole('button', { name: /^MIDI$/ }),
- // Project options: the render style and the image/video services are set once, here.
- 'Render style': () => document.getElementById('mv-toolbar-render-style'), 'Scene video renderer': () => screen.queryByLabelText('Scene video renderer'),
- 'Media': () => screen.queryByLabelText('Design and composition media'),
+ 'Change track': (root) => root.queryByLabelText('Change track'),
+ 'Song content': (root) => root.queryByRole('radio', { name: 'Vocal song' }),
+ },
+ 'cast-sets': {
+ 'Cast & Sets check-in': (root) => root.queryByLabelText('Cast & Sets check-in'),
+ // Creative direction is what the cast and sets are built from.
+ Concept: (root) => root.queryByLabelText('Concept'),
+ },
+ board: { 'AI Plan': (root) => root.queryByRole('button', { name: /AI Plan/ }), 'Add scene': (root) => root.queryByRole('button', { name: /Add scene/ }), 'Shot prompt': (root) => root.queryByLabelText('Shot prompt') },
+ // Make: the footage, then the composition over it.
+ produce: { Footage: () => document.getElementById('mv-generation'), Typography: (root) => root.queryByText(/^Typography —/) },
+ review: { 'Render final': (root) => root.queryByRole('button', { name: /^Render final$/ }), 'Render excerpt': (root) => root.queryByRole('button', { name: /Render excerpt/ }) },
+ };
+ const settings = {
+ // The render style and the image/video services are set once, here.
+ Project: {
+ 'Render style': () => document.getElementById('mv-toolbar-render-style'), 'Scene video renderer': (root) => root.queryByLabelText('Scene video renderer'),
+ Media: (root) => root.queryByLabelText('Design and composition media'),
},
- 'cast-sets': { 'Cast & Sets check-in': () => screen.queryByLabelText('Cast & Sets check-in') },
- board: { 'AI Plan': () => screen.queryByRole('button', { name: /AI Plan/ }), 'Add scene': () => screen.queryByRole('button', { name: /Add scene/ }), 'Shot prompt': () => screen.queryByLabelText('Shot prompt') },
- produce: { 'Automation brief': () => screen.queryByLabelText('Automation brief'), 'Start production': () => screen.queryByRole('button', { name: /Start production/ }) },
- compose: { Typography: () => screen.queryByText(/^Typography —/) },
- review: { 'Render final': () => screen.queryByRole('button', { name: /^Render final$/ }), 'Render excerpt': () => screen.queryByRole('button', { name: /Render excerpt/ }) },
+ Audio: { MIDI: (root) => root.queryByRole('button', { name: /^MIDI$/ }) },
+ Autopilot: { 'Automation brief': (root) => root.queryByLabelText('Automation brief'), 'Start production': (root) => root.queryByRole('button', { name: /Start production/ }) },
+ Files: { 'Export bundle': (root) => root.queryByRole('button', { name: /^Export bundle$/ }) },
};
- // Importing a file is deliberately offered on two tabs: a guide is imported where it is chosen (Cast & Sets),
- // and any other development file on Review.
- const importFile = () => screen.queryByLabelText('Import development file');
+ // Importing a file is deliberately offered twice: a guide is imported where it is chosen (Look),
+ // and any other development file in Project settings › Files.
+ const importFile = (root) => root.queryByLabelText('Import development file');
await openProject(project);
- for (const [stage, own] of Object.entries(landmarks)) {
+ for (const [stage, own] of Object.entries(steps)) {
await openStage(stage);
- for (const [name, find] of Object.entries(own)) expect(find(), `${name} on ${stage}`).toBeTruthy();
- for (const [other, theirs] of Object.entries(landmarks)) {
+ for (const [name, find] of Object.entries(own)) expect(find(screen), `${name} on ${stage}`).toBeTruthy();
+ for (const [other, theirs] of [...Object.entries(steps), ...Object.entries(settings)]) {
if (other === stage) continue;
- for (const [name, find] of Object.entries(theirs)) expect(find(), `${name} must not be on ${stage}`).toBeFalsy();
+ for (const [name, find] of Object.entries(theirs)) expect(find(screen), `${name} must not be on ${stage}`).toBeFalsy();
+ }
+ expect(!!importFile(screen), `Import development file on ${stage}`).toBe(stage === 'cast-sets');
+ }
+ // The drawer opens over the last step; only the open settings tab's controls are in it.
+ for (const [tab, own] of Object.entries(settings)) {
+ await openSettings(tab);
+ const drawer = within(screen.getByRole('dialog', { name: 'Project settings' }));
+ for (const [name, find] of Object.entries(own)) expect(find(drawer), `${name} in ${tab} settings`).toBeTruthy();
+ for (const [other, theirs] of [...Object.entries(steps), ...Object.entries(settings)]) {
+ if (other === tab) continue;
+ for (const [name, find] of Object.entries(theirs)) {
+ const found = find(drawer);
+ expect(!!found && screen.getByRole('dialog', { name: 'Project settings' }).contains(found), `${name} must not be in ${tab} settings`).toBe(false);
+ }
}
- expect(!!importFile(), `Import development file on ${stage}`).toBe(stage === 'cast-sets' || stage === 'review');
+ expect(!!importFile(drawer), `Import development file in ${tab} settings`).toBe(tab === 'Files');
+ closeSettings();
}
});
@@ -2699,9 +2795,20 @@ describe('MusicVideo stage tabs (#9243)', () => {
expect(screen.queryByLabelText('Final render preview')).toBeNull();
});
- it('offers no preview when the project has neither a document nor a finished excerpt', async () => {
+ it('keeps the dock with an empty state when there is nothing to play yet', async () => {
+ await openProject({ ...PROJECT_WITH_CLIP, trackId: null, uploadedAudioFilename: null }, 'board');
+ const dock = screen.getByRole('complementary', { name: 'Preview' });
+ expect(dock).toHaveTextContent('Nothing to play yet');
+ expect(within(dock).queryByLabelText('Preview source')).toBeNull();
+ expect(within(dock).queryByTitle('Composition document preview')).toBeNull();
+ expect(within(dock).queryByLabelText('Draft excerpt preview')).toBeNull();
+ });
+
+ it('plays the storyboard animatic when the project has a track and shots but no document or finished excerpt', async () => {
await openProject(PROJECT_WITH_CLIP, 'board');
- expect(screen.queryByLabelText('Preview')).toBeNull();
+ const dock = screen.getByRole('complementary', { name: 'Preview' });
+ expect(dock).toHaveTextContent('Storyboard animatic');
+ expect(dock).not.toHaveTextContent('Nothing to play yet');
});
});
});
@@ -2791,14 +2898,14 @@ describe('MusicVideo main page project cards', () => {
expect(await screen.findByRole('heading', { level: 2, name: PROJECT_WITH_CLIP.name })).toBeInTheDocument();
});
- it('opens an existing final directly in Review from the project card', async () => {
+ it('opens an existing final directly in Final render from the project card', async () => {
const project = { ...PROJECT_WITH_CLIP, renderHistoryId: 'example-final' };
listMusicVideoProjects.mockResolvedValue([project]);
render(<MemoryRouter initialEntries={['/music-video']}><LocationProbe />{MV_ROUTES}</MemoryRouter>);
const card = await screen.findByTestId(`mv-project-card-${project.id}`);
await act(async () => fireEvent.click(within(card).getByRole('button', { name: 'Review video' })));
expect(screen.getByTestId('loc')).toHaveTextContent(`/music-video/${project.id}/review`);
- expect(screen.getByRole('tab', { name: /^Review/ })).toHaveAttribute('aria-selected', 'true');
+ expect(screen.getByRole('tab', { name: /^Final render/ })).toHaveAttribute('aria-selected', 'true');
});
it('handles forking a project directly from its card', async () => {
@@ -2867,10 +2974,13 @@ describe('direct production review navigation', () => {
const action = await screen.findByRole('button', { name: 'Review art direction' });
expect(screen.getByLabelText('Project')).toHaveTextContent('2 document shots');
fireEvent.click(action);
- // The art approval now mounts on the Cast & Sets tab, so it only exists once the jump lands.
+ // The art approval mounts at the bottom of the Look step, so it only exists once the jump lands.
await waitFor(() => expect(document.getElementById('mv-review-art')).toHaveFocus());
const art = document.getElementById('mv-review-art');
- expect(art.closest('details').open).toBe(true);
+ // On its step the approval is an always-open box, never folded away.
+ expect(art).toHaveAccessibleName('Approve: Art direction');
+ expect(art.closest('details')).toBeNull();
+ expect(art).toContainElement(screen.getByRole('button', { name: 'Approve art direction' }));
expect(screen.getByTestId('loc')).toHaveTextContent('/cast-sets#mv-review-art');
fireEvent.click(screen.getByRole('button', { name: 'Review art direction' }));
expect(art).toHaveFocus();
@@ -2884,7 +2994,7 @@ describe('direct production review navigation', () => {
});
});
-describe('stage checklist and Setup project options', () => {
+describe('stage checklist and project options', () => {
it('keeps Cast & Sets on the art approval after the unwanted sheet is gone, and says an approved sheet file is not that approval', async () => {
// The guide pick itself is covered by stageChecklist's unit test; selecting
// one here would make the open approvals panel fetch the sheet's file.
@@ -2902,14 +3012,17 @@ describe('stage checklist and Setup project options', () => {
expect(checklist).toHaveTextContent('Approving a sheet file does not approve the art direction');
});
- it('shows the project options in Setup and saves a media mode and an autopilot tool change', async () => {
+ it('shows the project options in Project settings and saves a media mode and an autopilot tool change', async () => {
const project = { ...PROJECT_ANALYZED, mediaMode: 'code-images-video',
automation: { tools: ['image:local'], guidance: 'g', budgetUsd: 5, checkins: { castAndSets: 'review' } } };
updateMusicVideoProject.mockImplementation((_id, patch) => Promise.resolve({ ...project, ...patch }));
await openProject(project, 'setup');
- const options = document.getElementById('mv-setup-options');
- expect(options.open).toBe(true);
- expect(options.querySelector('summary')).toHaveTextContent('Autopilot · Code + images + video · Footage');
+ // The Song step holds only the song; the project options are one header button away.
+ expect(screen.queryByLabelText('Design and composition media')).toBeNull();
+ fireEvent.click(screen.getByRole('button', { name: 'Project settings' }));
+ const drawer = await screen.findByRole('dialog', { name: 'Project settings' });
+ expect(within(drawer).getByRole('tab', { name: /^Project/ })).toHaveAttribute('aria-selected', 'true');
+ expect(within(drawer).getByLabelText('Design and composition media')).toHaveValue('code-images-video');
fireEvent.change(screen.getByLabelText('Design and composition media'), { target: { value: 'code-only' } });
await waitFor(() => expect(updateMusicVideoProject).toHaveBeenCalledWith(project.id, { mediaMode: 'code-only' }, { silent: true }));
fireEvent.click(screen.getByLabelText('Local video gen'));
@@ -2920,7 +3033,7 @@ describe('stage checklist and Setup project options', () => {
});
describe('Autopilot collapsed review summary', () => {
- it('shows the current blocker in the summary while retaining the historical error in run details', async () => {
+ it('shows the current blocker on the run while retaining the historical error in run details', async () => {
const error = 'Review and approve the current art direction first.';
const project = { ...PROJECT_ANALYZED, autonomousRun: { id: 'history-run', status: 'needs-human', stage: 'produce',
error, errorCode: 'MUSIC_VIDEO_APPROVAL_REQUIRED', brief: { autoApprove: [] }, stages: {}, output: {} },
@@ -2928,11 +3041,15 @@ describe('Autopilot collapsed review summary', () => {
proof: { approved: false, problems: ['Render and watch a current animated chorus proof with the master song.'] } } };
listMusicVideoProjects.mockResolvedValue([project]);
render(<MemoryRouter initialEntries={['/music-video/mv-3/review']}>{MV_ROUTES}</MemoryRouter>);
- await screen.findByText(`Historical stop reason: ${error}`);
- const summary = screen.getByText('Autonomous run').closest('summary');
- fireEvent.click(summary);
- expect(summary).toHaveTextContent('Render and watch a current animated chorus proof');
- expect(summary.textContent).not.toContain(error);
+ // Collapsed, the run is the header's Autopilot button: it never repeats the stale error.
+ const autopilot = await screen.findByRole('button', { name: /^(Autopilot|Autonomous run)/ });
+ expect(autopilot.textContent).not.toContain(error);
+ fireEvent.click(autopilot);
+ const drawer = await screen.findByRole('dialog', { name: 'Project settings' });
+ const run = within(drawer).getByRole('region', { name: 'Autonomous run' });
+ expect(within(run).getByText(`Historical stop reason: ${error}`)).toBeInTheDocument();
+ const current = within(run).getByText(/Render and watch a current animated chorus proof/);
+ expect(current.textContent).not.toContain(error);
});
});
@@ -3015,6 +3132,8 @@ describe('MusicVideo deep-linking and drawer URL routing (#10168)', () => {
listMusicVideoProjects.mockResolvedValue([{ ...PROJECT_WITH_CLIP, scenes: [first, { ...first, sceneId: 's2', order: 1 }] }]);
render(<MemoryRouter initialEntries={[`/music-video/${PROJECT_WITH_CLIP.id}/board/scene/s1`]}><LocationProbe />{MV_ROUTES}</MemoryRouter>);
await screen.findByRole('heading', { level: 2, name: PROJECT_WITH_CLIP.name });
+ // The heading can land a commit before the inspector; wait for the scene the keys act on.
+ await waitFor(() => expect(document.querySelector('#scene-s1 summary')).not.toBeNull());
document.querySelector('#scene-s1 summary').focus();
await act(async () => fireEvent.keyDown(document.activeElement, { key: 'j' }));
expect(screen.getByTestId('loc')).toHaveTextContent(`/music-video/${PROJECT_WITH_CLIP.id}/board/scene/s2`);
diff --git a/docs/features/music-video-autonomous.md b/docs/features/music-video-autonomous.md
index c79fd9c5d3..04181c0343 100644
--- a/docs/features/music-video-autonomous.md
+++ b/docs/features/music-video-autonomous.md
@@ -58,7 +58,7 @@ A pin whose provider no longer exists gives way to the next one, and the route n
**Lyric review.** Set `lyricsReview: true` (or pin `llmStages.lyricsReview`, which turns it on by itself) and the `lyrics` stage runs two steps — `draft` then `review`, shown as `stages.lyrics.step` — on the stage list's single `lyrics` entry. The review keeps the title, the section tags and roughly the same length, improves scansion, punch and argument, and adds no new topics. The run keeps the first draft (`output.lyricsDraft`), the revision (`output.lyrics`, what the `lyrics` checkpoint shows and Suno receives) and the reviewer's short critique (`output.lyricsReviewNotes`). The draft is stored before the review runs, so a failed review retries only the review.
-The start drawer and the scheduled task's settings show a collapsible **Models per stage** section with the lyric-review toggle; each stage offers *Default (use direction LLM)*. On an automation-first project, the autopilot brief (Produce tab → Edit brief, and the create drawer) offers the same section for the stages a saved project runs — Cast & Sets direction, shot plan and code authoring — next to the direction LLM picker; a patch merges per stage, and a stage set back to Default is sent as `null` to clear its pin.
+The start drawer and the scheduled task's settings show a collapsible **Models per stage** section with the lyric-review toggle; each stage offers *Default (use direction LLM)*. On an automation-first project, the autopilot brief (Project settings › Autopilot → Edit brief, and the create drawer) offers the same section for the stages a saved project runs — Cast & Sets direction, shot plan and code authoring — next to the direction LLM picker; a patch merges per stage, and a stage set back to Default is sent as `null` to clear its pin.
## Suno form options
diff --git a/docs/features/product-surfaces.md b/docs/features/product-surfaces.md
index 6c72ff9926..3caa4c1f7b 100644
--- a/docs/features/product-surfaces.md
+++ b/docs/features/product-surfaces.md
@@ -110,7 +110,7 @@ An end-to-end creative production suite for authors, worldbuilders, filmmakers,
| **SongBook** | `/songbook` | Interactive chord charts, guitar tablature, lyric repertoire, and auto-scrolling practice sheet music. | — |
| **Creative Director** | `/creative-director` | Multi-scene episodic video production orchestrator: turn briefs into treatments, storyboards, render plans, and completed episodes. | — |
| **Creative Commissions** | `/creative-commission` | Standing briefs and scheduled/nightly autonomous media generation aligning with personal taste profiles and feedback. A universe and/or mood board can be picked as the style source: each run loads its style tags and reference images as the Creative Director's art-direction base, attaches those images to vision scene evaluation, and conditions local image renders on them. | — |
-| **Music Video Studio** | `/music-video` | A project opens on seven deep-linked stage tabs (`/music-video/:projectId/:stage` — `setup`, `cast-sets`, `board`, `produce`, `compose`, `review`, `publish`; a bottom tab bar on a phone) under a sticky header showing its progress, a one-line status (the stage it is in and whether it needs the director, the autopilot and production runs, the three production approvals, and what has been rendered), paid-generation spend against the cap, and the one next action for the stage it is in; a **Needs attention** banner under that status line lists any state a half-finished workflow left on the server — an open revision, an interrupted Cast & Sets stage, an auto-review waiting for its revised sections, a final render nobody is watching — with its Resume / Continue / Cancel / Reattach inline, derived from the saved record so it survives a reload; a preview player is docked beside every tab whenever anything is playable — the final render, the live composition document and each finished draft excerpt, picked from the dock (`?play=`) — and scene cards seek it. The autopilot run and production approvals fold to a summary line below the stage unless they need the director. Audio-reactive video creation, beat-detection synchronization, scene choreography, tempo alignment, and audience-driven pre-production treatments that direct each shot. Scenes are cutaways or lip-synced performance shots; a performance shot renders only on a verified source-audio provider (fal.ai MiniMax H3 lip-sync, 5–14.8s song slices placed at an exact edit in-point, cut from an optional full-length vocal stem when one is attached — uploaded, or separated from the song with a locally installed demucs) — Grok video is cutaway-only. The autopilot kickoff analyzes the song, imports the linked track's lyric sheet (its `[Verse]`/`[Chorus]` headers and stage directions kept as lyric markers that name the analysis sections and steer shot framing), separates the vocal, aligns every word with local whisper.cpp (large-v3-turbo, downloaded on first use), builds a Cast & Sets check-in (one creative-direction call that interprets the song, then a canonical character sheet, expression and looks sheets, one empty plate per set and in-set tests on the image queue, each later image conditioned on the character sheet; assembled into a self-contained sheet saved as a development artifact), stops for the director's review unless the brief auto-approves it, then plans against the approved references. Development artifacts (check-in sheets, animatics, treatments, storyboards; HTML/Markdown/MP4/PNG/JPG) are versioned per project, reviewed with notes and approve/request-changes, and viewed in a sandboxed viewer at `/music-video/:projectId/:stage/dev/:artifactId` (the stage-less `/music-video/:projectId/dev/:artifactId` still opens it). Draft excerpts are reviewed and selectively revised by hand, or by an opt-in auto-review run bounded by director-set review and paid-generation limits (a frame-only look never passes motion or audio sync). A run started from the board generates its revised sections on the server too (#10014), routed from the project's saved image and video pins, so it completes with no tab open; a section that cannot be generated unattended (a synchronous image backend, a clip lane only the board can submit) parks the run as needing the director, with the reason named. A server-owned production run (`/api/music-video/:id/production-runs`, #9066) plans an empty board, generates missing frames and clips only on a director-allowed image/video provider+model pool, hands the continuous draft to auto-review and dispatches its revisions — within explicit generation, review and (priced routes only) dollar limits, without the browser open, and never resuming on its own after a restart; the song is the sole audio unless a sound-design bed is explicitly chosen to mix under it. A footage or composed render can intercut (#9290): shots are re-cut on the song's section energy (every 2 beats in the loudest quarter, up to every 8 in the quietest) and on sung word onsets, alternating the host shot — a lip-synced take stays in sync — with unshown footage from a cutaway in the same section, so the edit gets faster without generating more clips; an autopilot production run defaults to it unless the director chose one cut per shot. Lyric lines sung two or more times are hooks: the treatment's text cues give them a word-by-word build (#9291) — each word lands on its sung onset in heavy caps, the newest in the accent color. Draft excerpts can be re-framed as vertical or square social cuts with faded audio edges, from suggested hook windows (#9280). The **Autonomous** entry point (`docs/features/music-video-autonomous.md`) starts from one prompt instead of a chosen track: it writes the brief, lyrics and a mood board, makes the song in Suno through the PortOS Browser, and runs the production — with optional approval checkpoints, and a `music-video-autopilot` scheduled task that turns unused Brain ideas into videos. The Publish stage (#9281) builds a release kit from the final render: an X-sized 1080p, a 720p preview, a hook teaser, thumbnail candidates, lyric captions (SRT) and YouTube chapters. It also drafts every platform's copy in one director-triggered provider call from their own making-of notes, and every field stays editable. Posting (#9282) fills each platform's post (YouTube, Suno, an X thread, Shorts, TikTok, Instagram Reels, Reddit, Stacker News) in a new PortOS Browser tab with the director's signed-in sessions, shows a screenshot and summary of the filled draft, and posts only when the director presses Post for that draft; the posted links are kept on the project. Reddit defaults to a native video post in r/aivideo — title and flair, no body — through the new composer's own Video button (#9307). Platforms are opt-in (#9287): a "Where you post" list turns each one on (all start off) and optionally names the account posted as — X and Reddit drafts filled while signed in as someone else are refused. Copy is drafted and posts are offered only for enabled platforms. Each post (including one recorded by hand) can be rated good, mixed or poor with notes; ratings roll up per platform across projects and are passed to later copy drafts. | — |
+| **Music Video Studio** | `/music-video` | A project is six deep-linked steps (`/music-video/:projectId/:stage` — Song `setup`, Look `cast-sets`, Storyboard `board`, Make `produce`, Final render `review`, Publish `publish`; an old `compose` link opens Make), listed down the left with a state word and one fact each (a bottom icon bar on a phone). Each step opens with what "done" means and an always-visible checklist, and ends with its own approval (art on Look, the timed storyboard on Storyboard, the animated proof on Make). A sticky header gives one status line ("Step 3 of 6: Storyboard needs you"), the one next action, an Autopilot button, paid-generation spend against the cap and **Project settings** — a drawer holding the render style and services, advanced audio tools, the autopilot brief and runs, and every development file, the external handoff and the making-of export; a **Needs attention** banner under that status line lists any state a half-finished workflow left on the server — an open revision, an interrupted Cast & Sets stage, an auto-review waiting for its revised sections, a final render nobody is watching — with its Resume / Continue / Cancel / Reattach inline, derived from the saved record so it survives a reload; a preview player is docked beside every step — the final render, the live composition document, each finished draft excerpt and, before anything is rendered, a storyboard animatic (the song under each shot's frame or card), picked from the dock (`?play=`) — and scene cards seek it. Audio-reactive video creation, beat-detection synchronization, scene choreography, tempo alignment, and audience-driven pre-production treatments that direct each shot. Scenes are cutaways or lip-synced performance shots; a performance shot renders only on a verified source-audio provider (fal.ai MiniMax H3 lip-sync, 5–14.8s song slices placed at an exact edit in-point, cut from an optional full-length vocal stem when one is attached — uploaded, or separated from the song with a locally installed demucs) — Grok video is cutaway-only. The autopilot kickoff analyzes the song, imports the linked track's lyric sheet (its `[Verse]`/`[Chorus]` headers and stage directions kept as lyric markers that name the analysis sections and steer shot framing), separates the vocal, aligns every word with local whisper.cpp (large-v3-turbo, downloaded on first use), builds a Cast & Sets check-in (one creative-direction call that interprets the song, then a canonical character sheet, expression and looks sheets, one empty plate per set and in-set tests on the image queue, each later image conditioned on the character sheet; assembled into a self-contained sheet saved as a development artifact), stops for the director's review unless the brief auto-approves it, then plans against the approved references. Development artifacts (check-in sheets, animatics, treatments, storyboards; HTML/Markdown/MP4/PNG/JPG) are versioned per project, reviewed with notes and approve/request-changes, and viewed in a sandboxed viewer at `/music-video/:projectId/:stage/dev/:artifactId` (the stage-less `/music-video/:projectId/dev/:artifactId` still opens it). Draft excerpts are reviewed and selectively revised by hand, or by an opt-in auto-review run bounded by director-set review and paid-generation limits (a frame-only look never passes motion or audio sync). A run started from the board generates its revised sections on the server too (#10014), routed from the project's saved image and video pins, so it completes with no tab open; a section that cannot be generated unattended (a synchronous image backend, a clip lane only the board can submit) parks the run as needing the director, with the reason named. A server-owned production run (`/api/music-video/:id/production-runs`, #9066) plans an empty board, generates missing frames and clips only on a director-allowed image/video provider+model pool, hands the continuous draft to auto-review and dispatches its revisions — within explicit generation, review and (priced routes only) dollar limits, without the browser open, and never resuming on its own after a restart; the song is the sole audio unless a sound-design bed is explicitly chosen to mix under it. A footage or composed render can intercut (#9290): shots are re-cut on the song's section energy (every 2 beats in the loudest quarter, up to every 8 in the quietest) and on sung word onsets, alternating the host shot — a lip-synced take stays in sync — with unshown footage from a cutaway in the same section, so the edit gets faster without generating more clips; an autopilot production run defaults to it unless the director chose one cut per shot. Lyric lines sung two or more times are hooks: the treatment's text cues give them a word-by-word build (#9291) — each word lands on its sung onset in heavy caps, the newest in the accent color. Draft excerpts can be re-framed as vertical or square social cuts with faded audio edges, from suggested hook windows (#9280). The **Autonomous** entry point (`docs/features/music-video-autonomous.md`) starts from one prompt instead of a chosen track: it writes the brief, lyrics and a mood board, makes the song in Suno through the PortOS Browser, and runs the production — with optional approval checkpoints, and a `music-video-autopilot` scheduled task that turns unused Brain ideas into videos. The Publish stage (#9281) builds a release kit from the final render: an X-sized 1080p, a 720p preview, a hook teaser, thumbnail candidates, lyric captions (SRT) and YouTube chapters. It also drafts every platform's copy in one director-triggered provider call from their own making-of notes, and every field stays editable. Posting (#9282) fills each platform's post (YouTube, Suno, an X thread, Shorts, TikTok, Instagram Reels, Reddit, Stacker News) in a new PortOS Browser tab with the director's signed-in sessions, shows a screenshot and summary of the filled draft, and posts only when the director presses Post for that draft; the posted links are kept on the project. Reddit defaults to a native video post in r/aivideo — title and flair, no body — through the new composer's own Video button (#9307). Platforms are opt-in (#9287): a "Where you post" list turns each one on (all start off) and optionally names the account posted as — X and Reddit drafts filled while signed in as someone else are refused. Copy is drafted and posts are offered only for enabled platforms. Each post (including one recorded by hand) can be rated good, mixed or poor with notes; ratings roll up per platform across projects and are passed to later copy drafts. | — |
| **Sharing & Conflict Resolution** | `/sharing`, `/sharing/duplicates`, `/sharing/conflicts` | Collaborative asset exchange via cloud storage buckets (Google Drive, Dropbox, iCloud, Syncthing) with duplicate reconciliation and conflict recovery journals. | — |
---
diff --git a/server/lib/musicVideoSummary.js b/server/lib/musicVideoSummary.js
index ddd1c8e9e2..f0db4b868d 100644
--- a/server/lib/musicVideoSummary.js
+++ b/server/lib/musicVideoSummary.js
@@ -10,7 +10,8 @@
import { isLayeredComposition, sceneRenderReady } from './musicVideoLayers.js';
import { latestMusicVideoReviewDraft } from './musicVideoReviewDraft.js';
-const STAGE_IDS = ['setup', 'cast-sets', 'board', 'produce', 'compose', 'review', 'publish'];
+// The six steps (Song, Look, Storyboard, Make, Final render, Publish); Make (`produce`) absorbed Compose.
+const STAGE_IDS = ['setup', 'cast-sets', 'board', 'produce', 'review', 'publish'];
const RESUMABLE_RUN_STATUSES = new Set(['running', 'stopped', 'limit-reached', 'blocked', 'needs-replan']);
const FOOTAGE_OPTIONAL_MODES = new Set(['code', 'document', 'eidoverse']);
@@ -49,7 +50,18 @@ function composeDone(project, mode) {
return true;
}
-// The first stage not yet done; a live production run pins Produce.
+// Song is done once its lyrics are in and their timing verified, or the song
+// is an explicit instrumental — mirrors the client's lyricSetupState.
+function lyricsReady(project, readiness) {
+ const draft = project.productionReview?.draft || {};
+ const instrumental = draft.lyricsMode === 'instrumental';
+ const lines = (project.lyricCues || []).filter((cue) => nonEmptyString(cue?.text)).length;
+ const alignment = readiness?.alignment?.status || (instrumental ? 'instrumental' : draft.timingStatus === 'verified' ? 'verified' : 'provisional');
+ const verified = alignment === 'verified' || alignment === 'instrumental';
+ return Boolean(readiness?.storyboard?.approved) || ((instrumental || lines > 0) && verified);
+}
+
+// The first step not yet done; a live production run pins Make.
function currentStage(project, readiness, run) {
if (run && RESUMABLE_RUN_STATUSES.has(run.status)) return 'produce';
const scenes = project.scenes || [];
@@ -59,13 +71,13 @@ function currentStage(project, readiness, run) {
const proofApproved = Boolean(readiness?.proof?.approved);
const footageReady = FOOTAGE_OPTIONAL_MODES.has(mode) || scenes.every((scene) => sceneRenderReady(scene, { layered }));
const done = {
- setup: Boolean(project.trackId || project.uploadedAudioFilename) && Boolean(project.audioAnalysis),
+ setup: Boolean(project.trackId || project.uploadedAudioFilename) && Boolean(project.audioAnalysis) && lyricsReady(project, readiness),
'cast-sets': Boolean(readiness?.art?.approved),
board: planned,
- // The proof closes Compose, not Produce (#10140) — mirrors the client's deriveStages.
- produce: planned && footageReady,
- compose: composeDone(project, mode) && proofApproved,
- review: Boolean(project.renderHistoryId),
+ // Make needs footage, the composition over it and the proof that closes both (#10140) — mirrors the client's deriveStages.
+ produce: planned && footageReady && composeDone(project, mode) && proofApproved,
+ // A render made before later scene edits no longer counts as the final video — mirrors the client's isFinalRenderStale.
+ review: Boolean(project.renderHistoryId) && project.renderDependencyState?.status !== 'stale',
publish: Object.keys(project.publishKit?.posts || {}).length > 0,
};
return STAGE_IDS.find((id) => !done[id]) || 'publish';
diff --git a/server/lib/navManifest.js b/server/lib/navManifest.js
index 1fe074bbc6..b9206487ef 100644
--- a/server/lib/navManifest.js
+++ b/server/lib/navManifest.js
@@ -62,12 +62,11 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.create.game', path: '/game', label: 'Game', section: 'Create', aliases: ['game', 'games', 'game-studio'], keywords: ['managed app', 'sprite', 'atlas', 'music', 'asset bundle', 'manifest', 'feedback'] },
{ id: 'nav.create.music-video', path: '/music-video', label: 'Music Video', section: 'Create', previousPaths: ['/media/music-video', '/media/music-video/:projectId'], aliases: ['music-video', 'musicvideo', 'music video', 'mv', 'sync-to-beat'], keywords: ['music', 'beat', 'sync', 'audio-reactive', 'director', 'scene board', 'tempo', 'choreography', 'autonomous', 'suno', 'one prompt', 'lyrics'] },
{ id: 'nav.create.music-video.new', path: '/music-video?new=project', label: 'New Music Video', section: 'Create', aliases: ['new-music-video', 'create-music-video', 'new music video', 'create music video'], keywords: ['music video', 'new', 'create', 'project', 'draft'] },
- { id: 'nav.create.music-video.setup', path: '/music-video/setup', label: 'Music Video Setup', section: 'Create', aliases: ['music-video-setup', 'mv-setup', 'music video setup'], keywords: ['music video', 'setup', 'track', 'audio'] },
- { id: 'nav.create.music-video.cast-sets', path: '/music-video/cast-sets', label: 'Music Video Cast & Sets', section: 'Create', aliases: ['cast-and-sets', 'cast-sets', 'cast and sets', 'music-video-cast-sets'], keywords: ['music video', 'cast', 'sets', 'characters', 'visual spec'] },
- { id: 'nav.create.music-video.board', path: '/music-video/board', label: 'Music Video Board', section: 'Create', aliases: ['board', 'open-the-board', 'open the board', 'music-video-board', 'scene-board'], keywords: ['music video', 'board', 'scenes', 'timeline', 'shots'] },
- { id: 'nav.create.music-video.produce', path: '/music-video/produce', label: 'Music Video Produce', section: 'Create', aliases: ['produce', 'music-video-produce', 'mv-produce'], keywords: ['music video', 'produce', 'render', 'takes', 'production'] },
- { id: 'nav.create.music-video.compose', path: '/music-video/compose', label: 'Music Video Compose', section: 'Create', aliases: ['compose', 'music-video-compose', 'mv-compose'], keywords: ['music video', 'compose', 'timeline', 'audio timing', 'lyrics'] },
- { id: 'nav.create.music-video.review', path: '/music-video/review', label: 'Music Video Review', section: 'Create', aliases: ['music-video-review', 'mv-review', 'music video review'], keywords: ['music video', 'review', 'export', 'proof'] },
+ { id: 'nav.create.music-video.setup', path: '/music-video/setup', label: 'Music Video Song', section: 'Create', aliases: ['music-video-setup', 'mv-setup', 'music video setup', 'music-video-song', 'mv-song'], keywords: ['music video', 'song', 'setup', 'track', 'audio', 'lyrics'] },
+ { id: 'nav.create.music-video.cast-sets', path: '/music-video/cast-sets', label: 'Music Video Look', section: 'Create', aliases: ['cast-and-sets', 'cast-sets', 'cast and sets', 'music-video-cast-sets', 'music-video-look', 'mv-look'], keywords: ['music video', 'look', 'cast', 'sets', 'characters', 'visual spec', 'art direction'] },
+ { id: 'nav.create.music-video.board', path: '/music-video/board', label: 'Music Video Storyboard', section: 'Create', aliases: ['board', 'open-the-board', 'open the board', 'music-video-board', 'scene-board', 'music-video-storyboard'], keywords: ['music video', 'storyboard', 'board', 'scenes', 'timeline', 'shots', 'treatment'] },
+ { id: 'nav.create.music-video.produce', path: '/music-video/produce', label: 'Music Video Make', section: 'Create', aliases: ['produce', 'music-video-produce', 'mv-produce', 'music-video-make', 'mv-make', 'compose', 'music-video-compose', 'mv-compose'], keywords: ['music video', 'make', 'produce', 'compose', 'footage', 'typography', 'proof', 'takes', 'production'] },
+ { id: 'nav.create.music-video.review', path: '/music-video/review', label: 'Music Video Final Render', section: 'Create', aliases: ['music-video-review', 'mv-review', 'music video review', 'music-video-render', 'mv-render'], keywords: ['music video', 'final render', 'render', 'review', 'export', 'drafts'] },
{ id: 'nav.create.music-video.publish', path: '/music-video/publish', label: 'Music Video Publish', section: 'Create', aliases: ['music-video-publish', 'mv-publish', 'music video publish'], keywords: ['music video', 'publish', 'release', 'kit', 'social'] },
{ id: 'nav.create.decks', path: '/decks', label: 'Decks', section: 'Create', aliases: ['decks', 'deck', 'card-deck', 'playing-cards', 'tarot', 'tarot-deck', 'cards'], keywords: ['playing cards', 'tarot', 'card deck', 'card design', 'suits', 'arcana', 'style guide', 'batch render', 'card art'] },
{ id: 'nav.create.mood-boards', path: '/mood-boards', label: 'Mood Boards', section: 'Create', aliases: ['mood-boards', 'mood-board', 'moodboard', 'mood', 'inspiration', 'references'], keywords: ['inspiration', 'reference', 'pin', 'visual', 'canvas', 'collect', 'pinboard', 'palette', 'ideas'] },