diff --git a/apps/web/src/components/Nav.tsx b/apps/web/src/components/Nav.tsx index bcc680797..e4ee6e447 100644 --- a/apps/web/src/components/Nav.tsx +++ b/apps/web/src/components/Nav.tsx @@ -25,6 +25,8 @@ interface NavProps { fixed?: boolean; /** 'topbar' (default) or the Webflow floating 'rail'. */ variant?: 'topbar' | 'rail'; + /** Collapse the floating rail to its 56px icon dock initially. */ + defaultCollapsed?: boolean; } const NAV_LINKS = [ @@ -138,8 +140,9 @@ function RailNav({ pathname, rightSlot, subtitle, -}: Pick & { pathname: string }) { - const [collapsed, setCollapsed] = useState(false); + defaultCollapsed = false, +}: Pick & { pathname: string }) { + const [collapsed, setCollapsed] = useState(defaultCollapsed); useEffect(() => { const onKeyDown = (event: KeyboardEvent) => { @@ -159,11 +162,11 @@ function RailNav({ aria-label="Primary" >
- + - UVAI + UVAI - - Open on YouTube - + {watchHref ? ( + + Open on YouTube + + ) : null}
) : null} @@ -1104,57 +1180,72 @@ export default function OneLoopStudio({ )} -
    - {( - [ - { id: 'pack', label: 'Pack' }, - { id: 'captions', label: 'Captions' }, - { id: 'transcript', label: 'Transcript' }, - { id: 'events', label: 'Events' }, - { id: 'ready', label: 'Ready' }, - ] as const - ).map((step, idx) => { - const activeIdx = - transcriptStage.id === 'ready' - ? 4 - : transcriptStage.id === 'events' - ? 3 - : transcriptStage.id === 'transcript' - ? 2 - : transcriptStage.id === 'captions' - ? 1 - : 0; - const isDone = - !transcriptWorking && - selected?.status !== 'failed' && - Boolean(selected?.videoPack || selected?.transcript?.trim()); - const isFailed = selected?.status === 'failed'; - const stepState = isDone - ? 'done' - : isFailed - ? idx < activeIdx - ? 'done' - : idx === activeIdx - ? 'failed' - : 'idle' - : transcriptWorking +
    +
      + {( + [ + { id: 'pack', label: 'Pack' }, + { id: 'captions', label: 'Captions' }, + { id: 'transcript', label: 'Transcript' }, + { id: 'events', label: 'Events' }, + { id: 'ready', label: 'Ready' }, + ] as const + ).map((step, idx) => { + const activeIdx = + transcriptStage.id === 'ready' + ? 4 + : transcriptStage.id === 'events' + ? 3 + : transcriptStage.id === 'transcript' + ? 2 + : transcriptStage.id === 'captions' + ? 1 + : 0; + const isDone = + !transcriptWorking && + selected?.status !== 'failed' && + Boolean(selected?.videoPack || selected?.transcript?.trim()); + const isFailed = selected?.status === 'failed'; + const stepState = isDone + ? 'done' + : isFailed ? idx < activeIdx ? 'done' : idx === activeIdx - ? 'active' + ? 'failed' : 'idle' - : 'idle'; - return ( -
    1. - {step.label} -
    2. - ); - })} -
    + : transcriptWorking + ? idx < activeIdx + ? 'done' + : idx === activeIdx + ? 'active' + : 'idle' + : 'idle'; + return ( +
  1. + {step.label} +
  2. + ); + })} +
+ {watchHref ? ( + + YouTube ↗ + + ) : null} +
{selected?.videoPack ? (
@@ -1255,9 +1346,9 @@ export default function OneLoopStudio({ } chatPane={ } outputPane={ diff --git a/apps/web/src/components/__tests__/Nav.template.test.tsx b/apps/web/src/components/__tests__/Nav.template.test.tsx index d05aaef2e..326fd7194 100644 --- a/apps/web/src/components/__tests__/Nav.template.test.tsx +++ b/apps/web/src/components/__tests__/Nav.template.test.tsx @@ -84,4 +84,22 @@ describe('Nav template routing semantics', () => { expect(document.documentElement.dataset.contrast).toBe('normal'); expect(contrast.getAttribute('aria-pressed')).toBe('false'); }); + + it('supports Webflow floating rail defaultCollapsed with visible brand mark and ⌘/ toggle', () => { + usePathnameMock.mockReturnValue('/studio'); + render(