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

fix: keep timeline workspace above mobile library (#5424)

[._.]/ Adam Eivy95839f082ad9
diff --git a/client/src/pages/VideoTimelineEditor.jsx b/client/src/pages/VideoTimelineEditor.jsx
index f66121b095..26917b8ef7 100644
--- a/client/src/pages/VideoTimelineEditor.jsx
+++ b/client/src/pages/VideoTimelineEditor.jsx
@@ -109,7 +109,9 @@ export default function VideoTimelineEditor() {
const [playing, setPlaying] = useState(false);
const [muted, setMuted] = useState(false);
const [renderJobId, setRenderJobId] = useState(null);
- const [showLibrary, setShowLibrary] = useState(true);
+ const [showLibrary, setShowLibrary] = useState(() => (
+ typeof window === 'undefined' || window.innerWidth >= 1024
+ ));
const [libraryTab, setLibraryTab] = useState('clips');
// Local input draft. Editing the canonical state on every keystroke makes the
// rename onBlur-vs-canonical comparison always-equal.
@@ -755,7 +757,7 @@ export default function VideoTimelineEditor() {
<div className="grid grid-cols-1 lg:grid-cols-[260px_1fr_240px] gap-3 min-h-[400px]">
{/* Left rail — library */}
{showLibrary && (
- <div className="bg-port-card/50 border border-port-border rounded-lg p-2 max-h-[600px] overflow-y-auto">
+ <div className="order-2 lg:order-1 bg-port-card/50 border border-port-border rounded-lg p-2 max-h-[600px] overflow-y-auto">
<div className="flex gap-1 mb-2" role="tablist" aria-label="Clip library">
{LIBRARY_TABS.map(({ id, label, Icon }) => (
<button
@@ -810,7 +812,7 @@ export default function VideoTimelineEditor() {
)}
{/* Center — preview + tracks */}
- <div className="space-y-3 min-w-0">
+ <div className="order-1 lg:order-2 space-y-3 min-w-0">
{/* The preview adopts the CANONICAL render canvas, not a fixed 16:9
box — overlay x/y/width are normalized against that canvas, so a
portrait or square project would otherwise place them somewhere
@@ -985,7 +987,7 @@ export default function VideoTimelineEditor() {
</div>
{/* Right rail — inspector */}
- <div className="bg-port-card/50 border border-port-border rounded-lg p-3 space-y-3">
+ <div className="order-3 bg-port-card/50 border border-port-border rounded-lg p-3 space-y-3">
<div className="text-xs uppercase text-gray-500 tracking-wide">Inspector</div>
{!selected && (
diff --git a/client/src/pages/VideoTimelineEditor.test.jsx b/client/src/pages/VideoTimelineEditor.test.jsx
index beb9201505..89ac3589eb 100644
--- a/client/src/pages/VideoTimelineEditor.test.jsx
+++ b/client/src/pages/VideoTimelineEditor.test.jsx
@@ -66,6 +66,7 @@ const overlayEntry = { type: 'image', assetKind: 'images', assetFile: 'logo.png'
const bedEntry = { assetKind: 'music', assetFile: 'bed.mp3', startSec: 0, offsetSec: 0, durationSec: 4, volume: 1, fadeInSec: 0, fadeOutSec: 0 };
beforeEach(() => {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, value: 1024 });
toastError.mockClear();
api.project = project();
api.history = [{ id: CLIP_A, prompt: 'A dramatic sunrise', filename: 'a.mp4', thumbnail: 'a.jpg', width: 1920, height: 1080, fps: 24, numFrames: 96 }];
@@ -151,6 +152,41 @@ describe('header layout — mobile overflow regression (#5425)', () => {
});
});
+describe('workspace layout — mobile library regression (#5424)', () => {
+ it('starts with the library hidden and keeps the workspace before it when opened', async () => {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, value: 375 });
+ await renderEditor();
+
+ const showLibrary = screen.getByRole('button', { name: 'Show library' });
+ const workspace = screen.getByRole('button', { name: 'Play' }).parentElement?.parentElement;
+ const inspector = screen.getByText('Inspector').parentElement;
+ expect(screen.queryByRole('tablist', { name: 'Clip library' })).not.toBeInTheDocument();
+ expect(workspace).toHaveClass('order-1', 'lg:order-2');
+ expect(inspector).toHaveClass('order-3');
+
+ fireEvent.click(showLibrary);
+
+ const library = screen.getByRole('tablist', { name: 'Clip library' }).parentElement;
+ expect(screen.getByRole('button', { name: 'Hide library' })).toBeInTheDocument();
+ expect(library).toHaveClass('order-2', 'lg:order-1');
+
+ fireEvent.click(screen.getByRole('button', { name: 'Add to timeline' }));
+ await waitFor(() => expect(
+ screen.getByRole('button', { name: 'Remove A dramatic sunrise from timeline' }),
+ ).toBeInTheDocument());
+ });
+
+ it('keeps the desktop library visible in the original left-rail order', async () => {
+ await renderEditor();
+
+ const library = screen.getByRole('tablist', { name: 'Clip library' }).parentElement;
+ const workspace = screen.getByRole('button', { name: 'Play' }).parentElement?.parentElement;
+ expect(screen.getByRole('button', { name: 'Hide library' })).toBeInTheDocument();
+ expect(library).toHaveClass('order-2', 'lg:order-1');
+ expect(workspace).toHaveClass('order-1', 'lg:order-2');
+ });
+});
+
describe('lane caps', () => {
it('refuses an add past the overlay cap with a message naming the lane', async () => {
// One entry over the cap 400s every later debounced save, with nothing