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: lay out Music Video Song & lyrics as four numbered steps and move advanced audio tools into a fold (#10158)

Adam Eivy0c6317106232
diff --git a/client/src/components/musicVideo/LyricsPanel.jsx b/client/src/components/musicVideo/LyricsPanel.jsx
index dc93974acc..122ed00f53 100644
--- a/client/src/components/musicVideo/LyricsPanel.jsx
+++ b/client/src/components/musicVideo/LyricsPanel.jsx
@@ -157,7 +157,10 @@ function MarkerChips({ markers }) {
);
}
-export default function LyricsPanel({ project, onEditLocal, onSave, onImport, importing, onImportTrack, onAlign, aligning = false }) {
+export default function LyricsPanel({ project, onEditLocal, onSave, onImport, importing, onImportTrack, onAlign, aligning = false, inline = false }) {
+ // `inline` drops the fold: Setup step 3 shows the editor open in place.
+ const Shell = inline ? 'div' : 'details';
+ const Heading = inline ? 'p' : 'summary';
const cues = project.lyricCues || [];
const markers = project.lyricMarkers || [];
const markersAt = (line) => markers.filter((marker) => marker.line === line);
@@ -217,12 +220,12 @@ export default function LyricsPanel({ project, onEditLocal, onSave, onImport, im
};
return (
- <details className="mt-2 bg-port-bg border border-port-border rounded-lg p-2 text-xs">
- <summary className="cursor-pointer select-none text-port-text-muted min-h-[44px] sm:min-h-0 flex flex-wrap items-center gap-x-1">
+ <Shell className="mt-2 bg-port-bg border border-port-border rounded-lg p-2 text-xs">
+ <Heading className={`${inline ? '' : 'cursor-pointer select-none '}text-port-text-muted min-h-[44px] sm:min-h-0 flex flex-wrap items-center gap-x-1`}>
Lyrics, phrases &amp; pacing — {cues.length} line{cues.length === 1 ? '' : 's'} ({timedCount} timed)
· {phrases.length} phrase{phrases.length === 1 ? '' : 's'}
<span className="block sm:inline sm:ml-1">— AI Plan cuts on timed lines and phrase edges; no lyrics = an instrumental plan.</span>
- </summary>
+ </Heading>
<div className="mt-2 grid grid-cols-1 gap-3 lg:grid-cols-2">
<section className="space-y-2 min-w-0">
@@ -366,6 +369,6 @@ export default function LyricsPanel({ project, onEditLocal, onSave, onImport, im
</div>
</section>
</div>
- </details>
+ </Shell>
);
}
diff --git a/client/src/components/musicVideo/ProjectActionGroups.jsx b/client/src/components/musicVideo/ProjectActionGroups.jsx
index ab54c1e583..8a3723fff0 100644
--- a/client/src/components/musicVideo/ProjectActionGroups.jsx
+++ b/client/src/components/musicVideo/ProjectActionGroups.jsx
@@ -20,8 +20,8 @@ const groupCls = 'flex min-w-0 flex-wrap items-center gap-2';
const uniqueCount = (scenes, key) => new Set(scenes.map((scene) => scene[key]).filter(Boolean)).size;
const noAudioOf = (project) => !project.trackId && !project.uploadedAudioFilename;
-/** Analyze the beat grid and transcribe the track to MIDI. */
-export function AudioActions({ project, midi, midiBound, busy, onAnalyze }) {
+/** Analyze the beat grid (Setup step 2). */
+export function AnalyzeAction({ project, busy, onAnalyze }) {
const noAudio = noAudioOf(project);
return (
<div className={groupCls}>
@@ -30,6 +30,15 @@ export function AudioActions({ project, midi, midiBound, busy, onAnalyze }) {
className={buttonCls}>
<Activity size={15} /> {busy.analyzing ? 'Analyzing…' : 'Analyze'}
</button>
+ </div>
+ );
+}
+
+/** Transcribe the track to MIDI (an advanced audio tool). */
+export function MidiAction({ project, midi, midiBound }) {
+ const noAudio = noAudioOf(project);
+ return (
+ <div className={groupCls}>
{midiBound ? (
<button onClick={midi.cancel} title="Cancel MIDI transcription"
className="flex items-center gap-1 bg-port-warning/20 text-port-warning border border-port-border rounded px-2 py-1.5 text-sm min-h-[44px] sm:min-h-0">
diff --git a/client/src/components/musicVideo/TrackPanel.jsx b/client/src/components/musicVideo/TrackPanel.jsx
index ba0269793e..43b6340190 100644
--- a/client/src/components/musicVideo/TrackPanel.jsx
+++ b/client/src/components/musicVideo/TrackPanel.jsx
@@ -37,7 +37,7 @@ function timedDataLabels(project) {
*/
export default function TrackPanel({
project, tracks, trackName, audioFilename, youtube,
- renderBound, midiBound, onChangeTrack, onProjectUpdated, separation = null,
+ renderBound, midiBound, onChangeTrack,
}) {
// A pending change that would destroy timed data waits for explicit confirm.
const [pending, setPending] = useState(null);
@@ -59,7 +59,6 @@ export default function TrackPanel({
const audioUrl = audioFilename ? trackAudioUrl(audioFilename) : null;
// Where the linked track's audio came from (e.g. a Suno export, #8967).
const sourceLabel = trackSourceLabel(tracks.find((t) => t.id === project.trackId));
- const midiFile = project.midiTranscription?.filename;
const optionLabels = trackOptionLabels(tracks);
return (
<>
@@ -112,14 +111,6 @@ export default function TrackPanel({
</div>
</div>
)}
- <VocalStemControl
- project={project}
- hasAudio={Boolean(project.trackId || project.uploadedAudioFilename)}
- onUpdated={onProjectUpdated}
- separation={separation}
- />
- {/* #8988: an optional, explicitly chosen bed mixed under the song. */}
- <SoundBedControl key={project.id} project={project} tracks={tracks} disabled={renderBound} onUpdated={onProjectUpdated} />
{/* Preview + download the project's master audio track. Both act on
the resolved data/music/ file (linked track or uploaded audio). */}
{audioUrl && (
@@ -132,19 +123,35 @@ export default function TrackPanel({
<Download size={13} /> Download audio
</a>
</div>
- {/* The visualization panel owns the MIDI download button, so no
- separate Download-MIDI anchor here (#2477). Served from the
- music dir (same static route as the master audio) so the
- federated .mid resolves on peers too. */}
- {midiFile && (
- <MidiVisualization
- url={trackAudioUrl(midiFile)}
- filename={midiFile}
- model={project.midiTranscription.model}
- />
- )}
</div>
)}
</>
);
}
+
+/**
+ * The jargon-heavy audio options, kept out of the main Song & lyrics path:
+ * the vocal stem, the sound bed and the MIDI transcription preview.
+ */
+export function AdvancedTrackControls({ project, tracks, renderBound, onProjectUpdated, separation = null }) {
+ const midiFile = project.midiTranscription?.filename;
+ return (
+ <>
+ <VocalStemControl
+ project={project}
+ hasAudio={Boolean(project.trackId || project.uploadedAudioFilename)}
+ onUpdated={onProjectUpdated}
+ separation={separation}
+ />
+ {/* #8988: an optional, explicitly chosen bed mixed under the song. */}
+ <SoundBedControl key={project.id} project={project} tracks={tracks} disabled={renderBound} onUpdated={onProjectUpdated} />
+ {midiFile && (
+ <MidiVisualization
+ url={trackAudioUrl(midiFile)}
+ filename={midiFile}
+ model={project.midiTranscription.model}
+ />
+ )}
+ </>
+ );
+}
diff --git a/client/src/components/musicVideo/stages/BoardStage.jsx b/client/src/components/musicVideo/stages/BoardStage.jsx
index 98e7a60658..f92056a35a 100644
--- a/client/src/components/musicVideo/stages/BoardStage.jsx
+++ b/client/src/components/musicVideo/stages/BoardStage.jsx
@@ -1,5 +1,4 @@
import { Plus } from 'lucide-react';
-import AudioTimingPanel from '../AudioTimingPanel.jsx';
import BeatTimeline from '../BeatTimeline.jsx';
import SceneCard from '../SceneCard.jsx';
import { PlanActions } from '../ProjectActionGroups.jsx';
@@ -33,8 +32,6 @@ export default function BoardStage({ board }) {
<PlanActions project={project} busy={busy} onPlan={board.onPlan} onAutoArrange={board.onAutoArrange} />
</div>
- <AudioTimingPanel key={project.id} project={project} tracks={board.tracks} onApplied={board.replaceProject} disabled={locked || board.renderBound} />
-
{project.audioAnalysis && scenes.length > 0 && (
<BeatTimeline audioAnalysis={project.audioAnalysis} scenes={scenes} lyricCues={project.lyricCues} narrativeEvents={project.composition?.narrativeEvents}
onSeek={(startSec) => board.seekToScene({ startSec })} onCommit={board.commitSceneTiming} />
diff --git a/client/src/components/musicVideo/stages/SetupStage.jsx b/client/src/components/musicVideo/stages/SetupStage.jsx
index 2780656943..47d4e0b5e9 100644
--- a/client/src/components/musicVideo/stages/SetupStage.jsx
+++ b/client/src/components/musicVideo/stages/SetupStage.jsx
@@ -1,16 +1,19 @@
+import { useState } from 'react';
import AutonomousRunPanel from '../AutonomousRunPanel.jsx';
import SongRevisionPanel from '../SongRevisionPanel.jsx';
import StyleReferencesPanel from '../StyleReferencesPanel.jsx';
import AutoSizeTextarea from '../../ui/AutoSizeTextarea';
import CreativeSetupPanel from '../CreativeSetupPanel.jsx';
-import TrackPanel from '../TrackPanel.jsx';
+import TrackPanel, { AdvancedTrackControls } from '../TrackPanel.jsx';
+import AudioTimingPanel from '../AudioTimingPanel.jsx';
import AnalysisPanel from '../AnalysisPanel.jsx';
import LyricsPanel from '../LyricsPanel.jsx';
import VisualSpecPanel from '../VisualSpecPanel.jsx';
import TreatmentPanel from '../TreatmentPanel.jsx';
-import { AudioActions } from '../ProjectActionGroups.jsx';
+import { AnalyzeAction, MidiAction } from '../ProjectActionGroups.jsx';
import StageSection from '../StageSection.jsx';
import ProjectOptionsPanel, { projectOptionsSummary } from '../ProjectOptionsPanel.jsx';
+import { Check } from 'lucide-react';
import { projectHasAudio } from '../../../lib/musicVideoStages.js';
import { formatCount } from '../../../utils/formatters.js';
@@ -23,6 +26,43 @@ const songSummary = (project, trackLabel) => {
].join(' · ');
};
+/** One numbered step of Song & lyrics, with a done state beside its title. */
+function SongStep({ number, title, done, children }) {
+ return (
+ <section aria-label={`Step ${number}: ${title}`} className="min-w-0 space-y-2 rounded-lg border border-port-border p-2">
+ <h3 className="flex items-center gap-2 text-sm font-medium">
+ <span aria-hidden="true" className={`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs ${done ? 'bg-port-success text-white' : 'bg-port-border text-port-text-muted'}`}>
+ {done ? <Check size={12} /> : number}
+ </span>
+ {number}. {title}
+ <span className={`text-xs font-normal ${done ? 'text-port-success' : 'text-port-text-muted'}`}>{done ? 'Done' : 'To do'}</span>
+ </h3>
+ {children}
+ </section>
+ );
+}
+
+/** Whole-song word alignment; the page's handler is silent, so errors surface here. */
+function AlignWords({ disabled, aligning, onAlign }) {
+ const [error, setError] = useState('');
+ const run = () => {
+ setError('');
+ Promise.resolve(onAlign()).catch((err) => setError(err?.message || 'Could not align the words to the vocal. Try again.'));
+ };
+ return (
+ <>
+ <p className="text-xs text-port-text-muted">
+ Align each word to the vocal, then listen back to confirm the timing. Word times can be fine-tuned per line in step 3.
+ </p>
+ <button type="button" onClick={run} disabled={aligning || disabled}
+ className="min-h-[44px] rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm text-port-accent disabled:opacity-50 sm:min-h-0">
+ {aligning ? 'Aligning…' : 'Align all words'}
+ </button>
+ {error && <p role="alert" className="text-xs text-port-error">{error}</p>}
+ </>
+ );
+}
+
const directionSummary = (project) => {
const refs = (project.styleReferences || []).length;
return [
@@ -47,6 +87,8 @@ export default function SetupStage({ board }) {
autopilotRun, autonomous, runStage, onSelectStage,
} = board;
const songOpen = !projectHasAudio(project) || !project.audioAnalysis;
+ const cues = project.lyricCues || [];
+ const aligned = cues.length > 0 && cues.every((cue) => cue.words?.length);
const trackLabel = project.trackId ? trackName(project.trackId) : audioFilename;
return (
<>
@@ -77,41 +119,60 @@ export default function SetupStage({ board }) {
/>
</StageSection>
<StageSection id="mv-setup-song" title="Song & lyrics" summary={songSummary(project, trackLabel)} defaultOpen={songOpen}>
- <SongRevisionPanel key={`song-${project.id}`} project={project} tracks={tracks} onUpdated={board.replaceProject} onFork={board.onForkSong} disabled={locked || renderBound || midiBound} />
<fieldset disabled={locked} className="min-w-0">
<div id="mv-track" className="space-y-2">
- <TrackPanel
- project={project}
- tracks={tracks}
- trackName={trackName}
- audioFilename={audioFilename}
- youtube={youtube}
- renderBound={renderBound}
- midiBound={midiBound}
- onChangeTrack={board.onChangeTrack}
- onProjectUpdated={board.replaceProject}
- separation={separation}
- />
- <AudioActions project={project} midi={midi} midiBound={midiBound} busy={busy} onAnalyze={board.onAnalyze} />
- <AnalysisPanel
- audioAnalysis={project.audioAnalysis}
- scenes={project.scenes || []}
- tempo={tempo}
- onReanalyze={board.onAnalyze}
- analyzing={busy.analyzing}
- />
- <LyricsPanel
- project={project}
- onEditLocal={board.editProjectLocal}
- onSave={board.saveProjectFields}
- onImport={board.onImportLyrics}
- onImportTrack={board.onImportTrackLyrics}
- importing={importingLyrics}
- onAlign={board.onAlignLyrics}
- aligning={aligningLyrics}
- />
+ <SongStep number={1} title="Track" done={projectHasAudio(project)}>
+ <TrackPanel
+ project={project}
+ tracks={tracks}
+ trackName={trackName}
+ audioFilename={audioFilename}
+ youtube={youtube}
+ renderBound={renderBound}
+ midiBound={midiBound}
+ onChangeTrack={board.onChangeTrack}
+ />
+ </SongStep>
+ <SongStep number={2} title="Analyze" done={Boolean(project.audioAnalysis)}>
+ <AnalyzeAction project={project} busy={busy} onAnalyze={board.onAnalyze} />
+ <AnalysisPanel
+ audioAnalysis={project.audioAnalysis}
+ scenes={project.scenes || []}
+ tempo={tempo}
+ onReanalyze={board.onAnalyze}
+ analyzing={busy.analyzing}
+ />
+ </SongStep>
+ <SongStep number={3} title="Lyrics" done={cues.length > 0}>
+ <LyricsPanel
+ inline
+ project={project}
+ onEditLocal={board.editProjectLocal}
+ onSave={board.saveProjectFields}
+ onImport={board.onImportLyrics}
+ onImportTrack={board.onImportTrackLyrics}
+ importing={importingLyrics}
+ onAlign={board.onAlignLyrics}
+ aligning={aligningLyrics}
+ />
+ </SongStep>
+ <SongStep number={4} title="Align & verify" done={aligned}>
+ <AlignWords
+ disabled={cues.length === 0 || !projectHasAudio(project)}
+ aligning={aligningLyrics}
+ onAlign={board.onAlignLyrics}
+ />
+ </SongStep>
</div>
</fieldset>
+ <StageSection id="mv-setup-advanced-audio" title="Advanced audio" summary="Fork & revise song, vocal stem, sound bed, MIDI, timing revision">
+ <SongRevisionPanel key={`song-${project.id}`} project={project} tracks={tracks} onUpdated={board.replaceProject} onFork={board.onForkSong} disabled={locked || renderBound || midiBound} />
+ <fieldset disabled={locked} className="min-w-0 space-y-2">
+ <AdvancedTrackControls project={project} tracks={tracks} renderBound={renderBound} onProjectUpdated={board.replaceProject} separation={separation} />
+ <MidiAction project={project} midi={midi} midiBound={midiBound} />
+ </fieldset>
+ <AudioTimingPanel key={`timing-${project.id}`} project={project} tracks={tracks} onApplied={board.replaceProject} disabled={locked || renderBound} />
+ </StageSection>
</StageSection>
<StageSection id="mv-setup-direction" title="Creative direction" summary={directionSummary(project)}>
<CreativeSetupPanel
diff --git a/client/src/components/musicVideo/stages/SetupStage.test.jsx b/client/src/components/musicVideo/stages/SetupStage.test.jsx
new file mode 100644
index 0000000000..8e509013fa
--- /dev/null
+++ b/client/src/components/musicVideo/stages/SetupStage.test.jsx
@@ -0,0 +1,45 @@
+// @vitest-environment happy-dom
+import { describe, it, expect, vi } from 'vitest';
+import { render, screen, within } from '@testing-library/react';
+import SetupStage from './SetupStage.jsx';
+
+vi.mock('../../songs/MidiVisualization.jsx', () => ({ default: () => null }));
+vi.mock('../ProjectOptionsPanel.jsx', () => ({ default: () => null, projectOptionsSummary: () => '' }));
+vi.mock('../CreativeSetupPanel.jsx', () => ({ default: () => null }));
+vi.mock('../StyleReferencesPanel.jsx', () => ({ default: () => null }));
+vi.mock('../VisualSpecPanel.jsx', () => ({ default: () => null }));
+vi.mock('../TreatmentPanel.jsx', () => ({ default: () => null }));
+vi.mock('../VocalStemControl.jsx', () => ({ default: () => <div>vocal-stem</div> }));
+vi.mock('../SoundBedControl.jsx', () => ({ default: () => <div>sound-bed</div> }));
+vi.mock('../SongRevisionPanel.jsx', () => ({ default: () => <div>song-revision</div> }));
+
+const board = (project) => ({
+ project, tracks: [], trackName: () => 'Song', tempo: { bpm: '', setBpm: vi.fn() }, audioFilename: 'a.wav', locked: false,
+ youtube: { editJob: {}, editUrl: '', setEditUrl: vi.fn(), startEdit: vi.fn() },
+ midi: { model: 'base', active: false }, busy: {}, conceptDraft: {}, styleDraft: {}, treatment: {},
+ onAnalyze: vi.fn(), onAlignLyrics: vi.fn(),
+});
+
+describe('SetupStage Song & lyrics', () => {
+ it('lays out four numbered steps with done states and keeps advanced audio tools in a trailing fold', () => {
+ const project = { id: 'p', trackId: 't', audioAnalysis: { durationSec: 10 }, lyricCues: [{ id: 'c', text: 'hi', words: [{ w: 'hi', startSec: 0, endSec: 1 }] }] };
+ render(<SetupStage board={board(project)} />);
+ const steps = screen.getAllByRole('region', { name: /^Step \d/ });
+ expect(steps.map((s) => s.getAttribute('aria-label'))).toEqual([
+ 'Step 1: Track', 'Step 2: Analyze', 'Step 3: Lyrics', 'Step 4: Align & verify',
+ ]);
+ steps.forEach((s) => expect(within(s).getByText('Done')).toBeTruthy());
+ const advanced = document.getElementById('mv-setup-advanced-audio');
+ expect(advanced.contains(screen.getByText('vocal-stem'))).toBe(true);
+ expect(advanced.contains(screen.getByText('song-revision'))).toBe(true);
+ expect(advanced.contains(screen.getByText('Preview audio timing revision'))).toBe(true);
+ steps.forEach((s) => expect(advanced.contains(s)).toBe(false));
+ // The lyrics editor is inline in step 3, not a nested fold.
+ expect(steps[2].contains(within(steps[2]).getByText(/Lyrics, phrases & pacing/).closest('details'))).toBe(false);
+ });
+
+ it('marks later steps to do for an empty project', () => {
+ render(<SetupStage board={board({ id: 'p' })} />);
+ expect(screen.getAllByText('To do')).toHaveLength(4);
+ });
+});