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

feat: add rename for music videos and hide New project/Autonomous inside a project

[._.]/ Adam Eivy4324d4deabed
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 1d79484d2d..9b1a6c3e21 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -2,7 +2,7 @@ import ProductionReviewPanel from '../components/musicVideo/ProductionReviewPane
import useMusicVideoProductionReview from '../hooks/useMusicVideoProductionReview.js';
import { useEffect, useState, useCallback, useMemo, useRef } from 'react';
import { useParams, useNavigate, useSearchParams, useLocation } from 'react-router';
-import { Plus, Film, Copy, Trash2, Wand2 } from 'lucide-react';
+import { Plus, Film, Copy, Trash2, Wand2, Pencil } from 'lucide-react';
import toast from '../components/ui/Toast';
import ConfirmButtonPair from '../components/ui/ConfirmButtonPair';
import { useConfirmDelete } from '../hooks/useConfirmDelete';
@@ -157,6 +157,23 @@ export default function MusicVideo() {
// unknown one) the tab is the stage the project was in when it was opened,
// pinned so a stage completing mid-session doesn't move the user off the tab
// they are working in — the header's next action tracks the project instead.
+ const handleRename = () => {
+ if (!selected) return;
+ setRenameDraft(selected.name || '');
+ setRenamingId(selected.id);
+ };
+ const commitRename = () => {
+ const name = renameDraft.trim();
+ if (!selected || !name || name === selected.name) { setRenamingId(null); return; }
+ const projectId = selected.id;
+ updateMusicVideoProject(projectId, { name })
+ .then((saved) => { patchProject(projectId, { name: saved?.name ?? name, updatedAt: saved?.updatedAt }); setRenamingId(null); })
+ .catch(() => {});
+ };
+ // Holds the id being renamed so the form closes itself when another project opens.
+ const [renamingId, setRenamingId] = useState(null);
+ const renaming = !!selected && renamingId === selected.id;
+ const [renameDraft, setRenameDraft] = useState('');
const replaceProject = (next) => setProjects((prev) => prev.map((p) => (p.id === next.id ? next : p)));
const productionReview = useMusicVideoProductionReview({ project: selected, replaceProject });
const progress = useMemo(() => deriveStages(selected, productionReview.readiness), [selected, productionReview.readiness]);
@@ -1000,6 +1017,15 @@ export default function MusicVideo() {
)}
{selected && (
<span className="flex flex-wrap items-center gap-1">
+ <button
+ type="button"
+ onClick={handleRename}
+ title="Rename project"
+ aria-label="Rename project"
+ className="flex min-h-[44px] min-w-[44px] items-center justify-center rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm sm:min-h-0 sm:min-w-0"
+ >
+ <Pencil size={15} />
+ </button>
<button
type="button"
onClick={() => handleClone()}
@@ -1040,6 +1066,8 @@ export default function MusicVideo() {
)}
</span>
)}
+ {!selected && (
+ <>
<button
type="button"
onClick={() => setAutonomousOpen(true)}
@@ -1055,9 +1083,30 @@ export default function MusicVideo() {
>
<Plus size={15} /> New project
</button>
+ </>
+ )}
</>
)}
/>
+ {renaming && (
+ <form
+ onSubmit={(e) => { e.preventDefault(); commitRename(); }}
+ className="flex flex-wrap items-center gap-2 px-4 py-2 border-b border-port-border"
+ >
+ <label htmlFor="mv-rename-input" className="text-sm text-gray-400">Project title</label>
+ <input
+ id="mv-rename-input"
+ autoFocus
+ value={renameDraft}
+ maxLength={120}
+ onChange={(e) => setRenameDraft(e.target.value)}
+ onKeyDown={(e) => { if (e.key === 'Escape') setRenamingId(null); }}
+ className="min-w-0 flex-1 sm:max-w-md bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm"
+ />
+ <button type="submit" disabled={!renameDraft.trim()} className="rounded bg-port-accent px-3 py-1.5 text-sm text-white disabled:opacity-50 min-h-[44px] sm:min-h-0">Save</button>
+ <button type="button" onClick={() => setRenamingId(null)} className="rounded border border-port-border px-3 py-1.5 text-sm min-h-[44px] sm:min-h-0">Cancel</button>
+ </form>
+ )}
<CreateProjectDrawer
open={createOpen}
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index a5fad124f9..f89281b5dd 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -320,8 +320,26 @@ const openProject = async (project, stage = null) => {
if (stage) await openStage(stage);
};
-const openCreateForm = async () => {
+// The header hides New project / Autonomous while a project is open, so step
+// back to the project list via the picker first.
+const clickNewProject = async () => {
+ const picker = screen.getByLabelText('Project');
+ const previous = picker.value;
+ if (!screen.queryByRole('button', { name: /New project/i })) {
+ fireEvent.change(picker, { target: { value: '' } });
+ }
fireEvent.click(await screen.findByRole('button', { name: /New project/i }));
+ // Keep the drawer open and return to the project the test was on.
+ if (previous) fireEvent.change(picker, { target: { value: previous } });
+};
+
+const openCreateForm = clickNewProject;
+
+// Mocked useSseProgress mutates shared state without re-rendering; toggling the
+// rename form is a harmless page-level state change that forces a render.
+const forceRerender = () => {
+ fireEvent.click(screen.getByRole('button', { name: 'Rename project' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }));
};
// Probes/harness for the URL-nav backstop test: a location readout plus a
@@ -409,6 +427,19 @@ describe('MusicVideo project load recovery (#9761)', () => {
});
});
+describe('MusicVideo project header', () => {
+ it('hides New project / Autonomous inside a project and renames it from the header', async () => {
+ await openProject(PROJECT_WITH_CLIP);
+ expect(screen.queryByRole('button', { name: /New project/i })).toBeNull();
+ expect(screen.queryByRole('button', { name: /Autonomous/i })).toBeNull();
+ fireEvent.click(screen.getByRole('button', { name: 'Rename project' }));
+ fireEvent.change(screen.getByLabelText('Project title'), { target: { value: 'Renamed Video' } });
+ fireEvent.click(screen.getByRole('button', { name: 'Save' }));
+ await waitFor(() => expect(updateMusicVideoProject).toHaveBeenCalledWith(PROJECT_WITH_CLIP.id, { name: 'Renamed Video' }));
+ await screen.findByRole('heading', { level: 2, name: 'Renamed Video' });
+ });
+});
+
describe('MusicVideo render control (#1760)', () => {
it('enables Render and kicks off the job when a scene has a clip', async () => {
await openProject(PROJECT_WITH_CLIP, 'review');
@@ -457,7 +488,7 @@ describe('MusicVideo render control (#1760)', () => {
// A metadata frame omits progress; the final-render adapter keeps 38%.
sseState.latest = { type: 'status', message: 'Finishing output' };
- fireEvent.click(screen.getByRole('button', { name: /New project/i }));
+ await clickNewProject();
await openStage('review');
expect(screen.getByTitle('Cancel render')).toHaveTextContent('38%');
await selectProject(other.id);
@@ -488,7 +519,7 @@ describe('MusicVideo render control (#1760)', () => {
expect(cancelMusicVideoRender).toHaveBeenCalledWith('existing-render', { silent: true });
expect(toast.error).toHaveBeenCalledTimes(1);
sseState.latest = { type: 'canceled' };
- fireEvent.click(screen.getByRole('button', { name: /New project/i }));
+ forceRerender();
expect(toast.info).toHaveBeenCalledWith('Render cancelled');
expect(screen.getByRole('button', { name: /^Render final$/ })).toBeEnabled();
});
@@ -504,7 +535,7 @@ describe('MusicVideo render control (#1760)', () => {
await selectProject(other.id);
await openStage('review');
sseState.latest = { type: 'error', error: 'Renderer stopped' };
- fireEvent.click(screen.getByRole('button', { name: /New project/i }));
+ await clickNewProject();
expect(toast.error).toHaveBeenCalledWith('Renderer stopped');
expect(screen.getByLabelText('Project').querySelector('option[value="mv-1"]')).toHaveTextContent('failed');
expect(screen.getByLabelText('Project').querySelector('option[value="mv-other"]')).toHaveTextContent('ready');
@@ -558,7 +589,7 @@ describe('MusicVideo draft excerpt render (#8986)', () => {
// `sseState` object rather than its own React state, so nothing re-renders
// the component until something else does — force one (mirrors the
// existing render-job tests' use of this same mock).
- fireEvent.click(screen.getByRole('button', { name: /New project/i }));
+ forceRerender();
await screen.findByText(/Rendering draft — 50%/);
});
@@ -576,7 +607,7 @@ describe('MusicVideo draft excerpt render (#8986)', () => {
await waitFor(() => expect(renderMusicVideoExcerpt).toHaveBeenCalled());
await settle();
sseState.latest = { type: 'complete', result: { excerptId: 'mve-1', filename: 'excerpt-1.mp4' } };
- fireEvent.click(screen.getByRole('button', { name: /New project/i }));
+ forceRerender();
await screen.findByLabelText(/Play excerpt/i);
expect(screen.getByText('lip-sync drifts here')).toBeInTheDocument();