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

Open end frames full size; Render a new clip from the render refusal (#11610)

[._.]/107242d301b2
diff --git a/client/src/components/musicVideo/CompositionPanel.jsx b/client/src/components/musicVideo/CompositionPanel.jsx
index ed0638fef8..ac83f75172 100644
--- a/client/src/components/musicVideo/CompositionPanel.jsx
+++ b/client/src/components/musicVideo/CompositionPanel.jsx
@@ -19,7 +19,7 @@ export default function CompositionPanel({ board }) {
const mode = project.composition?.mode;
return (
<fieldset disabled={locked} className="min-w-0">
- <RenderFailure project={project} renderJob={board.renderJob} onPatchShots={board.onPatchShots} />
+ <RenderFailure project={project} renderJob={board.renderJob} onPatchShots={board.onPatchShots} onRenderClips={board.onRenderClips} />
<div className="space-y-2 rounded-lg border border-port-border bg-port-card p-3">
<div className="flex flex-wrap items-center gap-2 text-xs text-port-text-muted">
<span>Render style: <span className="text-port-text">{renderStyleLabel(mode)}</span></span>
diff --git a/client/src/components/musicVideo/RenderStatusPanel.jsx b/client/src/components/musicVideo/RenderStatusPanel.jsx
index 8d87ff91eb..7a277a2f65 100644
--- a/client/src/components/musicVideo/RenderStatusPanel.jsx
+++ b/client/src/components/musicVideo/RenderStatusPanel.jsx
@@ -105,6 +105,10 @@ function refusalFix(failure) {
return ids.length ? { ids, patch: { shotMode: 'cutaway' }, label: `Switch ${plural(ids, 'it', `these ${ids.length}`)} to Cutaway`,
done: `Switched ${ids.length} shot${plural(ids, '', 's')} to Cutaway` } : null;
}
+ if (failure?.code === 'STALE_CLIP_DEPENDENCIES') {
+ const ids = failure.context?.sceneIds || [];
+ return ids.length ? { ids, render: true, label: plural(ids, 'Render a new clip', `Render ${ids.length} new clips`) } : null;
+ }
if (failure?.code === 'INSUFFICIENT_CLIP_COVERAGE') {
const ids = (failure.context?.shortfalls || []).map((entry) => entry.sceneId);
return ids.length ? { ids, patch: { holdLastFrame: true }, label: `Hold the last frame on ${plural(ids, 'it', `these ${ids.length}`)}`,
@@ -115,18 +119,21 @@ function refusalFix(failure) {
/**
* Persisted failures survive reload; kickoff/SSE failures stay bound to their project.
- * A refusal with a one-tap fix offers it: `onPatchShots(sceneIds, patch, doneMessage)`.
+ * A refusal with a one-tap fix offers it: `onPatchShots(sceneIds, patch, doneMessage)`,
+ * or for clips made from since-changed frames `onRenderClips(sceneIds)`, which renders
+ * each shot's clip again from its current frames and the video settings.
*/
-export function RenderFailure({ project, renderJob, onPatchShots }) {
+export function RenderFailure({ project, renderJob, onPatchShots, onRenderClips }) {
const [fixing, setFixing] = useState(false);
if (renderJob?.active && renderJob.context === project.id) return null;
const failure = renderJob?.failure?.projectId === project.id ? renderJob.failure : null;
const error = failure ? failure.message : project.status === 'failed' ? project.renderError : null;
if (!error) return null;
- const fix = onPatchShots ? refusalFix(failure) : null;
+ const offered = refusalFix(failure);
+ const fix = offered && (offered.render ? onRenderClips : onPatchShots) ? offered : null;
const apply = () => {
setFixing(true);
- Promise.resolve(onPatchShots(fix.ids, fix.patch, fix.done)).finally(() => setFixing(false));
+ Promise.resolve(fix.render ? onRenderClips(fix.ids) : onPatchShots(fix.ids, fix.patch, fix.done)).finally(() => setFixing(false));
};
return (
<Banner tone="error" title="Render failed" className="break-words">
@@ -134,7 +141,7 @@ export function RenderFailure({ project, renderJob, onPatchShots }) {
{fix && (
<button type="button" onClick={apply} disabled={fixing}
className="mt-2 block min-h-[44px] sm:min-h-0 rounded border border-port-border bg-port-bg px-2 py-1 text-xs text-port-text hover:bg-port-border/40 disabled:opacity-50">
- {fixing ? 'Saving…' : fix.label}
+ {fixing ? (fix.render ? 'Starting…' : 'Saving…') : fix.label}
</button>
)}
</Banner>
diff --git a/client/src/components/musicVideo/RenderStatusPanel.test.jsx b/client/src/components/musicVideo/RenderStatusPanel.test.jsx
index fc758725e5..e940f2f7a3 100644
--- a/client/src/components/musicVideo/RenderStatusPanel.test.jsx
+++ b/client/src/components/musicVideo/RenderStatusPanel.test.jsx
@@ -21,7 +21,7 @@ it('shows an amber out-of-date notice only when the final render is stale (#1014
expect(screen.queryByRole('status')).not.toBeInTheDocument();
});
-// Uniquely catches a refusal's one-tap fix patching a shot it cannot fix, or a fix offered where none exists.
+// Uniquely catches a refusal's one-tap fix acting on a shot it cannot fix, or a fix offered where none exists.
it('offers one tap that fixes the shots a render refusal names', async () => {
const project = { id: 'mv-example', status: 'ready' };
const onPatchShots = vi.fn(async () => {});
@@ -34,6 +34,12 @@ it('offers one tap that fixes the shots a render refusal names', async () => {
context: { shortfalls: [{ sceneId: 'd', shortBySec: 0.58 }] } } }} onPatchShots={onPatchShots} />);
await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Hold the last frame on it' })); });
expect(onPatchShots).toHaveBeenLastCalledWith(['d'], { holdLastFrame: true }, 'Holding the last frame on 1 shot');
+ const onRenderClips = vi.fn(async () => {});
+ rerender(<RenderFailure project={project} renderJob={{ failure: { projectId: project.id, code: 'STALE_CLIP_DEPENDENCIES', message: 'Shot 8: the clip was made from frames that have since changed. …',
+ context: { sceneIds: ['e'] } } }} onPatchShots={onPatchShots} onRenderClips={onRenderClips} />);
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Render a new clip' })); });
+ expect(onRenderClips).toHaveBeenCalledWith(['e']);
+ expect(onPatchShots).toHaveBeenCalledTimes(2);
rerender(<RenderFailure project={project} renderJob={{ failure: { ...failure, code: 'MISSING_CLIPS' } }} onPatchShots={onPatchShots} />);
expect(screen.queryByRole('button')).not.toBeInTheDocument();
});
diff --git a/client/src/components/musicVideo/stages/ReviewStage.jsx b/client/src/components/musicVideo/stages/ReviewStage.jsx
index e4ea6e4adb..1620bff4f8 100644
--- a/client/src/components/musicVideo/stages/ReviewStage.jsx
+++ b/client/src/components/musicVideo/stages/ReviewStage.jsx
@@ -72,7 +72,7 @@ export default function ReviewStage({ board }) {
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} onPatchShots={board.onPatchShots} />
+ <RenderFailure project={project} renderJob={renderJob} onPatchShots={board.onPatchShots} onRenderClips={board.onRenderClips} />
{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/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 94baf295d7..678a692e58 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -789,6 +789,25 @@ export default function MusicVideo() {
});
};
+ // A render refused for clips made from since-changed frames: render each shot's clip
+ // again from its current frames and the video settings, as Render on its card would.
+ // Like the card's Render, a shot whose still isn't locked yet is refused by name.
+ const renderClips = (sceneIds) => {
+ const timed = (selected?.scenes || []).filter((scene) => Number.isFinite(scene.startSec)).sort((a, b) => a.startSec - b.startSec);
+ const shotName = (scene) => `Shot ${timed.indexOf(scene) + 1}`;
+ const requested = (selected?.scenes || []).filter((scene) => sceneIds.includes(scene.sceneId));
+ const unlocked = shotLocks ? requested.filter((scene) => shotLocks[scene.sceneId] !== 'locked') : [];
+ if (unlocked.length) toast.error(`${unlocked.map(shotName).join(', ')}: lock the still first, then render the new clip`);
+ const scenes = requested.filter((scene) => !unlocked.includes(scene));
+ if (!scenes.length) return Promise.resolve();
+ return Promise.all(scenes.map((scene) => sceneMedia.generateSceneVideo(scene))).then((results) => {
+ const started = results.filter((result) => result?.ok).length;
+ if (!started) return;
+ renderJob.clearFailure();
+ toast.success(`Rendering ${started === 1 ? 'a new clip' : `${started} new clips`}. Render again once ${started === 1 ? 'it lands' : 'they land'}`);
+ });
+ };
+
// Optimistic local edit; PATCH on blur (silent — this owns its error toast).
const editSceneLocal = (sceneId, patch) => {
replaceProject({ ...selected, scenes: selected.scenes.map((s) => (s.sceneId === sceneId ? { ...s, ...patch } : s)) });
@@ -1047,7 +1066,7 @@ export default function MusicVideo() {
`Music Video: ${selected.name}`,
));
}
- // Every take (#8965), selected first, so the take strips and contact sheet
+ // Every take (#8965), start and end frames included, selected first, so the take strips and contact sheet
// can open any candidate in the shared lightbox.
for (const scene of selected.scenes || []) {
const frames = sceneTakeList(scene, 'image')
@@ -1055,6 +1074,11 @@ export default function MusicVideo() {
for (const take of frames) {
items.push(normalizeImage({ filename: take.assetId, prompt: take.prompt || scene.framePrompt || scene.prompt || '' }));
}
+ const endFrames = sceneTakeList(scene, 'endImage')
+ .sort((a, b) => (b.assetId === scene.endImageId) - (a.assetId === scene.endImageId));
+ for (const take of endFrames) {
+ items.push(normalizeImage({ filename: take.assetId, prompt: take.prompt || scene.endFramePrompt || scene.prompt || '' }));
+ }
const clips = sceneTakeList(scene, 'video')
.sort((a, b) => (b.assetId === scene.videoHistoryId) - (a.assetId === scene.videoHistoryId));
for (const take of clips) {
@@ -1280,6 +1304,7 @@ export default function MusicVideo() {
sceneMedia,
renderJob,
onPatchShots: patchShots,
+ onRenderClips: renderClips,
production,
castSets,
devArtifacts,
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index e7117c33c0..170cba1d69 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -2386,6 +2386,13 @@ describe('MusicVideo media lightbox (#3718)', () => {
.toMatch(/\/data\/images\/img1/);
});
+ it('opens the lightbox from an end-frame thumbnail click', async () => {
+ await openProject({ ...PROJECT_WITH_CLIP, scenes: [{ ...PROJECT_WITH_CLIP.scenes[0], endImageId: 'end1' }] }, 'produce');
+ fireEvent.click(await screen.findByRole('button', { name: 'View scene 1 end frame full size' }));
+ const dialog = await screen.findByRole('dialog', { name: /Media viewer/i });
+ expect(dialog.querySelector('img')?.getAttribute('src') || dialog.innerHTML).toMatch(/\/data\/images\/end1/);
+ });
+
it('opens the lightbox from a scene-clip expand control without hijacking play/pause', async () => {
await openProject(PROJECT_WITH_CLIP, 'produce');
// Inline thumb keeps its own controls attribute for native play/pause.