From e2bf0f6287fcb3b1f86d2d01e89783015e0be8a7 Mon Sep 17 00:00:00 2001 From: Hayden <154503486+groupthinking@users.noreply.github.com> Date: Thu, 19 Nov 2026 02:08:12 -0600 Subject: [PATCH] feat(studio): overhaul half-screen split layout, chat UX, and 4-tab deliverables --- .../playwright/grounded-spec-review.spec.ts | 29 +- .../playwright/studio-accessibility.spec.ts | 64 +- apps/web/src/app/page.tsx | 4 +- apps/web/src/components/Nav.tsx | 64 +- apps/web/src/components/OneLoopStudio.tsx | 631 ++++------ .../__tests__/Nav.template.test.tsx | 45 + .../OneLoopStudio.build-live.test.tsx | 11 +- .../OneLoopStudio.job-strip.test.tsx | 6 +- .../OneLoopStudio.three-panel.test.tsx | 330 +++-- .../__tests__/StudioIdeChat.plan.test.tsx | 87 +- .../StudioIdeShell.template.test.tsx | 110 +- .../src/components/studio/StudioIdeChat.tsx | 765 +++++++++--- .../src/components/studio/StudioIdeOutput.tsx | 1078 +++++++++++------ .../src/components/studio/StudioIdeShell.tsx | 122 +- .../StudioIdeOutput.playflow.test.tsx | 231 +++- .../__tests__/studio-pipeline-status.test.ts | 20 +- .../uvai-surface-unification.test.ts | 9 +- apps/web/src/lib/studio-pipeline-status.ts | 16 +- apps/web/src/lib/use-youtube-player.ts | 224 ++-- apps/web/src/store/dashboard-store.ts | 54 +- apps/web/src/styles/home-shipper.css | 23 +- apps/web/src/styles/studio-workbench.css | 458 +++++-- apps/web/src/styles/theme-tokens.css | 179 ++- 23 files changed, 3195 insertions(+), 1365 deletions(-) diff --git a/apps/web/playwright/grounded-spec-review.spec.ts b/apps/web/playwright/grounded-spec-review.spec.ts index 5d3040929..11c98228e 100644 --- a/apps/web/playwright/grounded-spec-review.spec.ts +++ b/apps/web/playwright/grounded-spec-review.spec.ts @@ -7,6 +7,14 @@ test.beforeEach(({ baseURL }) => { test.skip(!process.env.BASE_URL || !baseURL || !['localhost', '127.0.0.1', '[::1]'].includes(new URL(baseURL).hostname), 'Synthetic review fixtures are local-only, not production smoke tests.'); }); +async function openCodeAndSpecTab(page: Page) { + const deliverablesDockTab = page.getByRole('tab', { name: 'Deliverables', exact: true }); + if (await deliverablesDockTab.isVisible()) { + await deliverablesDockTab.click(); + } + await page.getByTestId('studio-ide-output-tab-code').click(); +} + async function seedReview(page: Page, baseURL: string | undefined, storageBlocked = false) { if (!baseURL || !['localhost', '127.0.0.1', '[::1]'].includes(new URL(baseURL).hostname)) { throw new Error('Synthetic review tests require an explicit local BASE_URL; never run against production.'); @@ -55,9 +63,10 @@ async function seedReview(page: Page, baseURL: string | undefined, storageBlocke } }, { key: storageKey, videos, storageBlocked }); await page.goto('/studio'); - const selector = page.getByRole('combobox', { name: 'Stored packs' }); + const selector = page.getByRole('combobox', { name: 'Saved videos' }); await expect(selector).toBeVisible(); await selector.selectOption('synthetic-0'); + await openCodeAndSpecTab(page); await expect(page.getByRole('button', { name: 'Acknowledge review', exact: true })).toBeEnabled(); return unexpectedRequests; } @@ -84,23 +93,26 @@ for (const viewport of [{ width: 830, height: 709 }, { width: 390, height: 844 } await mkdir('/tmp/agent-browser', { recursive: true }); await review.screenshot({ path: `/tmp/agent-browser/grounded-review-${viewport.width}.png` }); await page.reload(); - await page.getByRole('combobox', { name: 'Stored packs' }).selectOption('synthetic-0'); + await page.getByRole('combobox', { name: 'Saved videos' }).selectOption('synthetic-0'); + await openCodeAndSpecTab(page); await expect(page.getByRole('button', { name: 'Clear local acknowledgment' })).toBeVisible(); - await page.getByRole('combobox', { name: 'Stored packs' }).selectOption('synthetic-1'); + await page.getByRole('combobox', { name: 'Saved videos' }).selectOption('synthetic-1'); await expect(review).toContainText('Grounded specification unavailable for this pack.'); await expect(acknowledgment).toHaveCount(0); - await page.getByRole('combobox', { name: 'Stored packs' }).selectOption('synthetic-2'); + await page.getByRole('combobox', { name: 'Saved videos' }).selectOption('synthetic-2'); await expect(review).toContainText('Content digest does not match.'); await expect(acknowledgment).toBeDisabled(); await expect(page.getByRole('button', { name: 'Clear local acknowledgment' })).toHaveCount(0); - await page.getByRole('combobox', { name: 'Stored packs' }).selectOption('synthetic-0'); + await page.getByRole('combobox', { name: 'Saved videos' }).selectOption('synthetic-0'); await page.getByRole('button', { name: 'Clear local acknowledgment' }).click(); await expect(acknowledgment).toBeEnabled(); await page.reload(); - await page.getByRole('combobox', { name: 'Stored packs' }).selectOption('synthetic-0'); + await page.getByRole('combobox', { name: 'Saved videos' }).selectOption('synthetic-0'); + await openCodeAndSpecTab(page); await expect(acknowledgment).toBeEnabled(); await expect(page.getByRole('button', { name: 'Clear local acknowledgment' })).toHaveCount(0); - await expect(page.getByTestId('studio-deploy-button')).toHaveText('Check preflight'); + await expect(page.getByTestId('studio-ide-ship')).toHaveText('Export'); + await expect(page.getByTestId('studio-deploy-button')).toHaveCount(0); expect(unexpected).toEqual([]); }); } @@ -110,7 +122,8 @@ test('synthetic storage failure is session-only and cannot survive reload', asyn await page.getByRole('button', { name: 'Acknowledge review', exact: true }).click(); await expect(page.getByTestId('grounded-spec-review')).toContainText('Session-only review state — not saved for reload.'); await page.reload(); - await page.getByRole('combobox', { name: 'Stored packs' }).selectOption('synthetic-0'); + await page.getByRole('combobox', { name: 'Saved videos' }).selectOption('synthetic-0'); + await openCodeAndSpecTab(page); await expect(page.getByRole('button', { name: 'Acknowledge review', exact: true })).toBeEnabled(); await expect(page.getByRole('button', { name: 'Clear local acknowledgment' })).toHaveCount(0); expect(unexpected).toEqual([]); diff --git a/apps/web/playwright/studio-accessibility.spec.ts b/apps/web/playwright/studio-accessibility.spec.ts index 12eac71ab..d58b148d3 100644 --- a/apps/web/playwright/studio-accessibility.spec.ts +++ b/apps/web/playwright/studio-accessibility.spec.ts @@ -28,7 +28,7 @@ async function expectNoOverflow(page: Page) { expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true); } -for (const width of [390, 900]) { +for (const width of [390, 640]) { test(`selected Studio tabs stay visually distinct and retain a main landmark at ${width}px`, async ({ page }) => { await openStudio(page, width); const main = page.getByRole('main'); @@ -64,26 +64,62 @@ for (const width of [390, 900]) { }); } -for (const width of [901, 1000, 1100, 1280, 1440]) { - test(`Studio renders the split workbench (Source + Chat left, Deliverables right) at ${width}px`, async ({ page }) => { +for (const width of [720, 900, 1000, 1280, 1440]) { + test(`Studio renders side-by-side split workbench with single-row 4-tab Deliverables at ${width}px`, async ({ page }) => { await openStudio(page, width); await expect(page.getByRole('main')).toHaveCount(1); await expect(page.getByRole('main')).toBeVisible(); - const videoBox = await page.getByTestId('studio-ide-video-pane').boundingBox(); - const chatBox = await page.getByTestId('studio-ide-chat-pane').boundingBox(); - const outputBox = await page.getByTestId('studio-ide-output-pane').boundingBox(); - expect(videoBox && chatBox && outputBox).toBeTruthy(); - // Deliverables sits side-by-side to the right of Source, near the top of the 900px viewport. - expect(outputBox!.x).toBeGreaterThan(videoBox!.x); - expect(outputBox!.y).toBeLessThanOrEqual(150); - // Source video is height-capped and stacked above Chat in the left column. + + const chatPane = page.getByTestId('studio-ide-chat-pane'); + const videoPane = page.getByTestId('studio-ide-video-pane'); + const outputPane = page.getByTestId('studio-ide-output-pane'); + await expect(chatPane).toBeVisible(); + await expect(videoPane).toBeVisible(); + await expect(outputPane).toBeVisible(); + + const chatBox = await chatPane.boundingBox(); + const videoBox = await videoPane.boundingBox(); + const outputBox = await outputPane.boundingBox(); + expect(chatBox && videoBox && outputBox).toBeTruthy(); + + // Conversation owns the full-height left column; Video + Deliverables share the right column. + expect(chatBox!.x).toBeLessThan(videoBox!.x); + expect(chatBox!.x).toBeLessThan(outputBox!.x); + expect(chatBox!.y).toBeLessThanOrEqual(150); + expect(chatBox!.height).toBeGreaterThan(videoBox!.height); expect(videoBox!.height).toBeLessThanOrEqual(300); - expect(videoBox!.x).toBeLessThanOrEqual(chatBox!.x + 2); - expect(videoBox!.y).toBeLessThan(chatBox!.y); + expect(Math.abs(videoBox!.x - outputBox!.x)).toBeLessThanOrEqual(2); + expect(videoBox!.y).toBeLessThan(outputBox!.y); + expect(outputBox!.y).toBeLessThan(500); + + // Deliverables tablist exposes 4 plain-English tabs on one single non-wrapping row. + const outputTabs = page.getByTestId('studio-ide-output-tablist').getByRole('tab'); + await expect(outputTabs).toHaveCount(4); + await expect(outputTabs).toHaveText(['Preview', 'Tasks & Tools', 'Code & Spec', 'Transcript']); + const tabBoxes = await Promise.all( + [0, 1, 2, 3].map((idx) => outputTabs.nth(idx).boundingBox()), + ); + expect(tabBoxes.every(Boolean)).toBe(true); + const firstTabY = tabBoxes[0]!.y; + for (const box of tabBoxes) { + expect(Math.abs(box!.y - firstTabY)).toBeLessThanOrEqual(4); + } + await expectNoOverflow(page); }); } +test('Home primary navigation links remain visible without horizontal overflow at 720x900 half-screen', async ({ page }) => { + await page.setViewportSize({ width: 720, height: 900 }); + await page.goto('/'); + const primaryNav = page.locator('nav.template-nav').first(); + await expect(primaryNav).toBeVisible(); + for (const label of ['Home', 'Studio', 'Pricing', 'API Docs']) { + await expect(primaryNav.getByRole('link', { name: label, exact: true })).toBeVisible(); + } + await expectNoOverflow(page); +}); + test('Studio collapse/restore controls and responsive breakpoint switching stay accessible', async ({ page }) => { await openStudio(page, 1440); await page.getByRole('button', { name: 'Collapse video pane' }).click(); @@ -96,7 +132,7 @@ test('Studio collapse/restore controls and responsive breakpoint switching stay await page.getByRole('button', { name: 'Show deliverables' }).click(); await expect(page.getByTestId('studio-ide-output-pane')).toBeVisible(); - for (const width of [900, 390, 1280]) { + for (const width of [720, 640, 390, 1280]) { await page.setViewportSize({ width, height: 900 }); await expect(page.getByRole('main')).toBeVisible(); await expectNoOverflow(page); diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index f60b15045..d27bdd957 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -72,10 +72,10 @@ export default async function HomePage() { const showCustomBadge = await customBadge(); return ( -
+