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

fix: Music Video header and Cast & Sets tab offer Start, Skip and Plan the shots instead of an unreachable approval jump (#10137)

Adam Eivy84b94824b836
diff --git a/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx b/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
index d40a0a6a02..2edfe94bc8 100644
--- a/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
+++ b/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
@@ -235,3 +235,15 @@ describe('Cast & Sets tab: undo, regenerate and guide import', () => {
expect(screen.queryByRole('button', { name: 'Use Check-in sheet as visual guide' })).toBeNull();
});
});
+
+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() }} />);
+ fireEvent.click(screen.getByRole('button', { name: 'Build cast & sets' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Skip' }));
+ expect(start).toHaveBeenCalledTimes(1);
+ expect(skip).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/client/src/components/musicVideo/stages/CastSetsStage.jsx b/client/src/components/musicVideo/stages/CastSetsStage.jsx
index e819b3cdb8..50e18ba23e 100644
--- a/client/src/components/musicVideo/stages/CastSetsStage.jsx
+++ b/client/src/components/musicVideo/stages/CastSetsStage.jsx
@@ -22,10 +22,23 @@ export default function CastSetsStage({ board }) {
onSkip={board.skipCastAndSets}
/>
) : (
- <p className="rounded-lg border border-port-border bg-port-card p-3 text-sm text-port-text-muted">
- The autopilot builds the cast and sets — and stops for your check-in — before it plans the shots.
- Run it from the header or the Produce tab; a hands-on project can skip this stage.
- </p>
+ <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>
+ <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'}
+ className="min-h-10 rounded-lg bg-port-accent px-3 py-2 text-sm font-medium text-white disabled:opacity-50">
+ Build cast &amp; sets
+ </button>
+ <button type="button" onClick={() => castSets.skip()} disabled={locked || castSets.busy || kickoff.running}
+ className="min-h-10 rounded-lg border border-port-border px-3 py-2 text-sm text-port-text-muted hover:text-white disabled:opacity-50">
+ Skip
+ </button>
+ </div>
+ </div>
)}
<DevArtifactsPanel
project={project}
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.js
index 3143ada538..2129b1a045 100644
--- a/client/src/lib/musicVideoStages.js
+++ b/client/src/lib/musicVideoStages.js
@@ -324,9 +324,15 @@ export function deriveNextAction(project, {
if (proofActive) return { id: 'proof-progress', kind: 'goto', stage: 'review', 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' };
- if (projectHasAudio(project) && project.audioAnalysis && !CAST_WORKING.has(cast?.status) && !readiness?.readyForProduction && run?.status !== 'running' && !renderActive && !kickoffRunning) {
- const art = !readiness?.art.approved;
- const board = !readiness?.storyboard.approved;
+ const art = !readiness?.art.approved;
+ const board = !readiness?.storyboard.approved;
+ // The approval panel only opens once the stage's own work exists: a stage with
+ // nothing built yet (no check-in, no shots) offers Start / Plan, and an open
+ // 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;
+ if (projectHasAudio(project) && project.audioAnalysis && !CAST_WORKING.has(cast?.status) && !readiness?.readyForProduction && run?.status !== 'running' && !renderActive && !kickoffRunning
+ && !castNeedsOwnAction && !boardNeedsOwnAction) {
return { id: 'review-production', kind: 'goto', stage: art ? 'cast-sets' : board ? 'board' : 'review',
anchor: art ? 'mv-review-art' : board ? 'mv-review-storyboard' : 'mv-review-proof',
label: art ? 'Review art direction' : board ? 'Review timed storyboard' : 'Review animated proof',
@@ -382,6 +388,7 @@ export function deriveNextAction(project, {
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' };
if (cast && CAST_WORKING.has(cast.status)) return { id: 'busy', kind: 'run', label: 'Building cast & sets…', shortLabel: 'Building…', disabled: true };
+ if (!cast && !project.automation) return { id: 'start-cast-sets', kind: 'run', label: 'Build cast & sets', shortLabel: 'Build', disabled: !project.audioAnalysis, reason: project.audioAnalysis ? undefined : 'Analyze the track first' };
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' };
diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.js
index 0a997adc88..829b82f7bd 100644
--- a/client/src/lib/musicVideoStages.test.js
+++ b/client/src/lib/musicVideoStages.test.js
@@ -39,11 +39,19 @@ describe('deriveStages / deriveNextAction', () => {
expect(deriveNextAction(autoFailed)).toMatchObject({ id: 'retry-autonomous', kind: 'run', label: 'Retry autonomous run' });
});
- it('a project waiting on Cast & Sets approval offers the approval, and a stopped check-in offers to resume', () => {
+ it('a project waiting on Cast & Sets approval offers the approval, a stopped check-in offers to resume, and no check-in offers to start', () => {
const waiting = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, automation: {}, castAndSets: { status: 'review' }, scenes: [] };
expect(deriveStages(waiting).current).toBe('cast-sets');
expect(stateOf(waiting)).toMatchObject({ setup: 'done', 'cast-sets': 'active', board: 'todo' });
- expect(deriveNextAction(waiting)).toMatchObject({ id: 'review-production', kind: 'goto', stage: 'cast-sets', shortLabel: 'Art' });
+ expect(deriveNextAction(waiting)).toMatchObject({ id: 'approve-cast-sets', kind: 'run' });
+
+ const notStarted = { ...waiting, castAndSets: null };
+ expect(deriveNextAction(notStarted)).toMatchObject({ id: 'kickoff' });
+ expect(deriveNextAction({ ...notStarted, automation: undefined })).toMatchObject({ id: 'start-cast-sets', kind: 'run', disabled: false });
+
+ const unplanned = { ...waiting, castAndSets: { status: 'approved' }, productionReadiness: { art: { approved: true }, storyboard: { approved: false }, proof: { approved: false }, readyForProduction: false } };
+ expect(deriveNextAction(unplanned)).toMatchObject({ id: 'plan' });
+ expect(deriveNextAction({ ...unplanned, scenes: [{ id: 's1' }] })).toMatchObject({ id: 'review-production', stage: 'board' });
const interrupted = { ...waiting, castAndSets: { status: 'imaging', interrupted: true } };
expect(stateOf(interrupted)['cast-sets']).toBe('blocked');
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 70c9c47f74..be8c8c0f54 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -983,6 +983,7 @@ export default function MusicVideo() {
case 'plan': handlePlan(); break;
case 'approve-cast-sets': approveCastAndSets(); break;
case 'resume-cast-sets': castSets.resume(); break;
+ case 'start-cast-sets': castSets.start(); break;
case 'stop-production': production.stop(nextAction.runId); break;
case 'resume-production': production.resume(nextAction.runId, nextAction.acceptBasis ? { acceptBasis: true } : {}); break;
case 'resume-autonomous':
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index 62392af487..4b5e4a3946 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -2760,7 +2760,7 @@ describe('MusicVideo main page project cards', () => {
describe('direct production review navigation', () => {
it('focuses the exact step on repeated clicks and restores its deep link with Back/Forward without approval', async () => {
- const project = { ...PROJECT_ANALYZED, scenes: [], composition: { mode: 'document' },
+ const project = { ...PROJECT_ANALYZED, scenes: [], castAndSets: { status: 'skipped' }, composition: { mode: 'document' },
productionReview: { draft: { storyboardSource: 'document', storyboard: [{ id: 'shot-1' }, { id: 'shot-2' }] } },
productionReadiness: { readyForProduction: false, basis: {}, art: { approved: false, problems: [] },
storyboard: { approved: false, problems: ['Approve art first'] }, proof: { approved: false, problems: ['Approve storyboard first'] } } };