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: say what each stage needs, and put project options in Setup

Claude6d61927c02dd
diff --git a/client/src/components/musicVideo/ProjectActionGroups.jsx b/client/src/components/musicVideo/ProjectActionGroups.jsx
index 78f505686c..a43121eba4 100644
--- a/client/src/components/musicVideo/ProjectActionGroups.jsx
+++ b/client/src/components/musicVideo/ProjectActionGroups.jsx
@@ -1,17 +1,16 @@
import { Film, Music, Activity, Image as ImageIcon, Video, Wand2 } from 'lucide-react';
-import RecordRenderPinRow from '../imageGen/RecordRenderPinRow.jsx';
import { MUSCRIPTOR_MODELS } from '../../lib/muscriptorModels.js';
-import VideoRenderSettings from './VideoRenderSettings.jsx';
import { isLayeredComposition, sceneRenderReady, sceneVisualLayer } from '../../lib/musicVideoLayers.js';
import { compositionDraft, RENDER_STYLES } from './compositionDraft.js';
+import { projectServicesSummary } from '../../lib/musicVideoStages.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 and their render pins (Produce), the render style
- * (Compose) and the final render (Review). Each group takes the page's hook
- * slots (`midi`, `videoSettings`, `sceneMedia`, `renderJob`) and the
- * page-owned in-flight flags in `busy`.
+ * frame/clip generators (Produce) and the final render (Review). The render
+ * style select and the render pins are project options, edited in Setup. Each
+ * group takes the page's hook slots (`midi`, `videoSettings`, `sceneMedia`,
+ * `renderJob`) and the page-owned in-flight flags in `busy`.
*/
const buttonCls = 'flex items-center gap-1 bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm min-h-[44px] sm:min-h-0 disabled:opacity-50';
@@ -82,8 +81,11 @@ export function PlanActions({ project, busy, onPlan, onAutoArrange }) {
);
}
-/** The frame renderer pin, the scene-video renderer, and the batch generators. */
-export function GenerationActions({ project, videoSettings, sceneMedia }) {
+/**
+ * The batch generators, with the image and video services they render on (a
+ * project option, edited in Setup › Project options; `onEditServices` goes there).
+ */
+export function GenerationActions({ project, videoSettings, sceneMedia, onEditServices }) {
const scenes = project.scenes || [];
const sceneCount = scenes.length;
// #8985: in a composed render a still needs only its frame and a title card
@@ -105,14 +107,12 @@ export function GenerationActions({ project, videoSettings, sceneMedia }) {
const footageBlocked = codeMode ? 'This render style draws its own scene and does not generate footage' : '';
return (
<div className={groupCls}>
- <RecordRenderPinRow
- idPrefix="mv-frame-pin"
- label="Frames"
- imageMode={project.imageMode ?? null}
- imageModelId={project.imageModelId ?? null}
- onChange={videoSettings.changeFramePin}
- />
- <VideoRenderSettings videoSettings={videoSettings} generating={generatingVideos} />
+ <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>
+ )}
+ </span>
<button
onClick={sceneMedia.generateMissingFrames}
disabled={codeMode || videoSettings.framePinSaving || sceneCount === 0 || missingFrameCount === 0 || generatingFrames}
diff --git a/client/src/components/musicVideo/ProjectOptionsPanel.jsx b/client/src/components/musicVideo/ProjectOptionsPanel.jsx
new file mode 100644
index 0000000000..dc540422a3
--- /dev/null
+++ b/client/src/components/musicVideo/ProjectOptionsPanel.jsx
@@ -0,0 +1,136 @@
+import { useState } from 'react';
+import MediaModePicker from './MediaModePicker.jsx';
+import VideoRenderSettings from './VideoRenderSettings.jsx';
+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 } from './compositionDraft.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 { formatUsd } from '../../utils/formatters.js';
+
+const TOOL_GROUPS = [['image', 'Image'], ['video', 'Video'], ['code', 'Code']];
+const rowCls = 'grid min-w-0 grid-cols-1 gap-1 sm:grid-cols-[9rem_minmax(0,1fr)] sm:items-start sm:gap-3';
+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
+ * 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.
+ */
+export default function ProjectOptionsPanel({
+ project, videoSettings, generatingVideos = false, onMediaMode, onRenderStyle, onSaveAutomation,
+}) {
+ const [briefSaving, setBriefSaving] = useState(false);
+ const automation = project.automation || null;
+ const draft = automation ? automationDraftFrom(automation) : null;
+ const saveBrief = (patch) => {
+ if (!automation || briefSaving) return;
+ setBriefSaving(true);
+ Promise.resolve(onSaveAutomation(automationFromDraft({ ...draft, ...patch }, automation)))
+ .catch(() => {}) // the page's save already toasted
+ .finally(() => setBriefSaving(false));
+ };
+ const picked = new Set(draft?.tools || []);
+ const toggleTool = (id) => saveBrief({ tools: MUSIC_VIDEO_AUTOMATION_TOOLS.map((t) => t.id).filter((t) => (t === id ? !picked.has(t) : picked.has(t))) });
+
+ return (
+ <div className="min-w-0 space-y-3">
+ <div className={rowCls}>
+ <span className={headCls}>Workflow</span>
+ <div className="flex min-w-0 flex-wrap items-center gap-2 text-xs text-port-text-muted">
+ <Pill size="xs" tone={automation ? 'accent' : 'muted'}>{automation ? 'Autopilot' : 'Director (hands-on)'}</Pill>
+ <span>{automation
+ ? 'The autopilot plans and produces from its brief. Guidance, models and limits are under Produce.'
+ : 'You build the board by hand. Saving an autopilot brief under Produce hands it to the autopilot.'}</span>
+ </div>
+ </div>
+ <div className={rowCls}>
+ <span className={headCls}>Media</span>
+ <MediaModePicker id="mv-setup-media-mode" value={musicVideoMediaMode(project)} onChange={onMediaMode} />
+ </div>
+ <div className={rowCls}>
+ <span className={headCls} aria-hidden="true">Render style</span>
+ <div className="flex min-w-0 flex-wrap items-center gap-2">
+ <RenderStyleSelect project={project} onRenderStyle={onRenderStyle} />
+ <span className="text-xs text-port-text-muted">How the final video is put together; Compose holds its details.</span>
+ </div>
+ </div>
+ <div className={rowCls}>
+ <span className={headCls}>Image service</span>
+ <RecordRenderPinRow
+ idPrefix="mv-setup-frame-pin"
+ label="Frames"
+ imageMode={project.imageMode ?? null}
+ imageModelId={project.imageModelId ?? null}
+ onChange={videoSettings.changeFramePin}
+ />
+ </div>
+ <div className={rowCls}>
+ <span className={headCls}>Video service</span>
+ <div className="flex min-w-0 flex-wrap items-center gap-2">
+ <VideoRenderSettings videoSettings={videoSettings} generating={generatingVideos} />
+ </div>
+ </div>
+ {automation && (
+ <>
+ <fieldset className={rowCls} disabled={briefSaving} aria-labelledby="mv-setup-tools-label">
+ <span id="mv-setup-tools-label" className={headCls}>Autopilot may use</span>
+ <div className="grid min-w-0 grid-cols-1 gap-2 sm:grid-cols-3">
+ {TOOL_GROUPS.map(([group, label]) => (
+ <div key={group} className="min-w-0 rounded border border-port-border p-2">
+ <div className="mb-1 text-[11px] uppercase tracking-wide text-port-text-muted">{label}</div>
+ <div className="flex flex-wrap gap-1.5">
+ {MUSIC_VIDEO_AUTOMATION_TOOLS.filter((t) => t.group === group).map((tool) => (
+ <ToggleChip
+ key={tool.id}
+ id={`mv-setup-tool-${tool.id}`}
+ label={tool.metered ? `${tool.label} $` : tool.label}
+ hint={tool.metered ? 'Spends money or remote quota' : 'Runs on this machine'}
+ checked={picked.has(tool.id)}
+ onToggle={() => toggleTool(tool.id)}
+ />
+ ))}
+ </div>
+ </div>
+ ))}
+ </div>
+ </fieldset>
+ <div className={rowCls}>
+ <label htmlFor="mv-setup-checkin" className={headCls}>Cast &amp; Sets check-in</label>
+ <div className="flex min-w-0 flex-wrap items-center gap-2">
+ <select
+ id="mv-setup-checkin"
+ value={draft.castAndSetsCheckin}
+ disabled={briefSaving}
+ onChange={(e) => saveBrief({ castAndSetsCheckin: e.target.value })}
+ className="min-h-[44px] rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm sm:min-h-0"
+ >
+ <option value="review">Stop for my review</option>
+ <option value="auto">Auto-approve</option>
+ </select>
+ <span className="text-xs text-port-text-muted">
+ Budget cap: {automation.budgetUsd != null ? formatUsd(automation.budgetUsd) : 'none'} (set under Produce)
+ </span>
+ </div>
+ </div>
+ </>
+ )}
+ </div>
+ );
+}
diff --git a/client/src/components/musicVideo/StageChecklist.jsx b/client/src/components/musicVideo/StageChecklist.jsx
new file mode 100644
index 0000000000..37bf2a7b1b
--- /dev/null
+++ b/client/src/components/musicVideo/StageChecklist.jsx
@@ -0,0 +1,44 @@
+import { ArrowRight, CheckCircle2, Circle } from 'lucide-react';
+
+/**
+ * The top of every stage tab: what this stage needs before it counts as done
+ * (`stageChecklist(…)` items), each open item with what is still missing and,
+ * where one exists, a button that scrolls to the control that settles it —
+ * unless the header's next action already goes there (`headerAnchor`).
+ */
+export default function StageChecklist({ items, onAction, headerAnchor = null }) {
+ if (!items?.length) return null;
+ const done = items.filter((item) => item.done).length;
+ return (
+ <section aria-label="What this stage needs" className="min-w-0 rounded-lg border border-port-border bg-port-card p-3">
+ <div className="flex items-center gap-2">
+ <h4 className="text-sm font-medium">What this stage needs</h4>
+ <span className={`text-xs ${done === items.length ? 'text-port-success' : 'text-port-text-muted'}`}>
+ {done === items.length ? 'All done' : `${done} of ${items.length} done`}
+ </span>
+ </div>
+ <ul className="mt-2 space-y-1.5">
+ {items.map((item) => (
+ <li key={item.id} className="flex min-w-0 items-start gap-2 text-sm">
+ {item.done
+ ? <CheckCircle2 size={16} className="mt-0.5 shrink-0 text-port-success" aria-label="done" />
+ : <Circle size={16} className="mt-0.5 shrink-0 text-port-warning" aria-label="to do" />}
+ <div className="min-w-0 flex-1">
+ <span className={item.done ? 'text-port-text-muted' : ''}>{item.label}</span>
+ {!item.done && item.detail && <p className="break-words text-xs text-port-text-muted">{item.detail}</p>}
+ </div>
+ {!item.done && item.action && onAction && item.action.anchor !== headerAnchor && (
+ <button
+ type="button"
+ onClick={() => onAction(item.action)}
+ className="flex min-h-[44px] shrink-0 items-center gap-1 rounded border border-port-border px-2 py-1 text-xs text-port-accent sm:min-h-0"
+ >
+ {item.action.label} <ArrowRight size={12} aria-hidden="true" />
+ </button>
+ )}
+ </li>
+ ))}
+ </ul>
+ </section>
+ );
+}
diff --git a/client/src/components/musicVideo/stages/ComposeStage.jsx b/client/src/components/musicVideo/stages/ComposeStage.jsx
index 0f95c5768f..817a37417c 100644
--- a/client/src/components/musicVideo/stages/ComposeStage.jsx
+++ b/client/src/components/musicVideo/stages/ComposeStage.jsx
@@ -4,12 +4,12 @@ import TypographyPanel from '../TypographyPanel.jsx';
import EidoverseVideoPanel from '../EidoverseVideoPanel.jsx';
import CodeVideoPanel from '../CodeVideoPanel.jsx';
import DocumentCompositionPanel from '../DocumentCompositionPanel.jsx';
-import { RenderStyleSelect } from '../ProjectActionGroups.jsx';
+import { renderStyleLabel } from '../compositionDraft.js';
/**
- * Compose: how the final render is put together — the render style, the timed
- * typography, and (per style) the code-rendered or composition-document
- * panel. The preview of what this produces is docked beside these panels.
+ * 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.
*/
export default function ComposeStage({ board }) {
const { project, locked, audioUrl } = board;
@@ -18,9 +18,11 @@ export default function ComposeStage({ board }) {
<fieldset disabled={locked} className="min-w-0">
<RenderFailure project={project} renderJob={board.renderJob} />
<div className="space-y-2 rounded-lg border border-port-border bg-port-card p-3">
- <div className="flex flex-wrap items-center gap-2">
- <span className="text-xs text-port-text-muted" aria-hidden="true">Render style</span>
- <RenderStyleSelect project={project} onRenderStyle={board.onRenderStyle} />
+ <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>
+ <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>
</div>
<GradePanel project={project} onSave={board.saveCompositionGrade} />
{mode !== 'eidoverse' && <TypographyPanel project={project} onEditLocal={board.editProjectLocal} onSave={board.saveProjectFields} />}
diff --git a/client/src/components/musicVideo/stages/ProduceStage.jsx b/client/src/components/musicVideo/stages/ProduceStage.jsx
index 378e0da9b4..e77fee59e8 100644
--- a/client/src/components/musicVideo/stages/ProduceStage.jsx
+++ b/client/src/components/musicVideo/stages/ProduceStage.jsx
@@ -4,8 +4,9 @@ import { GenerationActions } from '../ProjectActionGroups.jsx';
/**
* Produce: the autopilot (brief, allowed routes, generation and spend caps,
- * the run log) and the manual generators — frame and clip renderers, and the
- * batch "generate what's missing" buttons.
+ * 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.
*/
export default function ProduceStage({ board }) {
const { project, locked, production, videoSettings, sceneMedia, kickoff } = board;
@@ -23,8 +24,8 @@ export default function ProduceStage({ board }) {
kickoffStep={kickoff.stepLabel}
kickoffBlockedReason={board.autopilotBlockedReason}
/>
- <StageSection title="Generation" defaultOpen summary="Frame and clip renderers, and generate what is missing">
- <GenerationActions project={project} videoSettings={videoSettings} sceneMedia={sceneMedia} />
+ <StageSection title="Generation" defaultOpen summary="Generate the frames and clips that are missing">
+ <GenerationActions project={project} videoSettings={videoSettings} sceneMedia={sceneMedia} onEditServices={() => board.goToStage('setup', 'mv-setup-options')} />
</StageSection>
</fieldset>
);
diff --git a/client/src/components/musicVideo/stages/SetupStage.jsx b/client/src/components/musicVideo/stages/SetupStage.jsx
index c46f255c2b..2780656943 100644
--- a/client/src/components/musicVideo/stages/SetupStage.jsx
+++ b/client/src/components/musicVideo/stages/SetupStage.jsx
@@ -9,11 +9,36 @@ import LyricsPanel from '../LyricsPanel.jsx';
import VisualSpecPanel from '../VisualSpecPanel.jsx';
import TreatmentPanel from '../TreatmentPanel.jsx';
import { AudioActions } from '../ProjectActionGroups.jsx';
+import StageSection from '../StageSection.jsx';
+import ProjectOptionsPanel, { projectOptionsSummary } from '../ProjectOptionsPanel.jsx';
+import { projectHasAudio } from '../../../lib/musicVideoStages.js';
+import { formatCount } from '../../../utils/formatters.js';
+
+const songSummary = (project, trackLabel) => {
+ const lines = (project.lyricCues || []).length;
+ return [
+ projectHasAudio(project) ? trackLabel || 'Track attached' : 'No track yet',
+ project.audioAnalysis ? 'Analyzed' : 'Not analyzed',
+ lines ? `${formatCount(lines)} lyric ${lines === 1 ? 'line' : 'lines'}` : 'No lyrics',
+ ].join(' · ');
+};
+
+const directionSummary = (project) => {
+ const refs = (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)} style ${refs === 1 ? 'reference' : 'references'}` : 'No style references',
+ ].join(' · ');
+};
/**
- * Setup: where the song, its analysis and the creative direction come from —
- * creative setup (universe, cast, places), the track and its analysis/MIDI,
- * lyrics, concept & style, the visual spec and the treatment.
+ * 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. 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).
*/
export default function SetupStage({ board }) {
const {
@@ -21,6 +46,8 @@ export default function SetupStage({ board }) {
conceptDraft, styleDraft, importingLyrics, aligningLyrics, treatment,
autopilotRun, autonomous, runStage, onSelectStage,
} = board;
+ const songOpen = !projectHasAudio(project) || !project.audioAnalysis;
+ const trackLabel = project.trackId ? trackName(project.trackId) : audioFilename;
return (
<>
{autopilotRun && (
@@ -34,50 +61,70 @@ export default function SetupStage({ board }) {
framed
/>
)}
- <SongRevisionPanel key={`song-${project.id}`} project={project} tracks={tracks} onUpdated={board.replaceProject} onFork={board.onForkSong} disabled={locked || renderBound || midiBound} />
- <CreativeSetupPanel
- key={`creative-${project.id}`}
- project={project}
- onPendingChange={board.setCreativeSetupPending}
- onSave={board.saveCreativeSetup}
- />
- <StyleReferencesPanel key={`moodboard-${project.id}`} project={project}
- onSave={board.saveStyleReferences} onPendingChange={board.setStyleReferencesPending} />
- <fieldset disabled={locked} className="min-w-0">
- <div id="mv-track" className="space-y-2 rounded-lg border border-port-border bg-port-card p-3">
- <TrackPanel
- project={project}
- tracks={tracks}
- trackName={trackName}
- audioFilename={audioFilename}
- youtube={youtube}
- renderBound={renderBound}
- midiBound={midiBound}
- onChangeTrack={board.onChangeTrack}
- onProjectUpdated={board.replaceProject}
- separation={separation}
- />
- <AudioActions project={project} midi={midi} midiBound={midiBound} busy={busy} onAnalyze={board.onAnalyze} />
- <AnalysisPanel
- audioAnalysis={project.audioAnalysis}
- scenes={project.scenes || []}
- tempo={tempo}
- onReanalyze={board.onAnalyze}
- analyzing={busy.analyzing}
- />
- <LyricsPanel
- project={project}
- onEditLocal={board.editProjectLocal}
- onSave={board.saveProjectFields}
- onImport={board.onImportLyrics}
- onImportTrack={board.onImportTrackLyrics}
- importing={importingLyrics}
- onAlign={board.onAlignLyrics}
- aligning={aligningLyrics}
- />
-
+ <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}
+ />
+ </StageSection>
+ <StageSection id="mv-setup-song" title="Song & lyrics" summary={songSummary(project, trackLabel)} defaultOpen={songOpen}>
+ <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">
+ <div id="mv-track" className="space-y-2">
+ <TrackPanel
+ project={project}
+ tracks={tracks}
+ trackName={trackName}
+ audioFilename={audioFilename}
+ youtube={youtube}
+ renderBound={renderBound}
+ midiBound={midiBound}
+ onChangeTrack={board.onChangeTrack}
+ onProjectUpdated={board.replaceProject}
+ separation={separation}
+ />
+ <AudioActions project={project} midi={midi} midiBound={midiBound} busy={busy} onAnalyze={board.onAnalyze} />
+ <AnalysisPanel
+ audioAnalysis={project.audioAnalysis}
+ scenes={project.scenes || []}
+ tempo={tempo}
+ onReanalyze={board.onAnalyze}
+ analyzing={busy.analyzing}
+ />
+ <LyricsPanel
+ project={project}
+ onEditLocal={board.editProjectLocal}
+ onSave={board.saveProjectFields}
+ onImport={board.onImportLyrics}
+ onImportTrack={board.onImportTrackLyrics}
+ importing={importingLyrics}
+ onAlign={board.onAlignLyrics}
+ aligning={aligningLyrics}
+ />
+ </div>
+ </fieldset>
+ </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}
+ />
+ <StyleReferencesPanel key={`moodboard-${project.id}`} project={project}
+ onSave={board.saveStyleReferences} onPendingChange={board.setStyleReferencesPending} />
+ <fieldset disabled={locked} className="min-w-0 space-y-2">
{/* Concept & style — global direction for the video */}
- <div className="mt-2 grid grid-cols-1 gap-2 sm:grid-cols-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
@@ -111,9 +158,13 @@ export default function SetupStage({ board }) {
onSave={board.saveVisualSpec}
onAddReference={board.onAddReference}
/>
+ </fieldset>
+ </StageSection>
+ <StageSection id="mv-setup-treatment" title="Treatment" summary="The shot-by-shot treatment the plan builds on">
+ <fieldset disabled={locked} className="min-w-0">
<TreatmentPanel key={`treatment-${project.id}`} project={project} treatment={treatment} />
- </div>
- </fieldset>
+ </fieldset>
+ </StageSection>
</>
);
}
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index 2a4ac5e7f1..33cb967d94 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -64,7 +64,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `musicVideoLayers.js` | Music-video per-scene visual layers (#8985), re-exported from `server/lib/musicVideoLayers.js`: `MUSIC_VIDEO_VISUAL_LAYERS`, `MUSIC_VIDEO_STILL_MOVES`, `sceneVisualLayer(scene, { layered })`, `sceneHasAuthoredSpan`, `sceneRenderReady(scene, { layered })`. Used by `components/musicVideo/SceneCard.jsx`, `ProjectActionGroups.jsx` and `hooks/useMusicVideoSceneMedia.js`. |
| `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`, `takeProvenance`; `TAKE_SLOT` maps a take kind to its selection field. Used by `components/musicVideo/SceneTakeStrip.jsx` and `pages/MusicVideo.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), 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` (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), 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`. |
| `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`). |
| `musicVideoUniverseRefs.js` | `pullUniverseCanonReferences(universe, existingReferences)` (#8978) maps a linked universe's characters/places/objects to visual-spec references (character/set/prop roles), skipping images already present and capping at `MUSIC_VIDEO_MAX_REFERENCES` (24, mirrors the server schema). Returns `{ next, added, skipped }`; the caller persists `next` via the ordinary visualSpec PATCH. Used by `components/musicVideo/VisualSpecPanel.jsx`. (The style snapshots are derived server-side, #9105.) |
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.js
index 2bf05d27ae..332fef4dfa 100644
--- a/client/src/lib/musicVideoStages.js
+++ b/client/src/lib/musicVideoStages.js
@@ -9,6 +9,8 @@ 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 { isNonBlankStr } from './textUtils';
+import { modeLabel } from './imageGenModes.js';
export const MUSIC_VIDEO_STAGES = [
{ id: 'setup', label: 'Setup', title: 'Setup' },
@@ -58,6 +60,13 @@ export function projectShotSummary(project) {
export const projectHasAudio = (project) => !!(project?.trackId || project?.uploadedAudioFilename);
+const VIDEO_BACKEND_LABELS = { local: 'Local video', grok: 'Grok video', fal: 'fal.ai video' };
+/** "Images: Local · Video: fal.ai video" — the project's saved image (frame) and video render services. */
+export const projectServicesSummary = (project) => [
+ `Images: ${project?.imageMode ? modeLabel(project.imageMode) : 'install default'}`,
+ `Video: ${VIDEO_BACKEND_LABELS[project?.videoSettings?.backend] || 'install default'}`,
+].join(' · ');
+
/**
* What the project has spent on paid generation across its production runs,
* against the cap that applies now: the live/latest run's, else the autopilot
@@ -319,3 +328,88 @@ export function deriveNextAction(project, {
};
}
}
+
+// The editable art-direction fields Production approvals needs before art can be approved.
+const ART_DIRECTION_FIELDS = [['cast', 'cast'], ['environments', 'sets'], ['visualLanguage', 'visual language'], ['motionLanguage', 'motion']];
+const APPROVAL_ANCHORS = { art: 'mv-review-art', storyboard: 'mv-review-storyboard', proof: 'mv-review-proof' };
+
+/**
+ * What one stage tab needs before it counts as done, as a short checklist the
+ * tab shows above its panels: `[{ id, label, done, detail?, action? }]`. The
+ * `done` answers mirror `deriveStages`, so the tab, its status mark and the
+ * header's "needs you" agree; `detail` says what is still missing (for an
+ * approval, the server's first readiness problem); `action` is a
+ * `{ label, anchor }` the tab can scroll to. Approvals are revision-bound and
+ * live in Production approvals, never on a development file: approving a
+ * Cast & Sets sheet file does not approve the art direction, so the art item
+ * says so while it is open.
+ */
+export function stageChecklist(stageId, project, readiness = project?.productionReadiness) {
+ if (!project) return [];
+ const draft = project.productionReview?.draft || {};
+ const scenes = project.scenes || [];
+ const mode = project.composition?.mode || 'concat';
+ const approval = (key, label, waitingText) => {
+ const approved = !!readiness?.[key]?.approved;
+ return {
+ id: `approve-${key}`, label: `${label} approved`, done: approved,
+ detail: approved || !readiness ? null : (readiness[key]?.problems?.[0] || waitingText),
+ action: approved ? null : { label: `Review ${label.toLowerCase()}`, anchor: APPROVAL_ANCHORS[key] },
+ };
+ };
+ switch (stageId) {
+ case 'setup': {
+ // An autonomous run that is still going writes the song itself.
+ const autoSong = !!project.autonomousRun && !['completed', 'canceled', 'failed'].includes(project.autonomousRun.status);
+ const hasAudio = projectHasAudio(project);
+ return [
+ { id: 'track', label: 'Track attached', done: hasAudio, detail: !hasAudio && autoSong ? 'The autopilot 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.' },
+ ];
+ }
+ case 'cast-sets': {
+ const missing = ART_DIRECTION_FIELDS.filter(([key]) => !isNonBlankStr(draft[key])).map(([, label]) => label);
+ const guide = (project.devArtifacts || []).find((a) => a.id === draft.guideArtifactId && !a.deleted) || null;
+ return [
+ { id: 'direction', label: 'Art direction written', done: missing.length === 0, detail: missing.length ? `Still missing: ${missing.join(', ')}.` : null },
+ { id: 'guide', label: guide ? `Visual guide chosen: ${guide.title || guide.filename || 'sheet'}` : 'Visual guide chosen', done: !!guide,
+ detail: guide ? null : 'Pick a Cast & Sets sheet as the visual guide in Production approvals.' },
+ approval('art', 'Art direction', 'Ready for your review. Approving a sheet file does not approve the art direction; approve it in Production approvals.'),
+ ];
+ }
+ case 'board': {
+ const planned = scenes.length > 0 || (draft.storyboard || []).length > 0;
+ return [
+ { id: 'shots', label: 'Shots planned', done: planned, detail: planned ? null : 'Plan the shots from the header, or add scenes by hand.' },
+ approval('storyboard', 'Timed storyboard', 'Ready for your review in Production approvals.'),
+ ];
+ }
+ case 'produce': {
+ const items = [];
+ if (mode !== 'code' && mode !== 'document') {
+ const layered = isLayeredComposition(project);
+ const ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
+ items.push({ id: 'footage', label: `Footage for every shot (${formatCount(ready)} of ${formatCount(scenes.length)})`, done: scenes.length > 0 && ready === scenes.length });
+ }
+ items.push(approval('proof', 'Animated proof', 'Render the proof, watch it with sound, then approve it in Production approvals.'));
+ return items;
+ }
+ case 'compose': {
+ // Compose counts as done only behind an approved proof (see deriveStages).
+ const proof = { id: 'proof', label: 'Animated proof approved (Produce)', done: !!readiness?.proof?.approved };
+ if (mode === 'composed') return [proof, { id: 'composition', label: 'Timed typography added', done: (project.composition?.textCues || []).length > 0 }];
+ if (mode === 'document') return [proof, { id: 'composition', label: 'Composition document attached', done: !!project.composition?.document }];
+ return [proof, { id: 'composition', label: 'Nothing to compose for this render style', done: true }];
+ }
+ case 'review':
+ return [{ id: 'final', label: 'Final video rendered', done: !!project.renderHistoryId }];
+ case 'publish':
+ return [
+ { id: 'kit', label: 'Publishing kit built', done: !!project.publishKit?.builtAt },
+ { id: 'posted', label: 'Posted to a platform', done: Object.keys(project.publishKit?.posts || {}).length > 0 },
+ ];
+ default:
+ return [];
+ }
+}
diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.js
index 10dfb36f92..bb53c409fb 100644
--- a/client/src/lib/musicVideoStages.test.js
+++ b/client/src/lib/musicVideoStages.test.js
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import {
- MUSIC_VIDEO_STAGES, currentProductionRun, deriveNextAction, deriveStages, projectSpend, listPreviewSources, describeProjectStatus, resolveStageParam,
+ MUSIC_VIDEO_STAGES, currentProductionRun, deriveNextAction, deriveStages, projectSpend, listPreviewSources, describeProjectStatus, resolveStageParam, stageChecklist,
} from './musicVideoStages.js';
const APPROVED = { art: { approved: true }, storyboard: { approved: true }, proof: { approved: true }, readyForProduction: true };
@@ -217,3 +217,52 @@ it('links active draft and proof jobs to their own evidence controls before offe
const nextAction = deriveNextAction(project, { draftActive: true });
expect(describeProjectStatus(project, { progress: deriveStages(project), nextAction })).toMatchObject({ headline: 'Review render in progress', tone: 'muted' });
});
+
+describe('stageChecklist', () => {
+ const NOT_APPROVED = {
+ art: { approved: false, problems: [] }, storyboard: { approved: false, problems: ['Review and approve the current art direction first.'] },
+ proof: { approved: false, problems: [] }, readyForProduction: false,
+ };
+ const castProject = (over = {}) => ({
+ id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [],
+ devArtifacts: [{ id: 'sheet', title: 'Cast sheet', mimeType: 'text/html' }, { id: 'gone', title: 'Rejected sheet', deleted: true }],
+ productionReview: { draft: { cast: 'c', environments: 'e', visualLanguage: 'v', motionLanguage: 'm', guideArtifactId: 'sheet' } },
+ ...over,
+ });
+
+ it('keeps Cast & Sets open on the art approval, not on a sheet file, and says where to approve it', () => {
+ const items = stageChecklist('cast-sets', castProject(), NOT_APPROVED);
+ expect(items.map((i) => [i.id, i.done])).toEqual([['direction', true], ['guide', true], ['approve-art', false]]);
+ expect(items[1].label).toBe('Visual guide chosen: Cast sheet');
+ expect(items[2].detail).toMatch(/Approving a sheet file does not approve the art direction/);
+ expect(items[2].action).toEqual({ label: 'Review art direction', anchor: 'mv-review-art' });
+ // Its done answer matches the tab's own state, so the checklist and the "needs you" mark agree.
+ expect(deriveStages(castProject(), NOT_APPROVED).current).toBe('cast-sets');
+ const approved = stageChecklist('cast-sets', castProject(), APPROVED);
+ expect(approved.every((i) => i.done)).toBe(true);
+ expect(deriveStages(castProject(), APPROVED).stages.find((s) => s.id === 'cast-sets').state).toBe('done');
+ });
+
+ it('names what Cast & Sets is missing: unwritten direction, a deleted guide, and the server reason', () => {
+ const items = stageChecklist('cast-sets', castProject({
+ productionReview: { draft: { cast: 'c', environments: ' ', visualLanguage: '', motionLanguage: 'm', guideArtifactId: 'gone' } },
+ }), { ...NOT_APPROVED, art: { approved: false, problems: ['Attach a visual cast/environment sheet from Development artifacts.'] } });
+ expect(items[0]).toMatchObject({ done: false, detail: 'Still missing: sets, visual language.' });
+ expect(items[1]).toMatchObject({ done: false, label: 'Visual guide chosen' });
+ 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', () => {
+ expect(stageChecklist('setup', { id: 'p' }).map((i) => i.done)).toEqual([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.
+ expect(stageChecklist('setup', { id: 'p', autonomousRun: { status: 'running' } })[0]).toMatchObject({ action: null, detail: 'The autopilot run is making the song.' });
+ expect(stageChecklist('board', castProject({ scenes: [scene()] }), NOT_APPROVED).map((i) => [i.id, i.done]))
+ .toEqual([['shots', true], ['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 });
+ // A code render draws its own picture: no footage item.
+ expect(stageChecklist('produce', castProject({ composition: { mode: 'code' } }), APPROVED).map((i) => i.id)).toEqual(['approve-proof']);
+ expect(stageChecklist('compose', castProject({ composition: { mode: 'composed', textCues: [] } }), APPROVED).map((i) => i.done)).toEqual([true, false]);
+ });
+});
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 3cc0a20640..83fdd5dd69 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -65,6 +65,7 @@ import MusicVideoProjectCard from '../components/musicVideo/MusicVideoProjectCar
import PreviewDock from '../components/musicVideo/PreviewDock.jsx';
import NeedsAttentionBanner from '../components/musicVideo/NeedsAttentionBanner.jsx';
import SetupStage from '../components/musicVideo/stages/SetupStage.jsx';
+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';
@@ -82,7 +83,7 @@ import { videoPosterForJob } from '../lib/creativeDirectorPreview.js';
import { sceneTakeList } from '../lib/musicVideoTakes.js';
import { deriveAttentionItems } from '../lib/musicVideoAttention.js';
import {
- productionReviewStopGuidance, approvalSummary, deriveNextAction, deriveStages, projectShotSummary, describeProjectStatus, listPreviewSources, projectSpend, resolveStageParam,
+ productionReviewStopGuidance, approvalSummary, deriveNextAction, deriveStages, projectShotSummary, describeProjectStatus, listPreviewSources, projectSpend, resolveStageParam, stageChecklist,
} from '../lib/musicVideoStages.js';
import { AUTONOMOUS_STATUS_LABELS, AUTONOMOUS_VIEWABLE_STAGES } from '../lib/musicVideoAutonomous.js';
@@ -924,6 +925,9 @@ export default function MusicVideo() {
saveCompositionGrade: (patch) => saveProjectFields(patch, { applyComposition: true }),
saveVisualSpec,
saveAutomation,
+ saveMediaMode: (mediaMode) => updateMusicVideoProject(selected.id, { mediaMode }, { silent: true })
+ .then((project) => patchProject(project.id, { mediaMode: project.mediaMode, updatedAt: project.updatedAt }))
+ .catch((err) => toast.error(err?.message || 'Failed to save the media mode')),
saveCreativeSetup: (patch) => updateMusicVideoProject(selected.id, patch, { silent: true }).then((project) => {
patchProject(project.id, { concept: project.concept, visualSpec: project.visualSpec, productionPolicy: project.productionPolicy });
}),
@@ -961,6 +965,7 @@ export default function MusicVideo() {
commitSceneTiming,
approveCastAndSets,
skipCastAndSets,
+ goToStage,
openArtifact,
openPreview,
openContactSheet: () => setContactSheetOpen(true),
@@ -1277,6 +1282,11 @@ export default function MusicVideo() {
</StageSection>
</div>}
>
+ <StageChecklist
+ items={stageChecklist(activeStage, selected, productionReview.readiness)}
+ onAction={(action) => goToStage(activeStage, action.anchor)}
+ headerAnchor={nextAction?.kind === 'goto' ? nextAction.anchor : null}
+ />
<StageView key={selected.id} board={board} />
</MusicVideoLayout>
)}
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index b4e9c3a630..64a99bdc84 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -796,7 +796,7 @@ describe('MusicVideo project video renderer', () => {
await openProject({
...PROJECT_NO_CLIP,
videoSettings: { modelId: 'ltx23_distilled_q4' },
- }, 'produce');
+ }, 'setup');
expect(await screen.findByLabelText('Scene video renderer')).toHaveProperty('value', '');
await openStage('board');
@@ -807,7 +807,7 @@ describe('MusicVideo project video renderer', () => {
});
it('clears an existing backend pin with the Install default option', async () => {
- await openProject(PROJECT_NO_CLIP, 'produce');
+ await openProject(PROJECT_NO_CLIP, 'setup');
fireEvent.change(await screen.findByLabelText('Scene video renderer'), {
target: { value: '' },
@@ -822,7 +822,7 @@ 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, 'produce');
+ await openProject(PROJECT_NO_CLIP, 'setup');
const model = await screen.findByLabelText('Local video model');
fireEvent.change(model, { target: { value: 'ltx23_distilled_q4' } });
@@ -860,7 +860,7 @@ 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, 'produce');
+ await openProject(PROJECT_NO_CLIP, 'setup');
fireEvent.change(await screen.findByLabelText('Scene generation mode'), {
target: { value: 'audioReactive' },
@@ -902,7 +902,7 @@ describe('MusicVideo project video renderer', () => {
audioReactiveLora: 'audio-reactive-v2.safetensors',
audioReactiveScale: 1.2,
},
- }, 'produce');
+ }, 'setup');
const lora = await screen.findByLabelText('Audio reactive LoRA');
expect(lora.value).toBe('audio-reactive-v2.safetensors');
@@ -922,7 +922,7 @@ 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, 'produce');
+ await openProject(PROJECT_NO_CLIP, 'setup');
fireEvent.change(await screen.findByLabelText('Scene video renderer'), {
target: { value: 'fal' },
@@ -961,7 +961,7 @@ describe('MusicVideo project video renderer', () => {
await openProject({
...PROJECT_NO_CLIP,
videoSettings: { backend: 'fal', falDuration: 6 },
- }, 'produce');
+ }, 'setup');
expect(await screen.findByLabelText('fal.ai scene clip duration')).toHaveProperty('value', '6');
await openStage('board');
@@ -997,7 +997,7 @@ describe('MusicVideo project video renderer', () => {
})));
// Switching model clears the resolution pin — its alphabet is per model.
- await openStage('produce');
+ await openStage('setup');
fireEvent.change(await screen.findByLabelText('fal.ai cutaway model'), {
target: { value: 'fal-ai/kling-video/v3/pro/image-to-video' },
});
@@ -1033,7 +1033,7 @@ 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 }), 'produce');
+ await openProject(performanceProject({ backend: 'grok', grokDuration: 6 }), 'setup');
expect(await screen.findByRole('option', { name: 'Grok video (cutaway only)' })).toBeTruthy();
await openStage('board');
@@ -2352,11 +2352,16 @@ describe('MusicVideo stage tabs (#9243)', () => {
it('every control has exactly one home tab', async () => {
const project = { ...PROJECT_WITH_CLIP, castAndSets: { status: 'review', revision: 1, plan: {}, images: {} }, audioAnalysis: PROJECT_ANALYZED.audioAnalysis };
const landmarks = {
- setup: { 'Change track': () => screen.queryByLabelText('Change track'), 'Concept': () => screen.queryByLabelText('Concept'), MIDI: () => screen.queryByRole('button', { name: /^MIDI$/ }) },
+ 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'),
+ },
'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: { 'Autopilot': () => screen.queryByLabelText('Autopilot'), 'Scene video renderer': () => screen.queryByLabelText('Scene video renderer'), 'Start production': () => screen.queryByRole('button', { name: /Start production/ }) },
- compose: { 'Render style': () => document.getElementById('mv-toolbar-render-style'), Typography: () => screen.queryByText(/^Typography —/) },
+ produce: { 'Autopilot': () => screen.queryByLabelText('Autopilot'), '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/ }), 'Import development file': () => screen.queryByLabelText('Import development file') },
};
await openProject(project);
@@ -2641,6 +2646,41 @@ describe('direct production review navigation', () => {
});
});
+describe('stage checklist and Setup 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.
+ const project = { ...PROJECT_ANALYZED, scenes: [], castAndSets: { status: 'skipped' },
+ devArtifacts: [{ id: 'sheet', kind: 'cast-sets', title: 'Cast sheet', mimeType: 'text/html', version: 1, status: 'approved' }],
+ productionReview: { draft: { cast: 'c', environments: 'e', visualLanguage: 'v', motionLanguage: 'm', guideArtifactId: null,
+ lyricsMode: 'vocal', timingStatus: 'provisional', timingNotes: '', storyboard: [] } },
+ productionReadiness: { readyForProduction: false, basis: {}, art: { approved: false, problems: [] },
+ storyboard: { approved: false, problems: [] }, proof: { approved: false, problems: [] } } };
+ await openProject(project, 'cast-sets');
+ const checklist = screen.getByRole('region', { name: 'What this stage needs' });
+ expect(checklist).toHaveTextContent('1 of 3 done');
+ expect(checklist).toHaveTextContent('Pick a Cast & Sets sheet as the visual guide in Production approvals.');
+ expect(checklist).toHaveTextContent('Art direction approved');
+ 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 () => {
+ 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');
+ 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'));
+ await waitFor(() => expect(updateMusicVideoProject).toHaveBeenCalledWith(project.id, expect.objectContaining({
+ mode: 'autonomous', automation: expect.objectContaining({ tools: ['image:local', 'video:local'], guidance: 'g', budgetUsd: 5 }),
+ }), { silent: true }));
+ });
+});
+
describe('Autopilot collapsed review summary', () => {
it('shows the current blocker in the summary while retaining the historical error in run details', async () => {
const error = 'Review and approve the current art direction first.';