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

Make every Music Video item that needs you a button where it is shown

Claude4be4cb02a514
diff --git a/client/src/components/musicVideo/MusicVideoLayout.jsx b/client/src/components/musicVideo/MusicVideoLayout.jsx
index eba68a51c5..75326c8069 100644
--- a/client/src/components/musicVideo/MusicVideoLayout.jsx
+++ b/client/src/components/musicVideo/MusicVideoLayout.jsx
@@ -196,7 +196,12 @@ export default function MusicVideoLayout({
</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-xs font-medium sm:text-sm ${TONE_CLASSES[status.tone] || TONE_CLASSES.muted}`}>
- {status.headline}
+ {/* A step that needs you is one tap away: from any other step, the status opens it. */}
+ {needsYouStage && needsYouStage !== stage ? (
+ <button type="button" onClick={() => onStageChange(needsYouStage)} className="flex min-h-[36px] items-center gap-1 text-left underline-offset-2 hover:underline">
+ {status.headline} <ArrowRight size={12} aria-hidden="true" />
+ </button>
+ ) : status.headline}
</p>
)}
{nextAction && (
diff --git a/client/src/components/musicVideo/NeedsAttentionBanner.jsx b/client/src/components/musicVideo/NeedsAttentionBanner.jsx
index 142d7d3cf5..6086676cfe 100644
--- a/client/src/components/musicVideo/NeedsAttentionBanner.jsx
+++ b/client/src/components/musicVideo/NeedsAttentionBanner.jsx
@@ -2,6 +2,7 @@ import { useState } from 'react';
import { AlertTriangle, ExternalLink, Link2, Play, X } from 'lucide-react';
import { Link } from 'react-router';
import { ATTENTION_ANCHOR_ID } from '../../lib/musicVideoAttention.js';
+import StaleApprovalActions from './StaleApprovalActions.jsx';
const BUTTON = 'inline-flex min-h-[44px] items-center gap-1 rounded border border-port-border px-2.5 text-xs disabled:opacity-50 sm:min-h-0 sm:py-1';
const PRIMARY = `${BUTTON} text-port-accent`;
@@ -84,7 +85,16 @@ function ItemActions({ item, busy, actions }) {
</>
);
case 'stale-approvals':
- return <OpenLink item={item} />;
+ return (
+ <>
+ {(item.approvals || []).map((approval) => (
+ <StaleApprovalActions key={approval.stage} label={approval.label} revertible={approval.revertible} busy={busy}
+ onKeep={approval.canKeep && actions.onKeepApproval ? () => actions.onKeepApproval(approval.stage) : undefined}
+ onRevert={actions.onRevertApproval ? (field) => actions.onRevertApproval(approval.stage, field) : undefined} />
+ ))}
+ <OpenLink item={item} />
+ </>
+ );
default:
return null;
}
@@ -109,7 +119,8 @@ function OpenLink({ item }) {
* are the page's handlers (`onResumeRevision(id)`, `onCancelRevision(id)`,
* `onResumeCastAndSets()`, `onContinueAutoReview(runId)`,
* `onCancelAutoReview(runId)`, `onReattachRender()`, and for the parked-run
- * rows `onResumeAutonomous()` / `onResumeProduction(runId, opts)`). Renders nothing when
+ * rows `onResumeAutonomous()` / `onResumeProduction(runId, opts)`; for stale
+ * approvals `onKeepApproval(stage)` / `onRevertApproval(stage, field)`). Renders nothing when
* there is nothing to attend to.
*/
export default function NeedsAttentionBanner({ items, busy = false, actions = {} }) {
diff --git a/client/src/components/musicVideo/NeedsAttentionBanner.test.jsx b/client/src/components/musicVideo/NeedsAttentionBanner.test.jsx
index 5121e01c21..52dc88e41c 100644
--- a/client/src/components/musicVideo/NeedsAttentionBanner.test.jsx
+++ b/client/src/components/musicVideo/NeedsAttentionBanner.test.jsx
@@ -28,6 +28,25 @@ describe('NeedsAttentionBanner (#9940)', () => {
expect(container).toBeEmptyDOMElement();
});
+ it('settles each stale approval in place: Keep approved, or Revert a kept input', () => {
+ const handlers = { onKeepApproval: vi.fn(), onRevertApproval: vi.fn() };
+ const readiness = {
+ castAndSets: { approved: true, stale: { changedFields: ['style'], revertible: ['style'] } },
+ art: { approved: false, problems: [], stale: { changedFields: ['cast'] } },
+ storyboard: { approved: false, problems: ['Cover the master with timed shots.'], stale: { changedFields: ['concept'], revertible: ['concept'] } },
+ };
+ renderWithRouter(<NeedsAttentionBanner items={deriveAttentionItems({ id: 'mv-example', scenes: [] }, { readiness })} actions={handlers} />);
+ const banner = screen.getByRole('region', { name: 'Needs attention' });
+ fireEvent.click(within(banner).getByRole('button', { name: 'Keep Cast & Sets check-in approved' }));
+ expect(handlers.onKeepApproval).toHaveBeenCalledWith('castAndSets');
+ fireEvent.click(within(banner).getByRole('button', { name: 'Keep Art direction approved' }));
+ expect(handlers.onKeepApproval).toHaveBeenCalledWith('art');
+ // A storyboard with other open problems can't simply be kept; its changed input can still be put back.
+ expect(within(banner).queryByRole('button', { name: 'Keep Timed storyboard approved' })).toBeNull();
+ fireEvent.click(within(banner).getByRole('button', { name: 'Revert concept on Timed storyboard' }));
+ expect(handlers.onRevertApproval).toHaveBeenCalledWith('storyboard', 'concept');
+ });
+
it('offers Resume and Cancel for an open revision, wired to the id the project holds', () => {
const handlers = actions();
renderWithRouter(<NeedsAttentionBanner items={deriveAttentionItems({ ...stranded, status: 'complete', castAndSets: null })} actions={handlers} />);
diff --git a/client/src/components/musicVideo/ProductionReviewPanel.jsx b/client/src/components/musicVideo/ProductionReviewPanel.jsx
index ba40a5859e..fc1364b6aa 100644
--- a/client/src/components/musicVideo/ProductionReviewPanel.jsx
+++ b/client/src/components/musicVideo/ProductionReviewPanel.jsx
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import ProductionReviewContext from './ProductionReviewContext.jsx';
import OverlayTextCheck from './OverlayTextCheck.jsx';
import { formatTimecode } from '../../utils/formatters.js';
-import { ART_DIRECTION_ANCHOR, artDirectionGaps, summarizeStoryboardProblems } from '../../lib/musicVideoStages.js';
+import { ART_DIRECTION_ANCHOR, artDirectionGaps, changeRequestBlocker, openChangeRequests, summarizeStoryboardProblems } from '../../lib/musicVideoStages.js';
const EMPTY = { cast: '', environments: '', visualLanguage: '', motionLanguage: '', guideArtifactId: null,
lyricsMode: 'vocal', timingStatus: 'provisional', timingNotes: '', storyboard: [] };
@@ -55,7 +55,6 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
const [feedback, setFeedback] = useState({ stage, target: '', text: '', decision: 'request-changes' });
const [resolutions, setResolutions] = useState({});
const [importError, setImportError] = useState(null);
- const [revisionNotice, setRevisionNotice] = useState(null);
const [savedRequestStage, setSavedRequestStage] = useState(null);
const [playbackReview, setPlaybackReview] = useState({ ...EMPTY_PLAYBACK, identity: null });
const [startSec, setStartSec] = useState(project.productionReview?.proof?.startSec || 0);
@@ -95,7 +94,12 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
};
// Per-shot storyboard problems arrive one sentence per shot; the card counts them instead (the preview is the review).
- const shownProblems = stage => stage === 'storyboard' ? summarizeStoryboardProblems(ready[stage].problems) : ready[stage].problems || [];
+ // Open change requests are named in one line (and settled from the step's Feedback row), never repeated as problems.
+ const feedbackSentence = /^Resolve (art|storyboard|proof) feedback for /;
+ const shownProblems = stage => {
+ const problems = (ready[stage].problems || []).filter(problem => !feedbackSentence.test(problem));
+ return stage === 'storyboard' ? summarizeStoryboardProblems(problems) : problems;
+ };
// One line under the action buttons saying what approval still needs, or nothing when it can be given.
const approvalHelp = stage => {
if (!ready) return 'Loading…';
@@ -103,8 +107,13 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
if (dirty) return 'Save your planning edits first.';
if (review.busy) return 'Working…';
const problems = shownProblems(stage);
+ const requests = openRequests(stage);
// The storyboard step's checklist already lists each open item with its button, so the card only points there.
- if (stage === 'storyboard' && problems.length) return problems.length > 1 ? `Finish the ${problems.length} open items above first.` : 'Finish the open item above first.';
+ if (stage === 'storyboard' && problems.length) {
+ const open = problems.length + (requests.length ? 1 : 0);
+ return open > 1 ? `Finish the ${open} open items above first.` : 'Finish the open item above first.';
+ }
+ if (requests.length) return changeRequestBlocker(requests);
// With no current proof, the Render button already says what to do; repeating it as a warning reads as required.
if (stage === 'proof' && proofNeedsRender) return null;
if (problems.length) return problems.length > 1 ? `${problems[0]} (+${problems.length - 1} more below)` : problems[0];
@@ -120,7 +129,8 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
const listedProblems = stage => {
if (!ready || ready[stage].approved || stage === 'storyboard' || (stage === 'proof' && proofNeedsRender)) return [];
const problems = shownProblems(stage);
- return dirty || review.busy ? problems : problems.slice(1);
+ // The help line names a change request ahead of any problem, so then every problem is listed here.
+ return dirty || review.busy || openRequests(stage).length ? problems : problems.slice(1);
};
// A link to another step's section crosses steps through the page; within this step it just unfolds the target.
const jump = (tab, anchor) => event => {
@@ -131,33 +141,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
const target = document.getElementById(event.currentTarget.hash.slice(1));
if (target) { target.open = true; target.focus({ preventScroll: true }); }
};
- const openRequests = stage => (project.productionReview?.feedback || []).filter(f => f.stage === stage && f.decision === 'request-changes' && !f.resolvedAt);
- // Mirrors the server's revise routing so an unsupported stage explains itself instead of failing on click.
- const revisionScope = stage => {
- if (stage === 'art') return project.castAndSets?.direction
- ? { action: 'Regenerates the Cast & Sets direction and sheet with these requests. Review the new sheet before approving.' }
- : { unavailable: 'This art direction has no Cast & Sets direction to regenerate. Edit the guide, then resolve each request.' };
- if (stage === 'storyboard') {
- if (documentShots) return { unavailable: 'Document shots come from the authored source. Revise it, reimport its shot manifest, then resolve each request.' };
- return project.scenes?.length
- ? { action: 'Re-plans the shots these requests name (every shot when a request names none) in place, keeping their takes and selected media.' }
- : { unavailable: 'Plan timed Board shots before revising them from feedback.' };
- }
- const mode = project.composition?.mode;
- if (mode === 'code') return { action: 'Regenerates the code composition with these requests. Render a new proof afterwards.' };
- if (mode === 'document') return ['generated', 'template', undefined].includes(project.composition?.document?.source?.kind)
- ? { action: 'Authors a revised composition candidate with these requests. Accept it in Make, then render a new proof.' }
- : { unavailable: 'This composition was imported from its own source. Revise that source and reimport it, then resolve each request.' };
- return { unavailable: 'This proof is assembled from Board footage. Revise the affected storyboard shots or takes, then render a new proof.' };
- };
- const revise = async stage => {
- const result = await review.revise(stage);
- if (!result) return;
- const count = result.revision?.sceneIds?.length;
- setRevisionNotice({ stage, text: stage === 'art' ? 'Cast & Sets is regenerating with these requests. Review the new sheet, then resolve each request.'
- : stage === 'storyboard' ? `Revised ${count} shot${count === 1 ? '' : 's'}. Review them, then resolve each request.`
- : 'A revised composition is ready. Render and review a new proof, then resolve each request.' });
- };
+ const openRequests = stage => openChangeRequests(project, stage);
// Without a current proof the next thing to do is render one, so its controls lead the box.
const proofNeedsRender = !excerpt || ['error', 'canceled'].includes(excerpt.status)
|| (project.productionReview?.proof?.basis && ready?.basis.proof && project.productionReview.proof.basis !== ready.basis.proof);
@@ -262,15 +246,6 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
onCheck={() => review.checkOverlayText()} onSeek={onSeek} />}
{key === 'proof' ? proofContent : <ProductionReviewContext stage={key} project={project} shots={shots} onOpenArtifact={onOpenArtifact} onArtReady={available => setVisibleArt(available ? artIdentity : null)} onSeek={onSeek} />}
</>}
- {openRequests(key).length > 0 && <div role="group" aria-label={`${label} change requests`} className="mt-2 space-y-2 rounded border border-port-warning p-2">
- <p className="text-sm">Resolve these change requests to approve.</p>
- <ul className="list-disc pl-5 text-sm">{openRequests(key).map(item => <li key={item.id} className="break-words"><strong>{item.target}</strong>: {item.text}</li>)}</ul>
- {revisionScope(key).unavailable ? <p className="text-xs text-port-text-muted">{revisionScope(key).unavailable}</p> : <>
- <button type="button" className={buttonClass} disabled={blocked} aria-describedby={fieldId(`${key}-revision-help`)} onClick={() => revise(key)}>Revise from feedback</button>
- <p id={fieldId(`${key}-revision-help`)} className="text-xs text-port-text-muted">{revisionScope(key).action}</p>
- </>}
- {revisionNotice?.stage === key && <p role="status" className="text-sm">{revisionNotice.text}</p>}
- </div>}
</ApprovalBox>
{dirty && <p role="status" className="text-sm">Save your planning edits before approving this revision.</p>}
<details>
@@ -287,7 +262,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
}
}}>Save revision feedback</button>
{savedRequestStage && openRequests(savedRequestStage).length > 0 && <p role="status" className="text-sm">
- Approval stays blocked until these are resolved. <a href={`#mv-review-${savedRequestStage}`} onClick={openReviewSection} className="text-port-accent underline">Revise from feedback</a>, or edit and resolve manually.
+ Approval stays blocked until these are resolved. Revise from feedback or mark each one resolved from the Feedback row at the top of this step.
</p>}
<ul className="mt-3 space-y-3">{(project.productionReview?.feedback || []).filter(item => item.stage === stage).map(item => <li key={item.id} className="rounded border border-port-border p-2">
<p className="text-sm"><strong>{item.target}</strong> · {item.decision} · {item.resolvedAt ? 'Resolved' : 'Open'}</p>
diff --git a/client/src/components/musicVideo/ProductionReviewPanel.test.jsx b/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
index 7de1aa0970..6a06f68b95 100644
--- a/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
+++ b/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
@@ -203,30 +203,18 @@ describe('Production proof playback evidence', () => {
await waitFor(() => expect(screen.getByLabelText('Requested change').value).toBe(''));
});
- it('offers a stage revision for open change requests and explains the blocked approval', async () => {
- const review = { ...reviewFixture(), revise: vi.fn(async () => ({ revision: { stage: 'storyboard', sceneIds: ['scene-a', 'scene-b'] } })) };
+ it('names the open change request that blocks approval in one line, leaving its controls to the step checklist', () => {
+ const review = reviewFixture();
review.readiness.storyboard = { approved: false, problems: ['Resolve storyboard feedback for shot: Chorus: Land the leap on the downbeat'] };
const withRequests = { ...project, scenes: [{ sceneId: 'scene-a', label: 'Chorus', startSec: 0, endSec: 10 }],
productionReview: { ...project.productionReview, feedback: [
{ id: 'fb-open', stage: 'storyboard', target: 'shot: Chorus', text: 'Land the leap on the downbeat', decision: 'request-changes', basis: 'board' },
{ id: 'fb-done', stage: 'storyboard', target: 'shot: Intro', text: 'Already handled', decision: 'request-changes', basis: 'board', resolvedAt: '2026-01-01T00:00:00.000Z' },
- { id: 'fb-proof', stage: 'proof', target: 'frame: 0:04', text: 'Prop lands late', decision: 'request-changes', basis: 'same-creative-basis' },
] } };
- const board = render(<ProductionReviewPanel project={withRequests} review={review} onOpenArtifact={vi.fn()} stage="storyboard" />);
- expect(screen.queryByRole('group', { name: 'Animated proof change requests' })).toBeNull();
- const requests = screen.getByRole('group', { name: 'Lyric-timed storyboard change requests' });
- expect(requests.textContent).toContain('Resolve these change requests to approve.');
- expect(requests.textContent).toContain('Land the leap on the downbeat');
- expect(requests.textContent).not.toContain('Already handled');
- fireEvent.click(within(requests).getByRole('button', { name: 'Revise from feedback' }));
- expect(review.revise).toHaveBeenCalledWith('storyboard');
- await waitFor(() => expect(requests.textContent).toContain('Revised 2 shots. Review them, then resolve each request.'));
- // A document-mode proof with no imported source can be re-authored as a generated candidate.
- board.unmount();
- render(<ProductionReviewPanel project={withRequests} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
- expect(screen.queryByRole('group', { name: 'Lyric-timed storyboard change requests' })).toBeNull();
- const proofRequests = screen.getByRole('group', { name: 'Animated proof change requests' });
- expect(within(proofRequests).getByRole('button', { name: 'Revise from feedback' })).toBeTruthy();
+ render(<ProductionReviewPanel project={withRequests} review={review} onOpenArtifact={vi.fn()} stage="storyboard" />);
+ const box = screen.getByRole('region', { name: 'Approve: Lyric-timed storyboard' });
+ expect(within(box).getByRole('status').textContent).toBe('Resolve the change request on shot: Chorus first.');
+ expect(within(box).queryByRole('button', { name: 'Revise from feedback' })).toBeNull();
});
it('keeps the art approval to one quiet line while there is no direction or guide to review', () => {
@@ -331,7 +319,7 @@ describe('Production proof playback evidence', () => {
describe('Approval problems with unsaved edits', () => {
it.each([
[['Render and watch a current animated chorus proof with the master song.']],
- [['Render and watch a current animated chorus proof with the master song.', 'Resolve proof feedback for chorus: hold longer']],
+ [['Render and watch a current animated chorus proof with the master song.', 'Second problem.']],
])('lists every proof problem while planning edits are unsaved (%j)', (problems) => {
const review = reviewFixture();
review.readiness.proof = { ...review.readiness.proof, approved: false, problems };
@@ -344,11 +332,19 @@ describe('Approval problems with unsaved edits', () => {
for (const problem of problems) expect(screen.getByText(problem)).toBeTruthy();
});
- it('shows the first proof problem once, on the help line, when nothing is unsaved', () => {
+ it('shows the first proof problem once, on the help line, and names an open change request ahead of it', () => {
const review = reviewFixture();
- review.readiness.proof = { ...review.readiness.proof, approved: false, problems: ['Resolve proof feedback for chorus: hold longer', 'Second problem.'] };
- render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
- expect(screen.getAllByText(/Resolve proof feedback for chorus/)).toHaveLength(1);
+ review.readiness.proof = { ...review.readiness.proof, approved: false, problems: ['First problem.', 'Second problem.', 'Resolve proof feedback for chorus: hold longer'] };
+ const { unmount } = render(<ProductionReviewPanel project={project} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
+ expect(screen.getAllByText(/First problem\./)).toHaveLength(1);
+ expect(screen.getByText('Second problem.')).toBeTruthy();
+ expect(screen.queryByText(/hold longer/)).toBeNull();
+ unmount();
+ const withRequest = { ...project, productionReview: { ...project.productionReview, feedback: [
+ { id: 'fb-proof', stage: 'proof', target: 'chorus', text: 'hold longer', decision: 'request-changes', basis: 'same-creative-basis' }] } };
+ render(<ProductionReviewPanel project={withRequest} review={review} onOpenArtifact={vi.fn()} stage="proof" />);
+ expect(screen.getByText('Resolve the change request on chorus first.')).toBeTruthy();
+ expect(screen.getByText('First problem.')).toBeTruthy();
expect(screen.getByText('Second problem.')).toBeTruthy();
});
diff --git a/client/src/components/musicVideo/StageChecklist.jsx b/client/src/components/musicVideo/StageChecklist.jsx
index 1587fe74f2..90b8a69a3d 100644
--- a/client/src/components/musicVideo/StageChecklist.jsx
+++ b/client/src/components/musicVideo/StageChecklist.jsx
@@ -9,6 +9,8 @@ import { ArrowRight, CheckCircle2, Circle } from 'lucide-react';
* quieter `secondary` choice beside it. Run buttons wait while `busy`. A stale
* approval lists a Revert button per changed input whose approved value was kept.
* An `optional` item is listed but never counted toward the step being done.
+ * An item's `notes` (open change requests) each get a Mark resolved button,
+ * which calls `onAction({ run: 'resolve-feedback', feedbackId })`.
*/
export default function StageChecklist({ items, onAction, onRevert, headerAnchor = null, busy = false }) {
if (!items?.length) return null;
@@ -41,6 +43,23 @@ export default function StageChecklist({ items, onAction, onRevert, headerAnchor
{item.details.map((text) => <li key={text} className="break-words">{text}</li>)}
</ul>
)}
+ {/* Open change requests: each note names its target and settles with its own button. */}
+ {!item.done && item.notes?.length > 0 && (
+ <ul aria-label="Open change requests" className="mt-1 space-y-1">
+ {item.notes.map((note) => (
+ <li key={note.id} className="flex min-w-0 flex-wrap items-start gap-x-2 gap-y-1 text-xs">
+ <span className="min-w-0 flex-1 basis-40 break-words"><strong>{note.target}</strong>: {note.text}</span>
+ {onAction && (
+ <button type="button" disabled={busy} aria-label={`Mark resolved: ${note.target}`}
+ onClick={() => onAction({ label: 'Mark resolved', run: 'resolve-feedback', feedbackId: note.id })}
+ className="min-h-[44px] shrink-0 rounded border border-port-border px-2 py-1 text-xs text-port-accent disabled:opacity-50 sm:min-h-0">
+ Mark resolved
+ </button>
+ )}
+ </li>
+ ))}
+ </ul>
+ )}
{!item.done && item.revert && onRevert && (
<div className="mt-1 flex flex-wrap gap-1.5">
{item.revert.fields.map((field) => (
diff --git a/client/src/components/musicVideo/StaleApprovalActions.jsx b/client/src/components/musicVideo/StaleApprovalActions.jsx
index 9ed78e8239..a907e5ceb3 100644
--- a/client/src/components/musicVideo/StaleApprovalActions.jsx
+++ b/client/src/components/musicVideo/StaleApprovalActions.jsx
@@ -5,21 +5,23 @@ const buttonClass = 'flex items-center gap-1 rounded border border-port-border p
/**
* The two ways out of a stale approval, side by side: Keep approved (`onKeep`,
* the approval stands on the current inputs) and a Revert per changed input
- * whose approved value was kept (`revertible` → `onRevert(field)`). Renders
- * nothing when neither applies.
+ * whose approved value was kept (`revertible` → `onRevert(field)`). `label`
+ * names the approval in each button's accessible name, for a surface that lists
+ * several. Renders nothing when neither applies.
*/
-export default function StaleApprovalActions({ revertible, busy = false, onKeep, onRevert, keepTitle = 'Keep this approved on the current inputs' }) {
+export default function StaleApprovalActions({ revertible, busy = false, onKeep, onRevert, label = null, keepTitle = 'Keep this approved on the current inputs' }) {
const reverts = onRevert ? revertible || [] : [];
if (!onKeep && !reverts.length) return null;
return (
<div className="flex flex-wrap gap-2">
{onKeep && (
- <button type="button" disabled={busy} onClick={onKeep} title={keepTitle} className={`${buttonClass} text-port-accent`}>
+ <button type="button" disabled={busy} onClick={onKeep} title={keepTitle} aria-label={label ? `Keep ${label} approved` : undefined} className={`${buttonClass} text-port-accent`}>
<CheckCircle2 size={14} aria-hidden="true" /> Keep approved
</button>
)}
{reverts.map((field) => (
- <button key={field} type="button" disabled={busy} onClick={() => onRevert(field)} title="Put this back to the value you approved" className={buttonClass}>
+ <button key={field} type="button" disabled={busy} onClick={() => onRevert(field)} title="Put this back to the value you approved"
+ aria-label={label ? `Revert ${field} on ${label}` : undefined} className={buttonClass}>
<RotateCcw size={14} aria-hidden="true" /> Revert {field}
</button>
))}
diff --git a/client/src/lib/musicVideoAttention.js b/client/src/lib/musicVideoAttention.js
index fa4df71afc..cd700d0397 100644
--- a/client/src/lib/musicVideoAttention.js
+++ b/client/src/lib/musicVideoAttention.js
@@ -157,9 +157,15 @@ function staleApprovalItem(project, readiness) {
kind: 'stale-approvals',
tone: 'warn',
title: stale.length === 1 ? `${stale[0][1]} was approved earlier and has changed since` : `${stale.length} approvals were given before later changes`,
- detail: `${stale.map(describe).join('. ')}. Re-approve, or undo the change.`,
+ detail: `${stale.map(describe).join('. ')}. Keep the approval, or undo the change.`,
projectId: project.id,
openTo: stale[0][2],
+ // Each approval settles right here: keep it on the current inputs (the Cast & Sets
+ // check-in is re-stamped; a production approval is re-given when nothing else blocks it),
+ // or put back a changed input whose approved value was kept.
+ approvals: stale.map(([key, label]) => ({ stage: key, label,
+ canKeep: key === 'castAndSets' || !(readiness[key].problems || []).length,
+ revertible: readiness[key].stale.revertible || [] })),
};
}
diff --git a/client/src/lib/musicVideoAttention.test.js b/client/src/lib/musicVideoAttention.test.js
index 478b43efb4..4fe093e2cf 100644
--- a/client/src/lib/musicVideoAttention.test.js
+++ b/client/src/lib/musicVideoAttention.test.js
@@ -181,7 +181,7 @@ describe('stale approvals in Needs attention (#10141)', () => {
it('names what changed per approval and opens the earliest one', () => {
const [item] = deriveAttentionItems(project(), { readiness });
expect(item).toMatchObject({ kind: 'stale-approvals', openTo: 'cast-sets', title: '2 approvals were given before later changes' });
- expect(item.detail).toBe('Cast & Sets check-in — changed since: concept. Art direction — changed since: concept, cast, environments +1 more. Re-approve, or undo the change.');
+ expect(item.detail).toBe('Cast & Sets check-in — changed since: concept. Art direction — changed since: concept, cast, environments +1 more. Keep the approval, or undo the change.');
});
it('stays quiet with no stale approval, and while a production run is replacing takes', () => {
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.js
index 4422cd00ec..8c2d1b1f9e 100644
--- a/client/src/lib/musicVideoStages.js
+++ b/client/src/lib/musicVideoStages.js
@@ -566,6 +566,59 @@ export function summarizeStoryboardProblems(problems = []) {
});
}
+// The server names each open change request as a readiness problem; the
+// checklist lists those requests on their own Feedback row instead.
+const FEEDBACK_PROBLEM = /^Resolve (art|storyboard|proof) feedback for /;
+const notFeedback = (text) => !FEEDBACK_PROBLEM.test(text);
+
+/** The open change requests on one approval stage ('art' | 'storyboard' | 'proof'). */
+export const openChangeRequests = (project, stage) => (project?.productionReview?.feedback || [])
+ .filter((f) => f.stage === stage && f.decision === 'request-changes' && !f.resolvedAt);
+
+/**
+ * What "Revise from feedback" does for one stage, mirroring the server's revise
+ * routing: `{ action }` describes the revision, `{ unavailable }` says why
+ * there is none and what to do instead.
+ */
+export function feedbackRevisionScope(project, stage) {
+ if (stage === 'art') return project.castAndSets?.direction
+ ? { action: 'Regenerates the Cast & Sets direction and sheet with these requests. Review the new sheet before approving.' }
+ : { unavailable: 'This art direction has no Cast & Sets direction to regenerate. Edit the guide, then resolve each request.' };
+ if (stage === 'storyboard') {
+ if (project.productionReview?.draft?.storyboardSource === 'document') return { unavailable: 'Document shots come from the authored source. Revise it, reimport its shot manifest, then resolve each request.' };
+ return project.scenes?.length
+ ? { action: 'Re-plans the shots these requests name (every shot when a request names none) in place, keeping their takes and selected media.' }
+ : { unavailable: 'Plan timed Board shots before revising them from feedback.' };
+ }
+ const mode = project.composition?.mode;
+ if (mode === 'code') return { action: 'Regenerates the code composition with these requests. Render a new proof afterwards.' };
+ if (mode === 'document') return ['generated', 'template', undefined].includes(project.composition?.document?.source?.kind)
+ ? { action: 'Authors a revised composition candidate with these requests. Accept it in Make, then render a new proof.' }
+ : { unavailable: 'This composition was imported from its own source. Revise that source and reimport it, then resolve each request.' };
+ return { unavailable: 'This proof is assembled from Board footage. Revise the affected storyboard shots or takes, then render a new proof.' };
+}
+
+/** The line an approval shows while change requests block it: the one note by name, or how many. */
+export function changeRequestBlocker(requests) {
+ if (!requests?.length) return null;
+ return requests.length === 1 ? `Resolve the change request on ${requests[0].target} first.` : `Resolve the ${requests.length} change requests above first.`;
+}
+
+// One Feedback row per stage with open change requests: each note carries its
+// own Mark resolved button, and the row offers Revise from feedback where the
+// stage supports it. An approved stage has nothing left to block.
+function feedbackItem(project, stage, readiness, { optional = false } = {}) {
+ const requests = openChangeRequests(project, stage);
+ if (!requests.length || readiness?.[stage]?.approved) return null;
+ const scope = feedbackRevisionScope(project, stage);
+ return {
+ id: `feedback-${stage}`, label: 'Feedback', done: false, optional,
+ notes: requests.map(({ id, target, text }) => ({ id, target, text })),
+ detail: scope.unavailable || null,
+ action: scope.unavailable ? null : { label: 'Revise from feedback', run: 'revise-feedback', stage, reason: scope.action },
+ };
+}
+
// Storyboard readiness problems, grouped by what the user has to go fix. The
// server returns plain sentences; the first matching rule picks the group.
const STORYBOARD_PROBLEM_GROUPS = [
@@ -581,7 +634,7 @@ const STORYBOARD_PROBLEM_GROUPS = [
/** One open checklist item per group of storyboard readiness problems, per-shot problems counted rather than listed. */
function storyboardProblemItems(readiness) {
- const problems = summarizeStoryboardProblems(readiness?.storyboard?.problems);
+ const problems = summarizeStoryboardProblems(readiness?.storyboard?.problems?.filter(notFeedback));
if (readiness?.storyboard?.approved || !problems.length) return [];
return STORYBOARD_PROBLEM_GROUPS.flatMap((group, index) => {
const earlier = STORYBOARD_PROBLEM_GROUPS.slice(0, index);
@@ -609,10 +662,15 @@ export function stageChecklist(stageId, project, readiness = project?.production
const approval = (key, label, waitingText) => {
const approved = !!readiness?.[key]?.approved;
const stale = staleApprovalText(readiness?.[key]?.stale);
+ // Change requests have their own Feedback row; the approval names the first other blocker, else points there.
+ const blocker = readiness?.[key]?.problems?.find(notFeedback) || changeRequestBlocker(openChangeRequests(project, key));
return {
id: `approve-${key}`, label: `${label} approved`, done: approved, stale: !!stale,
- detail: approved || !readiness ? null : (stale ? `${stale} Re-approve in the editor below.` : readiness[key]?.problems?.[0] || waitingText),
- action: approved ? null : { label: `Review ${label.toLowerCase()}`, anchor: APPROVAL_ANCHORS[key], stage: APPROVAL_STAGES[key] },
+ detail: approved || !readiness ? null : (stale ? `${stale} Re-approve in the editor below.` : blocker || waitingText),
+ // A stale approval with nothing else blocking it can be kept as is, right from the row.
+ ...(stale && !approved && !blocker && key !== 'proof'
+ ? { action: { label: 'Keep approved', run: 'keep-approval', stage: key }, secondary: { label: `Review ${label.toLowerCase()}`, anchor: APPROVAL_ANCHORS[key], stage: APPROVAL_STAGES[key] } }
+ : { action: approved ? null : { label: `Review ${label.toLowerCase()}`, anchor: APPROVAL_ANCHORS[key], stage: APPROVAL_STAGES[key] } }),
// Inputs whose approved value the server kept: each gets a Revert button.
revert: !approved && stale && readiness[key].stale.revertible?.length ? { stage: key, fields: readiness[key].stale.revertible } : null,
};
@@ -683,12 +741,14 @@ export function stageChecklist(stageId, project, readiness = project?.production
return [
{ id: 'direction', label: 'Art direction written', done: missing.length === 0, ...direction },
{ id: 'guide', label: guide ? `Visual guide chosen: ${guide.title || guide.filename || 'sheet'}` : 'Visual guide chosen', done: !!guide, ...guideRow },
+ feedbackItem(project, 'art', readiness),
waiting ? { ...approve, detail: 'Opens once the art direction is written and a guide is chosen.', action: null } : approve,
- ];
+ ].filter(Boolean);
}
case 'board': {
const planned = scenes.length > 0 || (draft.storyboard || []).length > 0;
- const problems = storyboardProblemItems(readiness);
+ const feedback = feedbackItem(project, 'storyboard', readiness);
+ const problems = [...storyboardProblemItems(readiness), ...(feedback ? [feedback] : [])];
const storyboardApproval = approval('storyboard', 'Timed storyboard', 'Ready for your review below.');
return [
{ id: 'shots', label: 'Shots planned', done: planned, detail: planned ? null : 'Plan the shots from the header, or add scenes by hand.',
@@ -726,7 +786,8 @@ export function stageChecklist(stageId, project, readiness = project?.production
detail: done ? null : 'Generate the code video from the Code Video panel.',
action: done ? null : { label: 'Open Code Video', anchor: 'mv-code-section' } };
}
- return [...items, ...(work ? [work] : []), proof];
+ const proofFeedback = feedbackItem(project, 'proof', readiness, { optional: true });
+ return [...items, ...(work ? [work] : []), ...(proofFeedback ? [proofFeedback] : []), proof];
}
case 'review':
return [{
diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.js
index 38b16d9a91..e78823d1ef 100644
--- a/client/src/lib/musicVideoStages.test.js
+++ b/client/src/lib/musicVideoStages.test.js
@@ -492,6 +492,16 @@ describe('stageChecklist', () => {
const stale = { ...readiness, storyboard: { approved: false, problems: ['Review and approve the current art direction first.'], stale: { changedFields: ['art direction', 'cast'] } } };
expect(stageChecklist('board', castProject({ scenes: [scene()] }), stale).at(-1).detail).toMatch(/changed since: art direction, cast/);
});
+ it('offers Keep approved on a stale approval nothing else blocks, and files feedback on its own row', () => {
+ const feedback = [{ id: 'fb-1', stage: 'storyboard', target: 'Chorus', text: 'More lyrics on screen', decision: 'request-changes' }];
+ const stale = { ...NOT_APPROVED, storyboard: { approved: false, problems: [], stale: { changedFields: ['cast'] } } };
+ expect(stageChecklist('board', castProject({ scenes: [scene()] }), stale).at(-1).action).toEqual({ label: 'Keep approved', run: 'keep-approval', stage: 'storyboard' });
+ const blocked = { ...NOT_APPROVED, storyboard: { approved: false, problems: ['Resolve storyboard feedback for Chorus: More lyrics on screen'], stale: { changedFields: ['cast'] } } };
+ const items = stageChecklist('board', castProject({ scenes: [scene()], productionReview: { feedback } }), blocked);
+ expect(items.map((i) => i.id)).toEqual(['shots', 'feedback-storyboard', 'approve-storyboard']);
+ expect(items[1]).toMatchObject({ label: 'Feedback', notes: [{ id: 'fb-1', target: 'Chorus', text: 'More lyrics on screen' }], action: { run: 'revise-feedback', stage: 'storyboard' } });
+ expect(items.at(-1).action.run).toBeUndefined();
+ });
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;
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 191892b4bc..b1a17e98c8 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -90,7 +90,7 @@ import { isLtx2FamilyRuntime } from '../lib/runnerFamilies';
import { videoPosterForJob } from '../lib/creativeDirectorPreview.js';
import { sceneTakeList } from '../lib/musicVideoTakes.js';
import { pluralize } from '../lib/textUtils.js';
-import { formatTimecode } from '../utils/formatters.js';
+import { formatCount, formatTimecode } from '../utils/formatters.js';
import { deriveAttentionItems } from '../lib/musicVideoAttention.js';
import { latestMusicVideoReviewDraft } from '../../../server/lib/musicVideoReviewDraft.js';
import { useMusicVideoReviewDraft } from '../hooks/useMusicVideoReviewDraft.js';
@@ -1123,10 +1123,25 @@ export default function MusicVideo() {
// A checklist row either jumps to the control that settles it or, for work
// the page can start itself (build or resume the cast & sets, fill the art
// direction from an approved sheet), starts it.
+ // Revising re-plans or regenerates in place; the requests stay open until the director resolves each one.
+ const reviseFromFeedback = async (stage) => {
+ const result = await productionReview.revise(stage);
+ if (!result) return;
+ const count = result.revision?.sceneIds?.length;
+ toast.success(stage === 'art' ? 'Cast & Sets is regenerating with these requests. Review the new sheet, then resolve each request.'
+ : stage === 'storyboard' ? `Revised ${formatCount(count)} shot${count === 1 ? '' : 's'}. Review them, then resolve each request.`
+ : 'A revised composition is ready. Render and review a new proof, then resolve each request.');
+ };
+ // "Keep approved" on a stale approval: the Cast & Sets check-in is re-stamped on its
+ // current inputs; a production approval is given again on the current revision.
+ const keepApproval = (stage) => (stage === 'castAndSets' ? castSets.reconfirm() : productionReview.approve(stage));
const runChecklistAction = (action) => {
if (action.run === 'start-cast-sets') { castSets.start(); return; }
if (action.run === 'resume-cast-sets') { castSets.resume(); return; }
if (action.run === 'prepare-art') { productionReview.prepare(); return; }
+ if (action.run === 'resolve-feedback') { productionReview.resolveFeedback(action.feedbackId, ''); return; }
+ if (action.run === 'revise-feedback') { reviseFromFeedback(action.stage); return; }
+ if (action.run === 'keep-approval') { keepApproval(action.stage); return; }
goToStage(action.stage || activeStage, action.anchor, action.params);
};
const runNextAction = () => {
@@ -1558,6 +1573,8 @@ export default function MusicVideo() {
onReattachRender: () => renderJob.reattach(selected.id),
onResumeAutonomous: () => autonomous.resume(),
onResumeProduction: (runId, opts) => production.resume(runId, opts),
+ onKeepApproval: keepApproval,
+ onRevertApproval: productionReview.revert,
}}
/>
)}
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index dd8c1a0c08..d34f69c568 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -38,7 +38,9 @@ const { sseState, ytSseStates, getYtSseState } = vi.hoisted(() => {
// This page suite exercises existing controls with production approvals already granted.
// ProductionReviewPanel and route integration suites exercise the real approval refusals.
+const feedbackCalls = vi.hoisted(() => ({ resolveFeedback: vi.fn(async () => null), revise: vi.fn(async () => ({ revision: { sceneIds: ['s-a'] } })) }));
vi.mock('../hooks/useMusicVideoProductionReview.js', () => ({ default: ({ project }) => ({
+ ...feedbackCalls,
readiness: project?.productionReadiness || { readyForProduction: true, basis: {}, art: { approved: true, problems: [] }, storyboard: { approved: true, problems: [] }, proof: { approved: true, problems: [] } },
busy: false, error: null, proof: { active: false }, save: vi.fn(), prepare: vi.fn(), approve: vi.fn(), renderProof: vi.fn(),
}) }));
@@ -3162,6 +3164,25 @@ describe('stage checklist and project options', () => {
expect(within(document.getElementById('mv-look-guides')).getByRole('button', { name: 'Use Cast sheet as visual guide' })).toBeInTheDocument();
});
+ it('lists open storyboard feedback on its own Feedback row, settled with buttons there, never under Lyrics', async () => {
+ const note = { id: 'fb-a', stage: 'storyboard', target: 'Chorus', text: 'Put the lyrics on the wall, not the screen', decision: 'request-changes', basis: 'board' };
+ const project = { ...PROJECT_ANALYZED, scenes: [{ sceneId: 's-a', label: 'Chorus', startSec: 0, endSec: 4 }],
+ productionReview: { draft: { storyboard: [] }, feedback: [note] },
+ productionReadiness: { readyForProduction: false, basis: { storyboard: 'board' }, art: { approved: true, problems: [] },
+ storyboard: { approved: false, problems: [`Resolve storyboard feedback for ${note.target}: ${note.text}`] }, proof: { approved: false, problems: [] } } };
+ await openProject(project, 'board');
+ const checklist = screen.getByRole('region', { name: 'What this step needs' });
+ expect(within(checklist).queryByText('Lyrics')).toBeNull();
+ expect(within(checklist).queryByRole('button', { name: /Import lyrics/ })).toBeNull();
+ const requests = within(checklist).getByRole('list', { name: 'Open change requests' });
+ expect(requests).toHaveTextContent('Chorus: Put the lyrics on the wall, not the screen');
+ expect(screen.getByRole('region', { name: 'Approve: Lyric-timed storyboard' })).toHaveTextContent('Resolve the change request on Chorus first.');
+ fireEvent.click(within(checklist).getByRole('button', { name: /Revise from feedback/ }));
+ await waitFor(() => expect(feedbackCalls.revise).toHaveBeenCalledWith('storyboard'));
+ fireEvent.click(within(requests).getByRole('button', { name: 'Mark resolved: Chorus' }));
+ expect(feedbackCalls.resolveFeedback).toHaveBeenCalledWith('fb-a', '');
+ });
+
it('builds the cast & sets from the Look checklist when nothing is written yet', async () => {
const project = { ...PROJECT_ANALYZED, scenes: [], castAndSets: undefined, devArtifacts: [],
productionReadiness: { readyForProduction: false, basis: {}, art: { approved: false, problems: ['Cast guide needs editable direction.'] },