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: usable on a phone, with the latest drafts and proofs in view (#10310)

[._.]/98772f9ed8d6
diff --git a/client/src/components/musicVideo/ExcerptPanel.jsx b/client/src/components/musicVideo/ExcerptPanel.jsx
index 7f79de0e1c..f2302661be 100644
--- a/client/src/components/musicVideo/ExcerptPanel.jsx
+++ b/client/src/components/musicVideo/ExcerptPanel.jsx
@@ -129,7 +129,7 @@ function ExcerptCard({ excerpt, role, proofApproved, activeRenderId, connected,
: <button type="button" disabled={deleting} onClick={() => setConfirmingDelete(true)} className="text-port-error flex items-center gap-1 disabled:opacity-50 min-h-[44px] sm:min-h-0"><Trash2 size={12} /> Delete</button>}
</div>
</div>
- <p className="text-xs text-port-text-muted">{excerpt.dependencyState?.status === 'stale' ? 'Earlier inputs — retained for reference' : excerpt.dependencyState?.status === 'current' ? 'Matches current inputs · production approval is separate' : 'Draft · approval is separate'}{excerpt.createdAt ? ` · ${new Date(excerpt.createdAt).toISOString().replace('T', ' ').slice(0, 19)} UTC` : ''}</p>
+ <p className="text-xs text-port-text-muted">{excerpt.dependencyState?.status === 'stale' ? 'Made before later changes · re-render this range to see them' : excerpt.dependencyState?.status === 'current' ? 'Matches current inputs · production approval is separate' : 'Draft · approval is separate'}{excerpt.createdAt ? ` · ${new Date(excerpt.createdAt).toISOString().replace('T', ' ').slice(0, 19)} UTC` : ''}</p>
{excerpt.status === 'error' && excerpt.error && <p role="alert" className="text-xs text-port-error">{excerpt.error}</p>}
{excerpt.status === 'complete' && excerpt.filename && (
<div className="space-y-2">
@@ -178,12 +178,15 @@ export default function ExcerptPanel({ project, rendering, occupied = rendering,
const newest = [...excerpts].reverse();
const latestAttempt = newest[0];
const roleOf = new Map(newest.map(e => [e.id, excerptRole(project, e)]));
- // The latest usable excerpt PER ROLE stays visible, so a new social cut never buries the review draft.
+ // The latest finished render per role AND range stays visible: a new social cut never buries the
+ // review draft, and a proof of the second chorus never hides the one of the opening. A render made
+ // before later changes stays the latest of its range (its card says it is out of date) until a
+ // newer one replaces it; only older renders of the same range and failures go to earlier attempts.
const currentIds = new Set();
- const seenRoles = new Set();
+ const seen = new Set();
for (const e of newest) {
- const role = roleOf.get(e.id);
- if (e.status === 'complete' && e.filename && e.dependencyState?.status !== 'stale' && !seenRoles.has(role)) { seenRoles.add(role); currentIds.add(e.id); }
+ const key = `${roleOf.get(e.id)}:${e.startSec}:${e.endSec}:${e.aspect || ''}`;
+ if (e.status === 'complete' && e.filename && !seen.has(key)) { seen.add(key); currentIds.add(e.id); }
}
const visible = newest.filter(e => e.status === 'rendering' || currentIds.has(e.id));
const history = newest.filter(e => !visible.includes(e));
@@ -221,7 +224,15 @@ export default function ExcerptPanel({ project, rendering, occupied = rendering,
return (
<div id="mv-draft-excerpts" tabIndex={-1} style={{ scrollMarginTop: 'calc(var(--mv-header-h, 9rem) + 1rem)' }} className="space-y-2">
- <span className="text-xs text-port-text-muted flex items-center gap-1"><Film size={12} /> Draft excerpt</span>
+ {/* The renders come first, newest first, so the latest proof or draft is the first thing on the step. */}
+ {visible.length > 0 ? <ul aria-label="Current draft and active renders" className="space-y-2">{visible.map(card)}</ul>
+ : <p className="text-xs text-port-text-muted">No drafts yet. Render a range below to check it before the full video.</p>}
+ {history.length > 0 && <details>
+ <summary className="cursor-pointer min-h-[44px] py-2 text-sm">Earlier and failed attempts ({formatCount(history.length)})</summary>
+ <p className="text-xs text-port-text-muted">Older renders of the same range, and failed or cancelled attempts. They do not block approval of the current work.</p>
+ <ul className="space-y-2">{history.map(card)}</ul>
+ </details>}
+ <span className="text-xs text-port-text-muted flex items-center gap-1 pt-2"><Film size={12} /> Render a draft</span>
<div className="flex flex-wrap items-end gap-2">
<div>
<label htmlFor={idFor('start')} className="block text-[10px] text-port-text-muted">Start (sec)</label>
@@ -312,12 +323,6 @@ export default function ExcerptPanel({ project, rendering, occupied = rendering,
rendering={occupied} autoReview={autoReview} />
)}
</details>
- {visible.length > 0 && <ul aria-label="Current draft and active renders" className="space-y-2">{visible.map(card)}</ul>}
- {history.length > 0 && <details>
- <summary className="cursor-pointer min-h-[44px] py-2 text-sm">Earlier and failed attempts ({formatCount(history.length)})</summary>
- <p className="text-xs text-port-text-muted">Retained for comparison. These attempts do not block approval of the current work.</p>
- <ul className="space-y-2">{history.map(card)}</ul>
- </details>}
</div>
);
}
diff --git a/client/src/components/musicVideo/ExcerptPanel.test.jsx b/client/src/components/musicVideo/ExcerptPanel.test.jsx
index a09615c232..f71e314fc7 100644
--- a/client/src/components/musicVideo/ExcerptPanel.test.jsx
+++ b/client/src/components/musicVideo/ExcerptPanel.test.jsx
@@ -5,7 +5,7 @@
* range-only control (it has no frame of its own to re-lay-out).
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
-import { render, screen, fireEvent, waitFor } from '@testing-library/react';
+import { render, screen, fireEvent, waitFor, within } from '@testing-library/react';
vi.mock('../../services/apiMusicVideo.js', () => ({ getMusicVideoSocialCuts: vi.fn() }));
@@ -62,7 +62,7 @@ it('keeps the current draft visible while retaining stale and failed attempts be
expect(screen.getByRole('status')).toHaveTextContent('Latest draft attempt failed: Render interrupted');
fireEvent.click(screen.getByText('Earlier and failed attempts (2)'));
expect(history.open).toBe(true);
- expect(screen.getByText('Earlier inputs — retained for reference')).toBeVisible();
+ expect(screen.getByText('Made before later changes · re-render this range to see them')).toBeVisible();
expect(screen.getByRole('alert')).toHaveTextContent('Render interrupted');
});
@@ -88,6 +88,28 @@ it('does not mislabel current footage after it has been approved as production p
describe('ExcerptPanel roles and deletion (#10148)', () => {
const done = (id, extra = {}) => ({ id, status: 'complete', filename: `${id}.mp4`, startSec: 0, endSec: 12, dependencyState: { status: 'current' }, ...extra });
+ it('keeps a range\'s newest render visible even when later changes made it out of date', () => {
+ render(<ExcerptPanel project={documentProject} rendering={false} progress={0} excerpts={[
+ done('opening', { startSec: 0, endSec: 72, dependencyState: { status: 'stale' } }),
+ { id: 'failed', status: 'error', error: 'boom', startSec: 0, endSec: 72 },
+ ]} startExcerpt={vi.fn()} />);
+ const list = screen.getByRole('list', { name: 'Current draft and active renders' });
+ expect(list).toHaveTextContent('Made before later changes · re-render this range to see them');
+ expect(screen.getByText('Earlier and failed attempts (1)')).toBeTruthy();
+ });
+
+ it('keeps the newest draft of every range visible, first and above the render form', () => {
+ render(<ExcerptPanel project={documentProject} rendering={false} progress={0} excerpts={[
+ done('opening-old', { startSec: 0, endSec: 72 }), done('opening', { startSec: 0, endSec: 72 }), done('chorus', { startSec: 135, endSec: 196 }),
+ ]} startExcerpt={vi.fn()} />);
+ const list = screen.getByRole('list', { name: 'Current draft and active renders' });
+ // Both ranges stay in view; only the older render of the opening goes to history.
+ expect(within(list).getAllByRole('listitem').map((item) => item.textContent.slice(0, 13))).toEqual(['2:15.0 – 3:16', '0:00.0 – 1:12']);
+ expect(screen.getByText('Earlier and failed attempts (1)')).toBeTruthy();
+ // The renders come before the controls that make a new one.
+ expect(list.compareDocumentPosition(screen.getByRole('button', { name: /Render excerpt/ })) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
+ });
+
it('keeps the review draft visible when a newer social cut renders, and badges both', () => {
render(<ExcerptPanel project={documentProject} rendering={false} progress={0}
excerpts={[done('draft'), done('social', { aspect: '9:16' })]} startExcerpt={vi.fn()} />);
diff --git a/client/src/components/musicVideo/MusicVideoLayout.jsx b/client/src/components/musicVideo/MusicVideoLayout.jsx
index 06837e3fe8..d741a47363 100644
--- a/client/src/components/musicVideo/MusicVideoLayout.jsx
+++ b/client/src/components/musicVideo/MusicVideoLayout.jsx
@@ -13,8 +13,11 @@ const STAGE_ICONS = {
};
// The page's scroll body (the route is full-width, so the page owns its
-// scroll): a new step scrolls it back to the top.
+// scroll): a new step scrolls it back to the top. On a phone the whole page
+// (`MUSIC_VIDEO_PAGE_ID`, title bar included) scrolls instead, so neither
+// header pins down a small screen.
export const MUSIC_VIDEO_SCROLL_ID = 'mv-scroll';
+export const MUSIC_VIDEO_PAGE_ID = 'mv-page';
const TONE_CLASSES = {
warn: 'border-port-warning/40 bg-port-warning/10 text-port-warning',
@@ -77,9 +80,10 @@ function StepRail({ stages, stage, onStageChange, needsYouStage, notes }) {
);
}
-// 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';
+// From `xl` the preview is a sticky right column under the header. Below it,
+// it sits in the page above the step, one folded row until opened, rather than
+// a bar pinned over the content.
+const DOCK_CLASSES = 'min-w-0 max-xl:order-first max-xl:col-span-full 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 says where the project stands
@@ -122,7 +126,7 @@ export default function MusicVideoLayout({
useEffect(() => {
if (shownStage.current === stage) return;
shownStage.current = stage;
- document.getElementById(MUSIC_VIDEO_SCROLL_ID)?.scrollTo?.({ top: 0 });
+ for (const id of [MUSIC_VIDEO_SCROLL_ID, MUSIC_VIDEO_PAGE_ID]) document.getElementById(id)?.scrollTo?.({ top: 0 });
}, [stage]);
const needsYouStage = status?.needsYouStage || null;
@@ -147,10 +151,10 @@ export default function MusicVideoLayout({
const ActionIcon = nextAction?.kind === 'run' ? Play : ArrowRight;
return (
- <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))]'}`}>
+ <div ref={rootRef} className="space-y-3 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 py-2 md:top-[calc(env(safe-area-inset-top)-1.5rem)] md:-mx-6 md:-mt-6 md:px-6"
+ className="z-30 -mx-4 -mt-4 space-y-2 border-b border-port-border bg-port-bg px-4 py-2 md:sticky 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-2">
<div className="min-w-0 flex-1 basis-full sm:basis-auto">
@@ -167,7 +171,7 @@ export default function MusicVideoLayout({
</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}`}>
+ <p role="status" aria-label="Project status" className={`flex min-h-[36px] min-w-0 items-center rounded-lg border px-2.5 text-xs font-medium sm:text-sm ${TONE_CLASSES[status.tone] || TONE_CLASSES.muted}`}>
{status.headline}
</p>
)}
@@ -190,7 +194,8 @@ export default function MusicVideoLayout({
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'}`}
+ // An idle autopilot is one tap away in Project settings; a phone shows the button only for a run.
+ 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'} ${autopilot.label === 'Autopilot' ? 'max-sm:hidden' : ''}`}
>
<Bot size={15} aria-hidden="true" />
<span className="sm:hidden">{autopilot.short || autopilot.label}</span>
@@ -236,8 +241,9 @@ export default function MusicVideoLayout({
</nav>
</header>
- <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)]">
+ {/* One column on a phone, capped at the screen width so a wide control can't push the step off screen. */}
+ <div className={`grid grid-cols-[minmax(0,1fr)] items-start gap-4 md:grid-cols-[13rem_minmax(0,1fr)] ${dockVisible ? 'xl:grid-cols-[13rem_minmax(0,1fr)_minmax(20rem,24rem)]' : ''}`}>
+ <div className="hidden md:block 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. */}
diff --git a/client/src/components/musicVideo/MusicVideoLayout.test.jsx b/client/src/components/musicVideo/MusicVideoLayout.test.jsx
index 718c8dd8c5..9e13b65490 100644
--- a/client/src/components/musicVideo/MusicVideoLayout.test.jsx
+++ b/client/src/components/musicVideo/MusicVideoLayout.test.jsx
@@ -95,6 +95,21 @@ describe('music-video step navigation', () => {
});
});
+describe('phone layout', () => {
+ it('pins neither the header nor the preview below md: the step gets the screen', () => {
+ render(<MusicVideoLayout project={{ id: 'example-project', name: 'Example Project' }} stage="review"
+ onStageChange={() => {}} progress={progressFor('review')} spend={{ spentUsd: 0 }}
+ dock={<aside aria-label="Preview">preview</aside>} />);
+ const header = screen.getByRole('heading', { level: 2, name: 'Example Project' }).closest('header');
+ expect(header.className).toMatch(/(^|\s)md:sticky(\s|$)/);
+ expect(header.className).not.toMatch(/(^|\s)sticky(\s|$)/);
+ const dock = screen.getByRole('complementary', { name: 'Preview' }).parentElement;
+ expect(dock.className).not.toMatch(/fixed/);
+ // Below xl the preview row sits above the step, across the full width.
+ expect(dock.className).toMatch(/max-xl:order-first/);
+ });
+});
+
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;
diff --git a/client/src/components/musicVideo/PreviewDock.jsx b/client/src/components/musicVideo/PreviewDock.jsx
index 9232a4a2f7..86241c62bf 100644
--- a/client/src/components/musicVideo/PreviewDock.jsx
+++ b/client/src/components/musicVideo/PreviewDock.jsx
@@ -39,8 +39,8 @@ function VideoPreview({ source, seekRequest, collapsed }) {
/**
* 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
+ * right-hand column from `xl` up; below it, a folded row above the step that
+ * opens into the player. `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`
@@ -56,10 +56,11 @@ export default function PreviewDock({ project, sources, audioUrl, seekRequest, c
else next.set('play', id);
return next;
}, { replace: true });
- const Chevron = collapsed ? ChevronUp : ChevronDown;
+ // The folded row sits in the page, so it opens downward.
+ const Chevron = collapsed ? ChevronDown : ChevronUp;
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-xl:rounded-b-none">
+ <aside aria-label="Preview" className="space-y-2 rounded-lg border border-port-border bg-port-card p-2">
<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>
@@ -93,7 +94,8 @@ export default function PreviewDock({ project, sources, audioUrl, seekRequest, c
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} />}
+ {/* Folded below xl, the dock is one row: the player and its controls wait for the expand. */}
+ {source?.kind === 'document' && <div className={collapsed ? 'max-xl:hidden' : ''}><CompositionPreviewPlayer project={project} audioUrl={audioUrl} seekRequest={seekRequest} collapsed={collapsed} /></div>}
{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/StageChecklist.jsx b/client/src/components/musicVideo/StageChecklist.jsx
index 97ab5038e8..a14795d244 100644
--- a/client/src/components/musicVideo/StageChecklist.jsx
+++ b/client/src/components/musicVideo/StageChecklist.jsx
@@ -11,20 +11,23 @@ export default function StageChecklist({ items, onAction, onRevert, headerAnchor
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">
+ <section aria-label="What this step 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>
+ <h4 className="text-sm font-medium">What this step 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>
+ {/* A finished step needs no rows: one line names what was done, so the step's own work comes up sooner. */}
+ {done === items.length ? <p className="mt-1 text-xs text-port-text-muted">{items.map((item) => item.label).join(' · ')}</p> : (
<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">
+ // The action wraps under the text on a phone instead of squeezing it into a narrow column.
+ <li key={item.id} className="flex min-w-0 flex-wrap 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={item.stale ? 'approved earlier, stale' : 'to do'} />}
- <div className="min-w-0 flex-1">
+ <div className="min-w-0 flex-1 basis-48">
<span className={item.done ? 'text-port-text-muted' : ''}>{item.label}</span>
{item.stale && <span className="ml-2 rounded bg-port-warning/10 px-1.5 py-0.5 text-xs text-port-warning">done · stale</span>}
{!item.done && item.detail && <p className="break-words text-xs text-port-text-muted">{item.detail}</p>}
@@ -49,7 +52,7 @@ export default function StageChecklist({ items, onAction, onRevert, 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"
+ className="ml-6 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:ml-0 sm:min-h-0"
>
{item.action.label} <ArrowRight size={12} aria-hidden="true" />
</button>
@@ -57,6 +60,7 @@ export default function StageChecklist({ items, onAction, onRevert, headerAnchor
</li>
))}
</ul>
+ )}
</section>
);
}
diff --git a/client/src/components/musicVideo/StageChecklist.test.jsx b/client/src/components/musicVideo/StageChecklist.test.jsx
index 06a0cea04a..051e55609a 100644
--- a/client/src/components/musicVideo/StageChecklist.test.jsx
+++ b/client/src/components/musicVideo/StageChecklist.test.jsx
@@ -21,3 +21,18 @@ describe('StageChecklist Revert buttons (#10241)', () => {
expect(screen.queryByRole('button', { name: /^Revert/ })).toBeNull();
});
});
+
+describe('StageChecklist on a finished step', () => {
+ it('folds the done rows into one line so the step content comes up sooner', () => {
+ render(<StageChecklist items={[{ id: 'a', label: 'Track attached', done: true }, { id: 'b', label: 'Lyric timing verified', done: true }]} />);
+ expect(screen.getByText('All done')).toBeTruthy();
+ expect(screen.getByText('Track attached · Lyric timing verified')).toBeTruthy();
+ expect(screen.queryByRole('list')).toBeNull();
+ });
+
+ it('keeps one row per item while anything is left', () => {
+ render(<StageChecklist items={[{ id: 'a', label: 'Track attached', done: true }, { id: 'b', label: 'Lyric timing verified', done: false, action: { label: 'Verify timing', anchor: 'x' } }]} onAction={vi.fn()} />);
+ expect(screen.getAllByRole('listitem')).toHaveLength(2);
+ expect(screen.getByRole('button', { name: /Verify timing/ })).toBeTruthy();
+ });
+});
diff --git a/client/src/components/musicVideo/StageSection.jsx b/client/src/components/musicVideo/StageSection.jsx
index 253542e7a7..dd933d40cf 100644
--- a/client/src/components/musicVideo/StageSection.jsx
+++ b/client/src/components/musicVideo/StageSection.jsx
@@ -21,7 +21,7 @@ export default function StageSection({ id, title, summary = null, defaultOpen =
<details ref={ref} id={id} open={initialOpen || undefined} className={`group min-w-0 rounded-lg border border-port-border bg-port-card ${className}`}>
<summary className="flex min-h-[44px] cursor-pointer select-none items-center gap-2 px-3 py-2 marker:content-none [&::-webkit-details-marker]:hidden">
<ChevronRight size={14} aria-hidden="true" className="shrink-0 text-port-text-muted transition-transform group-open:rotate-90" />
- <span className="min-w-0 break-words text-sm font-medium">{title}</span>
+ <span className="shrink-0 text-sm font-medium">{title}</span>
{summary && <span className="min-w-0 truncate text-xs text-port-text-muted">{summary}</span>}
</summary>
<div className="min-w-0 space-y-2 px-3 pb-3">{children}</div>
diff --git a/client/src/components/musicVideo/stages/ReviewStage.jsx b/client/src/components/musicVideo/stages/ReviewStage.jsx
index 35d08ca7aa..a50a6e55d3 100644
--- a/client/src/components/musicVideo/stages/ReviewStage.jsx
+++ b/client/src/components/musicVideo/stages/ReviewStage.jsx
@@ -6,60 +6,65 @@ import StageSection from '../StageSection.jsx';
import { isFinalRenderStale } from '../../../lib/musicVideoStages.js';
import { RenderFinalButton } from '../ProjectActionGroups.jsx';
import ReviewDraftPanel from '../ReviewDraftPanel.jsx';
-import { latestMusicVideoReviewDraft } from '../../../../../server/lib/musicVideoReviewDraft.js';
/**
- * 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.
+ * Final render: the full render and its player, and the draft excerpts and
+ * proofs with review notes, section revision and auto-review (they act on the
+ * excerpt window, so they live beside it). Until a final render exists the
+ * drafts and proofs lead, since they are what there is to watch. Dependency
+ * repair closes the step. 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,
} = board;
- const hasDraft = !!latestMusicVideoReviewDraft(project);
+ const finalRender = (
+ <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
+ rendering={renderBound}
+ progress={renderJob.progress}
+ renderHistoryId={project.renderHistoryId}
+ stale={isFinalRenderStale(project)}
+ finalVideo={finalVideo}
+ onOpenPreview={board.openPreview}
+ />
+ {project.renderHistoryId && <SharingCopyPanel key={`${project.id}:${project.renderHistoryId}`} projectId={project.id} />}
+ </section>
+ );
+ // Drafts and proofs are what this step is reviewed by, so they are never folded away.
+ const drafts = (
+ <section aria-label="Drafts and proofs" className="min-w-0 space-y-2">
+ <h4 className="text-sm font-medium">Drafts and proofs</h4>
+ <ExcerptPanel
+ project={project}
+ rendering={excerpts.rendering}
+ occupied={excerpts.occupied}
+ progress={excerpts.progress}
+ activeRenderId={excerpts.activeRenderId}
+ connected={excerpts.connected}
+ excerpts={project.excerpts || []}
+ deletingId={excerpts.deletingId}
+ noteBusyId={excerpts.noteBusyId}
+ startExcerpt={excerpts.startExcerpt}
+ cancelExcerpt={excerpts.cancelExcerpt}
+ deleteExcerpt={excerpts.deleteExcerpt}
+ addNote={excerpts.addNote}
+ editNote={excerpts.editNote}
+ deleteNote={excerpts.deleteNote}
+ revision={{ ...revisions, genScenes: sceneMedia.genScenes, genVideoScenes: sceneMedia.genVideoScenes }}
+ autoReview={autoReview}
+ />
+ </section>
+ );
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} />
- <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
- rendering={renderBound}
- progress={renderJob.progress}
- renderHistoryId={project.renderHistoryId}
- stale={isFinalRenderStale(project)}
- finalVideo={finalVideo}
- onOpenPreview={board.openPreview}
- />
- {project.renderHistoryId && <SharingCopyPanel key={`${project.id}:${project.renderHistoryId}`} projectId={project.id} />}
- </section>
-
- <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}
- occupied={excerpts.occupied}
- progress={excerpts.progress}
- activeRenderId={excerpts.activeRenderId}
- connected={excerpts.connected}
- excerpts={project.excerpts || []}
- deletingId={excerpts.deletingId}
- noteBusyId={excerpts.noteBusyId}
- startExcerpt={excerpts.startExcerpt}
- cancelExcerpt={excerpts.cancelExcerpt}
- deleteExcerpt={excerpts.deleteExcerpt}
- addNote={excerpts.addNote}
- editNote={excerpts.editNote}
- deleteNote={excerpts.deleteNote}
- revision={{ ...revisions, genScenes: sceneMedia.genScenes, genVideoScenes: sceneMedia.genVideoScenes }}
- autoReview={autoReview}
- />
- </StageSection>
-
+ {project.renderHistoryId ? <>{finalRender}{drafts}</> : <>{drafts}{finalRender}</>}
<StageSection title="Dependency changes and repair"><DependencyImpactPanel project={project} busy={revisions.busy} onRepair={revisions.repair} /></StageSection>
</fieldset>
);
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.js
index e560c0d518..88fb43c0be 100644
--- a/client/src/lib/musicVideoStages.js
+++ b/client/src/lib/musicVideoStages.js
@@ -380,7 +380,10 @@ export function deriveNextAction(project, {
// 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;
+ // A document storyboard brings its shots from the authored source, so it has nothing to plan on the board.
+ const draftReview = project.productionReview?.draft || {};
+ const documentShots = draftReview.storyboardSource === 'document' && (draftReview.storyboard || []).length > 0;
+ const boardNeedsOwnAction = !art && board && scenes.length === 0 && !documentShots;
// 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');
@@ -500,6 +503,8 @@ const PUBLISH_ANCHOR = 'mv-publish-kit';
// 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 } },
+ // A document storyboard needs a manifest from its current build; its message mentions timing, so it is matched first.
+ { id: 'manifest', label: 'Document shot manifest', test: /shot manifest/i, action: { label: 'Import the shot manifest', anchor: 'mv-review-planning' } },
{ 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' } },
@@ -668,7 +673,10 @@ export function stepNotes(project, readiness = project?.productionReadiness, pub
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' : '';
+ // Before a final render, the drafts and proofs to watch are what Final render holds.
+ const drafts = (project.excerpts || []).filter((e) => e.status === 'complete' && e.filename).length;
+ const review = isFinalRenderStale(project) ? 'Out of date' : project.renderHistoryId ? 'Rendered'
+ : drafts ? `${formatCount(drafts)} ${drafts === 1 ? 'draft' : 'drafts'} to watch` : '';
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 };
diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.js
index 3baf5f5111..df4bb829ae 100644
--- a/client/src/lib/musicVideoStages.test.js
+++ b/client/src/lib/musicVideoStages.test.js
@@ -438,6 +438,20 @@ describe('stageChecklist', () => {
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('asks for the storyboard review, not a board plan, when a document storyboard brings its own shots', () => {
+ const project = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, ...LYRICS, scenes: [], composition: { mode: 'document', document: { directory: 'd' } },
+ productionReview: { draft: { ...LYRICS.productionReview.draft, storyboardSource: 'document', storyboard: [{ id: 'shot-1' }] } } };
+ const readiness = { ...APPROVED, storyboard: { approved: false, problems: ['Import a shot manifest from the current authored document and master audio.'] }, proof: { approved: false, problems: [] }, readyForProduction: false };
+ expect(deriveNextAction(project, { readiness })).toMatchObject({ id: 'review-production', stage: 'board', anchor: 'mv-review-storyboard' });
+ expect(deriveNextAction({ ...project, productionReview: { draft: LYRICS.productionReview.draft } }, { readiness })).toMatchObject({ id: 'plan' });
+ });
+
+ it('sends a missing document shot manifest to the manifest import, not to lyric timing', () => {
+ const readiness = { ...NOT_APPROVED, storyboard: { approved: false, problems: ['Import a shot manifest from the current authored document and master audio. Reauthor or reimport after source, timing or shot changes.'] } };
+ const items = stageChecklist('board', castProject({ scenes: [scene()] }), readiness);
+ expect(items.find((i) => i.id === 'board-manifest')).toMatchObject({ label: 'Document shot manifest', action: { label: 'Import the shot manifest', anchor: 'mv-review-planning' } });
+ expect(items.some((i) => i.id === 'board-timing')).toBe(false);
+ });
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 };
const setup = (project, readiness) => deriveStages(project, readiness).stages.find((st) => st.id === 'setup').state;
@@ -533,6 +547,8 @@ describe('stepNotes', () => {
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');
+ // Before the final render, Final render says how many drafts and proofs there are to watch.
+ expect(stepNotes({ ...project, excerpts: [{ id: 'a', status: 'complete', filename: 'a.mp4' }, { id: 'b', status: 'complete', filename: 'b.mp4' }, { id: 'c', status: 'error' }] }).review).toBe('2 drafts to watch');
});
});
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index d42b2828af..25ca32a438 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -62,7 +62,7 @@ import CreateProjectDrawer from '../components/musicVideo/CreateProjectDrawer.js
import AutonomousStartDrawer from '../components/musicVideo/AutonomousStartDrawer.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 MusicVideoLayout, { MUSIC_VIDEO_PAGE_ID, MUSIC_VIDEO_SCROLL_ID } from '../components/musicVideo/MusicVideoLayout.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';
@@ -1156,7 +1156,8 @@ export default function MusicVideo() {
const previewSources = selected ? listPreviewSources(selected, { finalVideoSrc: finalVideo.src, liveFirst: activeStage === 'produce' }) : [];
return (
- <div className="flex h-full flex-col">
+ // Below md the whole page scrolls (title bar and project header with it), so the step gets the screen.
+ <div id={MUSIC_VIDEO_PAGE_ID} className="flex h-full flex-col max-md:overflow-auto">
<MidiInstallModal {...midi.installGate} />
<MidiGatedModal {...midi.gatedGate} />
<MediaPreview preview={preview} setPreview={setPreview} items={previewItems} />
@@ -1343,7 +1344,7 @@ export default function MusicVideo() {
}}
/>
- <div id={MUSIC_VIDEO_SCROLL_ID} className="min-h-0 flex-1 overflow-auto p-4 md:p-6">
+ <div id={MUSIC_VIDEO_SCROLL_ID} className="min-h-0 flex-1 p-4 max-md:flex-none md:overflow-auto md:p-6">
{projectsError && !selected && (
<Banner tone="error" size="md" title="Music video projects unavailable" className="mb-4" actions={(
<button
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index 7de732a79f..3793ef996f 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -3004,7 +3004,7 @@ describe('stage checklist and project options', () => {
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' });
+ const checklist = screen.getByRole('region', { name: 'What this step needs' });
expect(checklist).toHaveTextContent('1 of 3 done');
expect(checklist).toHaveTextContent('Pick a Cast & Sets sheet as the visual guide in the art direction editor below.');
expect(checklist).toHaveTextContent('Art direction approved');