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

Code Animation: hold coded writing for a film too long to record

Claude353ed2a6ebd2
diff --git a/client/src/components/music/CodePanel.jsx b/client/src/components/music/CodePanel.jsx
index fc62654194..10d68efbf4 100644
--- a/client/src/components/music/CodePanel.jsx
+++ b/client/src/components/music/CodePanel.jsx
@@ -232,7 +232,7 @@ export default function CodePanel({
const sentPreview = useModelInputPreview(previewMusicCode, {
description: description.trim(), lyrics: lyrics.trim(), scene, guidance, language,
...(fixedLengthSec ? { durationSec: fixedLengthSec } : {}),
- }, { enabled: !!brief });
+ }, { enabled: !!brief && !filmTooLong });
return (
<div className="space-y-4">
@@ -295,12 +295,12 @@ export default function CodePanel({
</div>
<div className="flex flex-wrap gap-2">
- <button type="button" onClick={() => write('fresh')} disabled={disabled || busy || !brief} className={hasCode ? GHOST_BTN : PRIMARY_BTN}>
+ <button type="button" onClick={() => write('fresh')} disabled={disabled || busy || !brief || filmTooLong} className={hasCode ? GHOST_BTN : PRIMARY_BTN}>
{writing === 'fresh' ? <Loader2 className="h-4 w-4 animate-spin" /> : <Code2 className="h-4 w-4" />}
<span>{writing === 'fresh' ? 'Writing…' : hasCode ? 'Write from scratch' : 'Write the code'}</span>
</button>
{hasCode && (
- <button type="button" onClick={() => write('revise')} disabled={disabled || busy || !brief} className={PRIMARY_BTN}>
+ <button type="button" onClick={() => write('revise')} disabled={disabled || busy || !brief || filmTooLong} className={PRIMARY_BTN}>
{writing === 'revise' ? <Loader2 className="h-4 w-4 animate-spin" /> : <Wand2 className="h-4 w-4" />}
<span>{writing === 'revise' ? 'Revising…' : 'Revise code'}</span>
</button>
diff --git a/client/src/components/music/CodePanel.test.jsx b/client/src/components/music/CodePanel.test.jsx
index d47a775b27..e6d1e85d8b 100644
--- a/client/src/components/music/CodePanel.test.jsx
+++ b/client/src/components/music/CodePanel.test.jsx
@@ -192,6 +192,7 @@ describe('<CodePanel>', () => {
await mountReady({ trackId: null, draftKey: 'job-2', resolveTrackId: vi.fn(), scene: 'Long film', fixedLengthSec: 150 });
expect(screen.getByRole('alert').textContent).toContain('The film is 150s; coded audio renders at most 120s');
expect(screen.getByRole('button', { name: /Save as take/ })).toBeDisabled();
+ expect(screen.getByRole('button', { name: /Write from scratch/ })).toBeDisabled();
});
it('lets Stop cancel a recording that is waiting on the audio unlock', async () => {