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: expand music video preview and compact sidebar controls

[._.]/ Adam Eivy2fd71d8dd5e0
diff --git a/client/src/components/musicVideo/MusicVideoLayout.jsx b/client/src/components/musicVideo/MusicVideoLayout.jsx
index 1168b76d8c..ae621bda8d 100644
--- a/client/src/components/musicVideo/MusicVideoLayout.jsx
+++ b/client/src/components/musicVideo/MusicVideoLayout.jsx
@@ -107,17 +107,23 @@ const DOCK_CLASSES = 'min-w-0 max-xl:order-first max-xl:col-span-full xl:sticky
* `lead` (the step checklist) opens the step; `review` is the step's approval.
* With `playerFirst` the player and the approval sit together at the top of the
* step; otherwise the player docks at the side and the approval closes the step.
+ * `previewExpanded` gives that side player the main column above the step.
*/
export default function MusicVideoLayout({
project, trackLabel, stage, onStageChange, progress, nextAction, onNextAction, spend, status = null,
attention = null, dock = null, notes = null, autopilot = null, onOpenSettings = null,
- playerFirst = false, lead = null, review = null, onRename = null, renameForm = null, cancelRender = null, children,
+ playerFirst = false, previewExpanded = false, lead = null, review = null, onRename = null, renameForm = null, cancelRender = null, children,
}) {
const headerRef = useRef(null);
const rootRef = useRef(null);
+ const dockRef = useRef(null);
// On a step reviewed by watching (Storyboard, Make, Final render) the player is the main
// element: full width at the top of the step with the approval beside it, not a side column.
const sideDock = !!dock && !playerFirst;
+ const expandedDock = sideDock && previewExpanded;
+ useEffect(() => {
+ if (expandedDock) dockRef.current?.scrollIntoView?.({ block: 'start' });
+ }, [expandedDock]);
// The dock sticks just under the header, whose height depends on wrapping.
useEffect(() => {
@@ -278,8 +284,8 @@ export default function MusicVideoLayout({
</header>
{/* One column on a phone, capped at the screen width so a wide control can't push the step off screen. */}
- <div className={`grid grid-cols-[minmax(0,1fr)] items-start gap-4 md:grid-cols-[13rem_minmax(0,1fr)] ${sideDock ? 'xl:grid-cols-[13rem_minmax(0,1fr)_minmax(20rem,24rem)]' : ''}`}>
- <div className="hidden md:block md:sticky md:top-[calc(var(--mv-header-h,9rem)-0.75rem)]">
+ <div className={`grid grid-cols-[minmax(0,1fr)] items-start gap-4 md:grid-cols-[13rem_minmax(0,1fr)] ${sideDock && !expandedDock ? 'xl:grid-cols-[13rem_minmax(0,1fr)_minmax(20rem,24rem)]' : ''}`}>
+ <div className={`hidden md:block md:sticky md:top-[calc(var(--mv-header-h,9rem)-0.75rem)] ${expandedDock ? 'xl:col-start-1 xl:row-start-1 xl:row-span-2' : ''}`}>
<StepRail stages={progress.stages} stage={stage} onStageChange={onStageChange} needsYouStage={needsYouStage} notes={notes} />
</div>
{/* Labelled by its own heading: from md the phone tab bar is hidden and the step list drives it. */}
@@ -287,7 +293,7 @@ export default function MusicVideoLayout({
role="tabpanel"
id={`mv-stage-${stage}`}
aria-labelledby={`mv-step-title-${stage}`}
- className="min-w-0 space-y-3"
+ className={`min-w-0 space-y-3 ${expandedDock ? 'xl:col-start-2 xl:row-start-2' : ''}`}
>
<div className="space-y-0.5">
<h3 id={`mv-step-title-${stage}`} className="text-xl font-semibold">{stageEntry?.title || stageEntry?.label}</h3>
@@ -304,7 +310,8 @@ export default function MusicVideoLayout({
{children}
{!playerFirst && review}
</div>
- {sideDock ? <div className={DOCK_CLASSES}>{dock}</div> : null}
+ {/* Resize the same mounted player with grid placement, preserving playback and preview settings. */}
+ {sideDock ? <div ref={dockRef} className={expandedDock ? 'min-w-0 max-xl:order-first max-xl:col-span-full xl:col-start-2 xl:row-start-1 xl:scroll-mt-[calc(var(--mv-header-h,9rem)+1rem)]' : DOCK_CLASSES}>{dock}</div> : null}
</div>
</div>
);
diff --git a/client/src/components/musicVideo/PreviewDock.jsx b/client/src/components/musicVideo/PreviewDock.jsx
index 5e43eca0e2..1a042d4ed5 100644
--- a/client/src/components/musicVideo/PreviewDock.jsx
+++ b/client/src/components/musicVideo/PreviewDock.jsx
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from 'react';
import { useSearchParams } from 'react-router';
-import { ChevronDown, ChevronUp, MonitorPlay } from 'lucide-react';
+import { ChevronDown, ChevronUp, Maximize2, Minimize2, MonitorPlay } from 'lucide-react';
import CompositionPreviewPlayer from './CompositionPreviewPlayer.jsx';
import StoryboardAnimatic from './StoryboardAnimatic.jsx';
import ShotStepper, { shotSteps } from './ShotStepper.jsx';
@@ -80,7 +80,7 @@ function VideoPreview({ source, scenes, projectName, seekRequest, collapsed }) {
* nothing to play yet it says what makes something playable. `seekRequest`
* (`{ t, n }`) is the scene-card seek.
*/
-export default function PreviewDock({ project, sources, audioUrl, seekRequest, collapsed, onToggleCollapsed }) {
+export default function PreviewDock({ project, sources, audioUrl, seekRequest, collapsed, onToggleCollapsed, expanded = false, onToggleExpanded }) {
const [searchParams, setSearchParams] = useSearchParams();
const requested = searchParams.get('play');
const source = sources.find((entry) => entry.id === requested) || sources[0] || null;
@@ -92,12 +92,13 @@ export default function PreviewDock({ project, sources, audioUrl, seekRequest, c
}, { replace: true });
// The folded row sits in the page, so it opens downward.
const Chevron = collapsed ? ChevronDown : ChevronUp;
+ const SizeIcon = expanded ? Minimize2 : Maximize2;
const pickerId = `mv-preview-source-${project.id}`;
return (
// A flex gap, not space-y: space-y puts a margin under the header row even
// when everything after it is hidden, so the folded dock sat off-center.
- <aside aria-label="Preview" className="flex flex-col gap-2 rounded-lg border border-port-border bg-port-card p-2">
- <div className="flex min-w-0 items-center gap-2 text-xs text-port-text-muted">
+ <aside aria-label="Preview" className="@container/mv-preview flex min-w-0 flex-col gap-2 rounded-lg border border-port-border bg-port-card p-2">
+ <div className="flex min-w-0 flex-wrap items-center gap-2 text-xs text-port-text-muted">
<MonitorPlay size={14} className="shrink-0 text-port-accent" aria-hidden="true" />
<span className="text-sm font-medium text-port-text">Preview</span>
{sources.length > 1 ? (
@@ -107,13 +108,25 @@ export default function PreviewDock({ project, sources, audioUrl, seekRequest, c
id={pickerId}
value={source.id}
onChange={(e) => pick(e.target.value)}
- className="min-h-[44px] min-w-0 flex-1 truncate rounded border border-port-border bg-port-bg px-1.5 py-1 text-xs text-port-text sm:min-h-0"
+ className="order-last min-h-[44px] min-w-0 basis-full truncate rounded border border-port-border bg-port-bg px-1.5 py-1 text-xs text-port-text sm:min-h-[28px] @min-[32rem]/mv-preview:order-none @min-[32rem]/mv-preview:basis-auto @min-[32rem]/mv-preview:flex-1"
>
{sources.map((entry) => <option key={entry.id} value={entry.id}>{entry.label}</option>)}
</select>
</>
) : (
- <span className="min-w-0 truncate">{source ? source.label : 'Nothing to play yet'}</span>
+ <span className="order-last min-w-0 basis-full truncate @min-[32rem]/mv-preview:order-none @min-[32rem]/mv-preview:basis-auto">{source ? source.label : 'Nothing to play yet'}</span>
+ )}
+ {onToggleExpanded && (
+ <button
+ type="button"
+ onClick={onToggleExpanded}
+ aria-pressed={expanded}
+ aria-label={expanded ? 'Return preview to sidebar' : 'Expand preview into main area'}
+ title={expanded ? 'Return preview to sidebar' : 'Expand preview into main area'}
+ className="ml-auto hidden min-h-[28px] min-w-[28px] shrink-0 items-center justify-center rounded border border-port-border text-port-text hover:border-port-accent xl:flex"
+ >
+ <SizeIcon size={14} aria-hidden="true" />
+ </button>
)}
<button
type="button"
diff --git a/client/src/components/musicVideo/ShotLock.jsx b/client/src/components/musicVideo/ShotLock.jsx
index de5b80b356..e4df923dbc 100644
--- a/client/src/components/musicVideo/ShotLock.jsx
+++ b/client/src/components/musicVideo/ShotLock.jsx
@@ -22,16 +22,16 @@ const baseCls = 'inline-flex min-h-[44px] shrink-0 items-center justify-center g
/**
* One tap to lock a shot (its clip can then be made) or to unlock it. A shot
- * edited since it was locked offers Lock again.
+ * edited since it was locked keeps its warning color and offers Lock.
*/
export function ShotLockButton({ sceneId, className = '' }) {
const lock = useShotLock(sceneId);
if (!lock) return null;
const locked = lock.state === 'locked';
- const label = locked ? 'Unlock' : lock.state === 'changed' ? 'Lock again' : 'Lock';
+ const label = locked ? 'Unlock' : 'Lock';
return (
<button type="button" onClick={() => lock.toggle(!locked)} disabled={lock.busy} aria-pressed={locked}
- title={locked ? 'Locked: its clip can be made. Tap to unlock.' : 'Lock this shot so its clip can be made'}
+ title={locked ? 'Locked: its clip can be made. Tap to unlock.' : lock.state === 'changed' ? 'Changed since locked. Lock this shot again so its clip can be made.' : 'Lock this shot so its clip can be made'}
className={`${baseCls} ${locked ? 'border-port-success/50 bg-port-success/10 text-port-success' : lock.state === 'changed' ? 'border-port-warning/50 bg-port-warning/10 text-port-warning' : 'border-port-border text-port-text'} ${className}`}>
{locked ? <Lock size={14} aria-hidden="true" /> : <LockOpen size={14} aria-hidden="true" />}
{label}
diff --git a/client/src/components/musicVideo/ShotStepper.jsx b/client/src/components/musicVideo/ShotStepper.jsx
index d6f6cb872f..abf7b8ba1c 100644
--- a/client/src/components/musicVideo/ShotStepper.jsx
+++ b/client/src/components/musicVideo/ShotStepper.jsx
@@ -69,7 +69,7 @@ export default function ShotStepper({ scenes, time, onSeek, range = null, disabl
}, [keys]);
if (!count) return null;
return (
- <div className={`flex min-w-0 items-center gap-1.5 text-[11px] text-port-text-muted ${className}`}>
+ <div className={`flex min-w-0 flex-wrap items-center gap-1.5 text-[11px] text-port-text-muted ${className}`}>
<button type="button" onClick={() => onSeek(back)} disabled={disabled || back == null} aria-label="Previous shot" title="Previous shot" className={buttonCls}>
<SkipBack size={14} aria-hidden="true" />
</button>
diff --git a/client/src/components/musicVideo/ShotStepper.test.jsx b/client/src/components/musicVideo/ShotStepper.test.jsx
index 7e59c92366..9f64cd90eb 100644
--- a/client/src/components/musicVideo/ShotStepper.test.jsx
+++ b/client/src/components/musicVideo/ShotStepper.test.jsx
@@ -44,7 +44,9 @@ describe('ShotStepper shot lock', () => {
it('locks the shot on screen in one tap, and unlocks a locked one', () => {
const toggle = renderWith({ a: 'locked', b: 'changed' }, 5);
- fireEvent.click(screen.getByRole('button', { name: 'Lock again' }));
+ const lock = screen.getByRole('button', { name: 'Lock' });
+ expect(lock).toHaveAttribute('title', 'Changed since locked. Lock this shot again so its clip can be made.');
+ fireEvent.click(lock);
expect(toggle).toHaveBeenLastCalledWith('b', true);
});
diff --git a/client/src/components/musicVideo/StoryboardAnimatic.jsx b/client/src/components/musicVideo/StoryboardAnimatic.jsx
index f405d3b608..04eabf80b3 100644
--- a/client/src/components/musicVideo/StoryboardAnimatic.jsx
+++ b/client/src/components/musicVideo/StoryboardAnimatic.jsx
@@ -306,8 +306,8 @@ export default function StoryboardAnimatic({ project, audioUrl, seekRequest, col
{overlay}
</FilmLookFrame>
</figure>
- <div className="flex min-w-0 items-start gap-2">
- <div className="min-w-0 flex-1 text-[11px] text-port-text-muted">
+ <div className="flex min-w-0 flex-wrap items-center gap-2">
+ <div className="min-w-0 basis-full text-[11px] text-port-text-muted @min-[32rem]/mv-preview:flex-1 @min-[32rem]/mv-preview:basis-auto">
{shot && (
<div className="flex flex-wrap items-center gap-x-2 gap-y-1">
<ShotStepper scenes={timed} time={time} onSeek={seekTo} keys />
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index f2a59d4fa9..925382fde4 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -1089,7 +1089,8 @@ export default function MusicVideo() {
// the director opens it. `dockCollapsed` is null until they toggle it.
const [seekRequest, setSeekRequest] = useState(null);
const [dockCollapsed, setDockCollapsed] = useState(null);
- useEffect(() => { setSeekRequest(null); setDockCollapsed(null); }, [selectedId]);
+ const [dockExpanded, setDockExpanded] = useState(false);
+ useEffect(() => { setSeekRequest(null); setDockCollapsed(null); setDockExpanded(false); }, [selectedId]);
// `play` starts playback from there (a storyboard row); a scene card only cues the shot.
const seekToScene = (scene, { play = false } = {}) => {
if (typeof scene?.startSec !== 'number') return;
@@ -1560,6 +1561,7 @@ export default function MusicVideo() {
autopilot={autopilotStatus(selected)}
onOpenSettings={openHeaderSettings}
playerFirst={playerFirst}
+ previewExpanded={dockExpanded}
onRename={handleRename}
renameForm={renameForm}
cancelRender={renderTargetsSelected && !renderJob.pending ? { onCancel: renderJob.cancel, cancelling: renderJob.cancelling } : null}
@@ -1613,6 +1615,8 @@ export default function MusicVideo() {
seekRequest={seekRequest}
collapsed={dockCollapsed ?? !playerFirst}
onToggleCollapsed={() => setDockCollapsed(!(dockCollapsed ?? !playerFirst))}
+ expanded={dockExpanded}
+ onToggleExpanded={!playerFirst ? () => setDockExpanded((expanded) => !expanded) : undefined}
/>,
)}
>
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index c06dee5f4d..5bd77e1c04 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -357,7 +357,7 @@ const selectProject = async (projectId) => {
// control is only on screen while its step is open, so tests say which one.
// Compose is part of Make now. The phone's step bar is the tablist.
const STAGE_TABS = {
- setup: /^Song/, 'cast-sets': /^Look/, board: /^Storyboard/, produce: /^Make/, compose: /^Make/, review: /^Final render/,
+ setup: /^Song/, 'cast-sets': /^Look/, board: /^Storyboard/, produce: /^Make/, compose: /^Make/, review: /^Final render/, publish: /^Publish/,
};
// Project settings (render style, audio tools, autopilot, files) is a drawer over the step.
const openSettings = async (tab = 'Project') => {
@@ -2961,6 +2961,39 @@ describe('MusicVideo stage tabs (#9243)', () => {
await waitFor(() => expect(screen.getByLabelText('Preview source')).toHaveValue('excerpt:mve-1'));
});
+ // Uniquely catches resizing the Look/Publish preview remounting its player or resetting the chosen source.
+ it('expands the Look and Publish preview into the main column and returns the same player to the sidebar', async () => {
+ const project = {
+ ...PROJECT_WITH_CLIP,
+ renderHistoryId: 'rh-9',
+ excerpts: [{ id: 'mve-1', startSec: 0, endSec: 10, status: 'complete', filename: 'excerpt-old.mp4', notes: [] }],
+ };
+ await openProject(project, 'cast-sets');
+ fireEvent.change(screen.getByLabelText('Preview source'), { target: { value: 'excerpt:mve-1' } });
+ for (const stage of ['cast-sets', 'publish']) {
+ if (stage === 'publish') await openStage(stage, false);
+ const player = await screen.findByLabelText('Draft excerpt preview');
+ player.currentTime = 3;
+ fireEvent.timeUpdate(player);
+ const dock = screen.getByRole('complementary', { name: 'Preview' }).closest('.max-xl\\:order-first');
+ fireEvent.click(screen.getByRole('button', { name: 'Expand preview into main area' }));
+ expect(dock).toHaveClass('xl:col-start-2', 'xl:row-start-1');
+ expect(screen.getByRole('tabpanel')).toHaveClass('xl:row-start-2');
+ expect(screen.getByLabelText('Draft excerpt preview')).toBe(player);
+ expect(player.currentTime).toBe(3);
+ expect(screen.getByLabelText('Preview source')).toHaveValue('excerpt:mve-1');
+ const restore = screen.getByRole('button', { name: 'Return preview to sidebar' });
+ expect(restore).toHaveAttribute('aria-pressed', 'true');
+ fireEvent.click(restore);
+ expect(dock).toHaveClass('xl:sticky');
+ expect(screen.getByRole('tabpanel')).not.toHaveClass('xl:row-start-2');
+ expect(screen.getByLabelText('Draft excerpt preview')).toBe(player);
+ expect(player.currentTime).toBe(3);
+ }
+ await openStage('board', false);
+ expect(screen.queryByRole('button', { name: 'Expand preview into main area' })).toBeNull();
+ });
+
it('plays the final render first and keeps a picked draft across stage tabs', async () => {
const project = {
...PROJECT_WITH_CLIP,