diff --git a/apps/website/e2e/header-models-navigation.spec.ts b/apps/website/e2e/header-models-navigation.spec.ts index aeb98753dc9..1af5642c020 100644 --- a/apps/website/e2e/header-models-navigation.spec.ts +++ b/apps/website/e2e/header-models-navigation.spec.ts @@ -21,9 +21,7 @@ async function expectNoHorizontalOverflow(page: Page) { } for (const viewport of viewports) { - test(`enabled Models navigation fits at ${viewport.name}`, async ({ - page - }) => { + test(`enabled Hub navigation fits at ${viewport.name}`, async ({ page }) => { await page.setViewportSize({ width: viewport.width, height: 900 }) await page.goto('/') @@ -36,7 +34,7 @@ for (const viewport of viewports) { if (viewport.desktopNavigation) { await expect(desktopLinks).toBeVisible() await expect( - desktopLinks.getByRole('link', { name: 'Models', exact: true }) + desktopLinks.getByRole('link', { name: 'Hub', exact: true }) ).toHaveAttribute('href', '/models') await expect(menuButton).toBeHidden() } else { @@ -45,9 +43,10 @@ for (const viewport of viewports) { await menuButton.click() const menu = page.getByRole('dialog', { name: 'Menu' }) await expect(menu).toBeVisible() - await expect( - menu.getByRole('link', { name: /^Models\b/ }) - ).toHaveAttribute('href', '/models') + await expect(menu.getByRole('link', { name: /^Hub\b/ })).toHaveAttribute( + 'href', + '/models' + ) } await expectNoHorizontalOverflow(page) diff --git a/apps/website/e2e/homepage.spec.ts b/apps/website/e2e/homepage.spec.ts index 72c089fb973..d3165c0919a 100644 --- a/apps/website/e2e/homepage.spec.ts +++ b/apps/website/e2e/homepage.spec.ts @@ -278,3 +278,61 @@ test.describe('Get started section links @smoke', () => { ) }) }) + +test.describe('Model discovery row @interaction', () => { + test('a hovered or focused workflow card gives its whole name', async ({ + page, + context + }) => { + await context.route('**/t.comfy.org/**', (route) => + /\/(flags|decide)\//.test(route.request().url()) + ? route.fulfill({ + json: { + featureFlags: { + 'workshop-enabled': true, + 'workshop-workflows-enabled': true + }, + featureFlagPayloads: {} + } + }) + : route.abort('blockedbyclient') + ) + await page.goto('/') + await page + .getByTestId('catalogue-tabs') + .getByRole('button', { name: 'Workflows' }) + .click() + const cards = page.getByTestId('discovery-workflow') + await expect(cards.first()).toBeAttached() + await page.addStyleTag({ + content: + '[data-testid="discovery-marquee"] { animation: none !important }' + }) + + const cut = await cards.evaluateAll((elements) => + elements.findIndex((element) => { + const name = element.querySelector('span[title]') + const box = element.getBoundingClientRect() + return ( + name !== null && + name.scrollWidth > name.clientWidth + 1 && + box.x > 0 && + box.right < window.innerWidth + ) + }) + ) + expect(cut).toBeGreaterThan(-1) + + const card = cards.nth(cut) + const name = card.locator('span[title]') + const overflow = () => + name.evaluate((element) => element.scrollWidth - element.clientWidth) + await card.hover() + await expect.poll(overflow).toBeLessThanOrEqual(1) + + await page.mouse.move(0, 0) + await expect.poll(overflow).toBeGreaterThan(1) + await card.focus() + await expect.poll(overflow).toBeLessThanOrEqual(1) + }) +}) diff --git a/apps/website/e2e/navigation.spec.ts b/apps/website/e2e/navigation.spec.ts index 50d88f953b4..2c4d56e5142 100644 --- a/apps/website/e2e/navigation.spec.ts +++ b/apps/website/e2e/navigation.spec.ts @@ -29,7 +29,7 @@ const minimaxRoute = '/minimax-h3' const minimaxRouteZh = '/zh-CN/minimax-h3' const TOP_LEVEL_LABELS = [ - 'Models', + 'Hub', 'Products', 'Pricing', 'Community', @@ -113,7 +113,7 @@ test.describe('Desktop navigation @smoke', () => { await expect( desktopLinks - .getByRole('link', { name: 'Models' }) + .getByRole('link', { name: 'Hub' }) .getByText('NEW', { exact: true }) ).toBeVisible() for (const label of ['Products', 'Community']) { @@ -326,7 +326,7 @@ test.describe('Mobile menu @mobile', () => { const menu = page.getByRole('dialog') await expect(menu).toBeVisible() - for (const label of ['Models', 'Products', 'Pricing', 'Community']) { + for (const label of ['Hub', 'Products', 'Pricing', 'Community']) { await expect(menu.getByText(label, { exact: true }).first()).toBeVisible() } }) @@ -339,7 +339,7 @@ test.describe('Mobile menu @mobile', () => { const menu = page.getByRole('dialog') await expect( - menu.getByRole('link', { name: 'Models' }).getByText('NEW', { + menu.getByRole('link', { name: 'Hub' }).getByText('NEW', { exact: true }) ).toBeVisible() diff --git a/apps/website/e2e/visual-responsive.spec.ts b/apps/website/e2e/visual-responsive.spec.ts index 2896dfa2677..b1c6b83e64e 100644 --- a/apps/website/e2e/visual-responsive.spec.ts +++ b/apps/website/e2e/visual-responsive.spec.ts @@ -33,7 +33,7 @@ async function navigateAndSettle(page: Page, url: string) { await expect( page .getByTestId('desktop-nav-links') - .getByRole('link', { name: 'Models', includeHidden: true }) + .getByRole('link', { name: 'Hub', includeHidden: true }) ).toBeAttached() await waitForPpFormulaLight(page) } diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-3-lg-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-3-lg-visual-linux.png index 85161954b47..3fc619ce509 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-3-lg-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-3-lg-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-4-xl-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-4-xl-visual-linux.png index 210a5a856c5..78d4aafbecc 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-4-xl-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/enterprise-faq-4-xl-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-3-lg-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-3-lg-visual-linux.png index ea8aac6461c..0aeaaae3200 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-3-lg-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-3-lg-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-4-xl-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-4-xl-visual-linux.png index 08bf11b7b5b..0ec7114b3a6 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-4-xl-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-4-xl-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-3-lg-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-3-lg-visual-linux.png index d97ab7b3269..ed9cbcd307a 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-3-lg-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-3-lg-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-4-xl-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-4-xl-visual-linux.png index a67b970607f..502da14ecd7 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-4-xl-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-4-xl-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-3-lg-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-3-lg-visual-linux.png index 4fb078db892..882dcafd231 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-3-lg-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-3-lg-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-4-xl-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-4-xl-visual-linux.png index 44410114eca..4c5b3ef7021 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-4-xl-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-faq-4-xl-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-3-lg-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-3-lg-visual-linux.png index b1460dc9c8c..7dfc8d62568 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-3-lg-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-3-lg-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-4-xl-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-4-xl-visual-linux.png index b92ddc5b847..4086123a560 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-4-xl-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/pricing-tiers-4-xl-visual-linux.png differ diff --git a/apps/website/e2e/workshop-api-actions.spec.ts b/apps/website/e2e/workshop-api-actions.spec.ts index 1723094a1c1..3a33d39d926 100644 --- a/apps/website/e2e/workshop-api-actions.spec.ts +++ b/apps/website/e2e/workshop-api-actions.spec.ts @@ -1,3 +1,5 @@ +import { readFile } from 'node:fs/promises' + import type { BrowserContext, Locator } from '@playwright/test' import { expect } from '@playwright/test' @@ -78,3 +80,62 @@ test('the workflow API tab opens with the key action and what it needs beside th expect(action.y).toBeLessThanOrEqual(code.y) expect(action.x).toBeGreaterThanOrEqual(code.x + code.width) }) + +test('@mobile the workflow example output is as tall as its 16:9 media', async ({ + page, + context +}) => { + await allowWorkflows(context) + await page.goto(WORKFLOW_PATH) + + const output = page.getByTestId('playground-output') + await expect(output).toHaveAttribute('data-state', 'example') + const media = await frame(output.getByTestId('output-media')) + expect(media.height).toBeCloseTo((media.width * 9) / 16, 0) +}) + +test('@mobile opens a source picture full screen with its close button clear of it', async ({ + page, + context +}) => { + await allowWorkflows(context) + await page.goto(WORKFLOW_PATH) + await page + .locator('input[type=file]') + .first() + .setInputFiles('public/images/cinematic-studio/diner.jpg') + await page + .getByRole('button', { name: /^Expand / }) + .first() + .click() + + const dialog = page.getByTestId('image-source-dialog') + const viewportWidth = page.viewportSize()?.width ?? 0 + await expect + .poll(async () => (await frame(dialog)).width) + .toBeGreaterThan(viewportWidth - 2) + const [close, picture] = await Promise.all([ + frame(dialog.getByRole('button', { name: 'Close' })), + frame(dialog.getByRole('img')) + ]) + expect(close.y + close.height).toBeLessThanOrEqual(picture.y) +}) + +test('the workflow API tab downloads the API graph as JSON', async ({ + page, + context +}) => { + await allowWorkflows(context) + await page.goto(WORKFLOW_PATH) + await page.getByRole('tab', { name: 'API', exact: true }).click() + + const [download] = await Promise.all([ + page.waitForEvent('download'), + page.getByRole('button', { name: /Download the API graph/ }).click() + ]) + expect(download.suggestedFilename()).toBe('remove-background-api.json') + const path = await download.path() + const graph = await readFile(path, 'utf8') + expect(Object.keys(JSON.parse(graph))).not.toHaveLength(0) + expect(graph).toContain('"class_type"') +}) diff --git a/apps/website/e2e/workshop-apps.spec.ts b/apps/website/e2e/workshop-apps.spec.ts index 73be193df75..b7b2f1f7a20 100644 --- a/apps/website/e2e/workshop-apps.spec.ts +++ b/apps/website/e2e/workshop-apps.spec.ts @@ -73,3 +73,111 @@ test('sends the old studio address to the app page it named', async ({ await page.goto('/cinematic-studio/?app=reshoot&ux=d&model=flux') await expect(page).toHaveURL(/\/models\/apps\/reshoot\/\?ux=d&model=flux$/) }) + +test.describe('GitHub link before an app repo is published', () => { + for (const path of [ + '/models/apps/cinematic-studio/', + '/models/apps/reshoot/' + ]) + test(`shows a placeholder, not a link, on ${path}`, async ({ + page, + context + }) => { + await mockFlags(context, { apps: true, workflows: false }) + await page.goto(path) + await expect(page.getByText('GitHub · Coming soon')).toHaveCount(1) + await expect( + page.getByRole('link', { name: 'View on GitHub' }) + ).toHaveCount(0) + }) +}) + +test('asks Safari for a first frame on the Re-shoot example video tile', async ({ + page, + context +}) => { + await mockFlags(context, { apps: true, workflows: false }) + await page.goto('/models/apps/reshoot/') + await expect(page.getByTestId('example-video')).toHaveAttribute( + 'src', + /#t=0\.1$/ + ) +}) + +test('@mobile keeps the Re-shoot aim badges to one line on a phone', async ({ + page, + context +}) => { + await mockFlags(context, { apps: true, workflows: false }) + await page.goto('/models/apps/reshoot/') + await page.getByText('Sci-fi pilot').first().click() + + const viewport = page.getByTestId('reshoot-viewport').first() + await expect( + viewport.getByText('Drag to orbit', { exact: true }) + ).toBeVisible() + await expect(viewport.getByText(/Scroll to move closer/)).toBeHidden() + + for (const badge of [ + viewport.getByTestId('reshoot-drag-hint'), + viewport.getByTestId('reshoot-angle-readout') + ]) { + const box = await badge.boundingBox() + expect(box?.height).toBeLessThan(40) + } +}) + +test('@mobile pins the Re-shoot preview while the camera controls scroll under it', async ({ + page, + context +}) => { + await mockFlags(context, { apps: true, workflows: false }) + await page.goto('/models/apps/reshoot/') + await page.getByText('Sci-fi pilot').first().click() + + const frame = page.getByTestId('reshoot-frame') + const distance = page.getByRole('slider', { name: /Distance/ }) + await page.getByTestId('reshoot-action').scrollIntoViewIfNeeded() + const pinned = await frame.boundingBox() + expect(pinned?.y).toBeGreaterThanOrEqual(0) + expect(pinned?.y).toBeLessThan(120) + + const before = Number(await distance.inputValue()) + await page.getByRole('button', { name: 'Move the camera closer' }).tap() + await expect + .poll(async () => Number(await distance.inputValue())) + .toBeLessThan(before) +}) + +test('shows a preview frame for every Cinematic Studio shot option', async ({ + page, + context +}) => { + await mockFlags(context, { apps: true, workflows: false }) + await page.goto('/models/apps/cinematic-studio/') + await page + .getByRole('button', { name: /^Shot\b/ }) + .first() + .click() + + const shots = page.getByRole('radiogroup', { name: 'Shot' }) + await expect(shots.getByRole('radio')).toHaveCount(8) + await expect( + shots.locator('img[src^="/images/cinematic-studio/options/shot-"]') + ).toHaveCount(7) + for (const id of [ + 'xwide', + 'wide', + 'medium', + 'close', + 'xclose', + 'ots', + 'low' + ]) { + await expect( + shots.locator( + `img[src="/images/cinematic-studio/options/shot-${id}.jpg"]` + ) + ).toHaveCount(1) + } +}) diff --git a/apps/website/e2e/workshop-visibility.spec.ts b/apps/website/e2e/workshop-visibility.spec.ts index ad53b0db17e..b5b45f4b968 100644 --- a/apps/website/e2e/workshop-visibility.spec.ts +++ b/apps/website/e2e/workshop-visibility.spec.ts @@ -28,7 +28,7 @@ test('keeps the public site when PostHog is unavailable', async ({ page }) => { }) await page.goto('/') await expect( - page.getByRole('link', { name: 'Models', exact: true }) + page.getByRole('link', { name: 'Hub', exact: true }) ).toHaveCount(0) await expect(page.getByTestId('model-discovery')).toHaveCount(0) await expect( diff --git a/apps/website/e2e/workshop-workflows.spec.ts b/apps/website/e2e/workshop-workflows.spec.ts index b31a9334923..cc365112b80 100644 --- a/apps/website/e2e/workshop-workflows.spec.ts +++ b/apps/website/e2e/workshop-workflows.spec.ts @@ -80,7 +80,7 @@ test('workflow launch groups lead to the existing shared form', async ({ await page.getByTestId('sort-name').click() await expect( page.getByTestId('workflow-search-results').getByRole('link').first() - ).toHaveAttribute('href', '/models/workflows/animate-reference-sheet/') + ).toHaveAttribute('href', '/models/workflows/connect-images-with-motion/') await page.getByTestId('section-back').click() await expect(page.getByTestId('workshop-hero')).toBeVisible() await page.getByTestId('workshop-search').fill('Change a material') @@ -103,7 +103,7 @@ test('workflow launch groups lead to the existing shared form', async ({ ).toBeVisible() const prompt = page.getByRole('textbox', { name: 'What should change?' }) await expect(prompt).toHaveValue( - 'Change the furniture leather difference in image 1 to the fur material in image 2.' + 'Give the sofa the fur texture from the material reference instead of its leather.' ) await prompt.fill('Use the material from the second image.') await page @@ -177,24 +177,29 @@ test('the Details graph waits for its tab, names its subgraphs, and zooms from i expect(graphRequests).toHaveLength(1) await expect(drawing).toContainText('Image to Video (LTX-2.3)') + // Fitting the whole drawing into the panel renders its titles at a few + // pixels, so it opens zoomed onto the node the workflow starts from. + const zoom = () => + graph + .getByText('%') + .evaluate((el) => Number(el.textContent.replace('%', ''))) + const opening = await zoom() + expect(opening).toBeGreaterThan(100) + // The controls sit inside the draggable frame; a press on them has to reach // them rather than the frame. await graph.getByRole('button', { name: 'Zoom in' }).click() - await expect(graph).toContainText('120%') + await expect.poll(zoom).toBeGreaterThan(opening) const frame = await graph.boundingBox() const drawn = await drawing.locator('g').first().boundingBox() - const centre = { - x: drawn!.x + drawn!.width / 2, - y: drawn!.y + drawn!.height / 2 - } - // Zooming keeps the drawing where it was rather than carrying it off-frame. - expect(centre.x).toBeGreaterThan(frame!.x) - expect(centre.x).toBeLessThan(frame!.x + frame!.width) - expect(centre.y).toBeGreaterThan(frame!.y) - expect(centre.y).toBeLessThan(frame!.y + frame!.height) + // Zooming keeps the drawing under the frame rather than carrying it off. + expect(drawn!.x).toBeLessThan(frame!.x + frame!.width) + expect(drawn!.x + drawn!.width).toBeGreaterThan(frame!.x) + expect(drawn!.y).toBeLessThan(frame!.y + frame!.height) + expect(drawn!.y + drawn!.height).toBeGreaterThan(frame!.y) await graph.getByRole('button', { name: 'Reset' }).click() - await expect(graph).toContainText('100%') + await expect.poll(zoom).toBe(opening) }) test('withholds workflow discovery and direct pages when the workflow flag is off', async ({ @@ -513,3 +518,58 @@ test('keeps the workflow form inside a phone screen @mobile', async ({ const box = await footer.boundingBox() expect((box?.x ?? 0) + (box?.width ?? 0)).toBeLessThanOrEqual(viewportWidth) }) + +test('@mobile keeps the catalogue tabs in place when a tab changes the hero subtitle', async ({ + page, + context +}) => { + await mockWorkflowVisibility(context, true) + await page.goto('/models/') + const models = page.getByTestId('catalogue-tab-models') + const workflows = page.getByTestId('catalogue-tab-workflows') + await expect(workflows).toBeVisible() + const before = await workflows.boundingBox() + + await workflows.click() + await expect(workflows).toHaveAttribute('aria-pressed', 'true') + expect((await workflows.boundingBox())?.y).toBeCloseTo(before?.y ?? 0, 0) + + await models.click() + await expect(models).toHaveAttribute('aria-pressed', 'true') + expect((await models.boundingBox())?.y).toBeCloseTo(before?.y ?? 0, 0) +}) + +test('@mobile stretches the catalogue tabs across the toolbar on a phone', async ({ + page, + context +}) => { + await mockWorkflowVisibility(context, true) + await page.goto('/models/') + const toolbar = page.getByTestId('workshop-toolbar') + const tabs = toolbar.getByTestId('catalogue-tabs') + await expect(tabs).toBeVisible() + + const [bar, group] = await Promise.all([ + toolbar.boundingBox(), + tabs.boundingBox() + ]) + expect(Math.abs((bar?.width ?? 0) - (group?.width ?? 0))).toBeLessThan(12) +}) + +test('the examples below the form read and mark themselves like a model page', async ({ + page, + context +}) => { + await mockWorkflowVisibility(context, true) + await page.goto('/models/workflows/change-material/') + + await expect( + page.getByRole('heading', { name: 'Try an example' }) + ).toBeVisible() + + const example = page.getByRole('button', { + name: /A softer finish for a leather sofa/ + }) + await expect(example).toHaveAttribute('aria-current', 'true') + await expect(page.getByTestId('workflow-example-chosen')).toHaveCount(1) +}) diff --git a/apps/website/e2e/workshop.spec.ts b/apps/website/e2e/workshop.spec.ts index 16d01a859a5..792315618f6 100644 --- a/apps/website/e2e/workshop.spec.ts +++ b/apps/website/e2e/workshop.spec.ts @@ -290,6 +290,21 @@ test.describe('Models catalog', () => { await expect(page.getByTestId('workshop-sections')).toBeVisible() }) + test('an opened shelf reads as a chosen filter', async ({ page }) => { + await page.goto('/models/') + await page.getByTestId('section-generate-videos-open').click() + await expect(page.getByRole('heading', { level: 1 })).toContainText( + 'Generate videos' + ) + await expect(page.getByTestId('workshop-filter-count')).toHaveText('1') + await page.getByTestId('workshop-filter').click() + await expect(page.getByTestId('workshop-filter-applied')).toHaveText( + '1 selected' + ) + await page.getByTestId('workshop-filter-clear').click() + await expect(page.getByTestId('workshop-sections')).toBeVisible() + }) + test('a model page returns to the shelf it was opened from', async ({ page }) => { @@ -531,6 +546,65 @@ test.describe('Models catalog', () => { }) test.describe('Model playground', () => { + test('keeps a long prompt whole instead of scrolling it out of sight', async ({ + page + }) => { + await page.goto(MODEL_PATH) + const prompt = page.getByTestId('field-prompt') + const hidden = () => + prompt.evaluate((box) => box.scrollHeight - box.clientHeight) + const height = () => prompt.evaluate((box) => box.clientHeight) + + await prompt.fill( + Array.from({ length: 12 }, (_, line) => `Line ${line + 1}.`).join('\n') + ) + await expect.poll(hidden).toBeLessThanOrEqual(1) + const tall = await height() + + await prompt.fill('One line.') + await expect.poll(height).toBeLessThan(tall) + await expect.poll(hidden).toBeLessThanOrEqual(1) + }) + + test('keeps a long prompt whole when the layout narrows under it', async ({ + page + }) => { + await page.goto(MODEL_PATH) + const prompt = page.getByTestId('field-prompt') + const hidden = () => + prompt.evaluate((box) => box.scrollHeight - box.clientHeight) + + await prompt.fill( + 'A slow push-in on a glass teapot lit from behind by a low winter sun, steam rising and catching the light while the room around it stays in shadow, the reflections on the table kept sharp and the background soft, with no people, no text and no logos anywhere in the frame.' + ) + await expect.poll(hidden).toBeLessThanOrEqual(1) + + await page.setViewportSize({ width: 380, height: 900 }) + + await expect.poll(hidden).toBeLessThanOrEqual(1) + }) + + test('stops the prompt box short of swallowing the window', async ({ + page + }) => { + await page.setViewportSize({ width: 1280, height: 800 }) + await page.goto(MODEL_PATH) + const prompt = page.getByTestId('field-prompt') + + await prompt.fill( + Array.from({ length: 60 }, (_, line) => `Line ${line + 1}.`).join('\n') + ) + + // A prompt this long would bury the rest of the form, so the box keeps a + // share of the window and scrolls what is left. + await expect + .poll(() => prompt.evaluate((box) => box.clientHeight)) + .toBeLessThan(800) + await expect + .poll(() => prompt.evaluate((box) => box.scrollHeight - box.clientHeight)) + .toBeGreaterThan(1) + }) + test('puts data-declared parameters in the Advanced disclosure', async ({ page }) => { @@ -593,7 +667,7 @@ test.describe('Model playground', () => { await page .getByRole('navigation', { name: 'Main navigation', exact: true }) - .getByRole('link', { name: 'Models', exact: true }) + .getByRole('link', { name: 'Hub', exact: true }) .click() await page.getByTestId('workshop-search').fill('Seedream 4.5 Image Edit') await page.getByRole('link', { name: /Seedream 4\.5 Image Edit/ }).click() @@ -711,6 +785,13 @@ test.describe('Model playground', () => { await prompt.fill('') await page.getByTestId('example-card').first().click() + const dialog = page.getByTestId('example-replace-dialog') + await expect(dialog.getByRole('heading')).toHaveText('Load this example?') + await expect(dialog.getByRole('button')).toHaveCount(2) + await expect(dialog.getByRole('button', { name: 'Cancel' })).toBeVisible() + await expect( + dialog.getByRole('button', { name: 'Load example' }) + ).toBeVisible() await page.getByTestId('example-replace-keep').click() await expect(page.getByTestId('example-replace-dialog')).toHaveCount(0) diff --git a/apps/website/public/images/cinematic-studio/options/film-bleach.jpg b/apps/website/public/images/cinematic-studio/options/film-bleach.jpg new file mode 100644 index 00000000000..49c37e8f67e Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-bleach.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/film-bw400.jpg b/apps/website/public/images/cinematic-studio/options/film-bw400.jpg new file mode 100644 index 00000000000..a30e8fa7c08 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-bw400.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/film-clean.jpg b/apps/website/public/images/cinematic-studio/options/film-clean.jpg new file mode 100644 index 00000000000..49fb9027c7d Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-clean.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/film-d250.jpg b/apps/website/public/images/cinematic-studio/options/film-d250.jpg new file mode 100644 index 00000000000..ec7b320d383 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-d250.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/film-expired.jpg b/apps/website/public/images/cinematic-studio/options/film-expired.jpg new file mode 100644 index 00000000000..af3d996e7a5 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-expired.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/film-slide.jpg b/apps/website/public/images/cinematic-studio/options/film-slide.jpg new file mode 100644 index 00000000000..fa83e3540da Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-slide.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/film-t500.jpg b/apps/website/public/images/cinematic-studio/options/film-t500.jpg new file mode 100644 index 00000000000..f23bdb136f0 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/film-t500.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-blue.jpg b/apps/website/public/images/cinematic-studio/options/light-blue.jpg new file mode 100644 index 00000000000..a027747dba6 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-blue.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-golden.jpg b/apps/website/public/images/cinematic-studio/options/light-golden.jpg new file mode 100644 index 00000000000..1d439a997c3 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-golden.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-lowkey.jpg b/apps/website/public/images/cinematic-studio/options/light-lowkey.jpg new file mode 100644 index 00000000000..c74fb58341d Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-lowkey.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-neon.jpg b/apps/website/public/images/cinematic-studio/options/light-neon.jpg new file mode 100644 index 00000000000..a47616d49f0 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-neon.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-night.jpg b/apps/website/public/images/cinematic-studio/options/light-night.jpg new file mode 100644 index 00000000000..7695beaa40f Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-night.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-overcast.jpg b/apps/website/public/images/cinematic-studio/options/light-overcast.jpg new file mode 100644 index 00000000000..f48a6c45d01 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-overcast.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/light-silhouette.jpg b/apps/website/public/images/cinematic-studio/options/light-silhouette.jpg new file mode 100644 index 00000000000..4168de8cc1f Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/light-silhouette.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-doc.jpg b/apps/website/public/images/cinematic-studio/options/look-doc.jpg new file mode 100644 index 00000000000..15571e9d43f Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-doc.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-drama.jpg b/apps/website/public/images/cinematic-studio/options/look-drama.jpg new file mode 100644 index 00000000000..a0fcf807af2 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-drama.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-neonoir.jpg b/apps/website/public/images/cinematic-studio/options/look-neonoir.jpg new file mode 100644 index 00000000000..3951011b661 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-neonoir.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-road.jpg b/apps/website/public/images/cinematic-studio/options/look-road.jpg new file mode 100644 index 00000000000..f02721bfcc5 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-road.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-scifi.jpg b/apps/website/public/images/cinematic-studio/options/look-scifi.jpg new file mode 100644 index 00000000000..750f6c5ffb8 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-scifi.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-thriller.jpg b/apps/website/public/images/cinematic-studio/options/look-thriller.jpg new file mode 100644 index 00000000000..aef25b2bd91 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-thriller.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/look-western.jpg b/apps/website/public/images/cinematic-studio/options/look-western.jpg new file mode 100644 index 00000000000..61d41b162cd Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/look-western.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-close.jpg b/apps/website/public/images/cinematic-studio/options/shot-close.jpg new file mode 100644 index 00000000000..7a140f8dcbb Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-close.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-low.jpg b/apps/website/public/images/cinematic-studio/options/shot-low.jpg new file mode 100644 index 00000000000..4c564547be6 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-low.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-medium.jpg b/apps/website/public/images/cinematic-studio/options/shot-medium.jpg new file mode 100644 index 00000000000..98f546f2783 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-medium.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-ots.jpg b/apps/website/public/images/cinematic-studio/options/shot-ots.jpg new file mode 100644 index 00000000000..7c1a9ff41d1 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-ots.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-wide.jpg b/apps/website/public/images/cinematic-studio/options/shot-wide.jpg new file mode 100644 index 00000000000..3ca62c1ee3c Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-wide.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-xclose.jpg b/apps/website/public/images/cinematic-studio/options/shot-xclose.jpg new file mode 100644 index 00000000000..041f38723f6 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-xclose.jpg differ diff --git a/apps/website/public/images/cinematic-studio/options/shot-xwide.jpg b/apps/website/public/images/cinematic-studio/options/shot-xwide.jpg new file mode 100644 index 00000000000..a495b98dcf0 Binary files /dev/null and b/apps/website/public/images/cinematic-studio/options/shot-xwide.jpg differ diff --git a/apps/website/public/workflow-graphs/remove-object.json b/apps/website/public/workflow-graphs/remove-object.json index 93400b88309..b9cb0977950 100644 --- a/apps/website/public/workflow-graphs/remove-object.json +++ b/apps/website/public/workflow-graphs/remove-object.json @@ -140,7 +140,7 @@ "id": 16, "type": "LoadImageMask", "title": "Edit mask (white = edit)", - "pos": [300, 600], + "pos": [-2900, 5390], "size": [300, 310], "flags": {}, "order": 0, diff --git a/apps/website/public/workflow-graphs/remove-object.svg b/apps/website/public/workflow-graphs/remove-object.svg index 4c408a50a1a..48338fb0e13 100644 --- a/apps/website/public/workflow-graphs/remove-object.svg +++ b/apps/website/public/workflow-graphs/remove-object.svg @@ -1 +1 @@ -Workflow graph and nested graphsOriginal node positions and connections. Notes and widget previews are available in the downloadable workflow.Workflow overviewLoad ImageIMAGEMASKSave Image AdvancedimagesimagesImage Compareimage_aimage_bBria EraserimagemaskIMAGEEdit mask (white = edit)MASK +Workflow graph and nested graphsOriginal node positions and connections. Notes and widget previews are available in the downloadable workflow.Workflow overviewLoad ImageIMAGEMASKSave Image AdvancedimagesimagesImage Compareimage_aimage_bBria EraserimagemaskIMAGEEdit mask (white = edit)MASK diff --git a/apps/website/src/components/common/HeaderMain/HeaderMain.test.ts b/apps/website/src/components/common/HeaderMain/HeaderMain.test.ts index c0cfa2b7390..7607d487ca5 100644 --- a/apps/website/src/components/common/HeaderMain/HeaderMain.test.ts +++ b/apps/website/src/components/common/HeaderMain/HeaderMain.test.ts @@ -47,13 +47,13 @@ describe('HeaderMain workshop gating', () => { { workshopInBuild: true, enabled: false, modelsAvailable: false }, { workshopInBuild: true, enabled: true, modelsAvailable: true } ])( - 'renders Models availability as $modelsAvailable when workshopInBuild is $workshopInBuild', + 'renders Hub availability as $modelsAvailable when workshopInBuild is $workshopInBuild', async ({ workshopInBuild, enabled, modelsAvailable }) => { visibility.value = enabled renderHeader(workshopInBuild) await nextTick() - expect(screen.queryByRole('link', { name: /^Models\b/i }) !== null).toBe( + expect(screen.queryByRole('link', { name: /^Hub\b/i }) !== null).toBe( modelsAvailable ) } @@ -180,14 +180,14 @@ describe('HeaderMain workshop gating', () => { it('updates navigation and removes the account controls when access is revoked', async () => { flag.value = true renderHeader(true) - expect(screen.queryByRole('link', { name: /^Models\b/i })).toBeNull() + expect(screen.queryByRole('link', { name: /^Hub\b/i })).toBeNull() expect(screen.queryByTestId('header-account')).toBeNull() visibility.value = true - await screen.findByRole('link', { name: /^Models\b/i }) + await screen.findByRole('link', { name: /^Hub\b/i }) visibility.value = false await nextTick() - expect(screen.queryByRole('link', { name: /^Models\b/i })).toBeNull() + expect(screen.queryByRole('link', { name: /^Hub\b/i })).toBeNull() expect(screen.queryByTestId('header-account')).toBeNull() }) }) diff --git a/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts b/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts index 57781428b8e..e2104228e21 100644 --- a/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts +++ b/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts @@ -8,15 +8,15 @@ async function modelsLink(path: string) { history.replaceState(null, '', path) render(HeaderMainDesktop, { props: { workshopInBuild: true } }) await nextTick() - return screen.getByRole('link', { name: /^Models\b/i }) + return screen.getByRole('link', { name: /^Hub\b/i }) } describe('HeaderMainDesktop', () => { - it('does not add Models navigation without a build opt-in', () => { + it('does not add Hub navigation without a build opt-in', () => { render(HeaderMainDesktop) - expect(screen.queryByRole('link', { name: /^Models\b/i })).toBeNull() + expect(screen.queryByRole('link', { name: /^Hub\b/i })).toBeNull() }) - it('renders the Models leaf link with its NEW badge', async () => { + it('renders the Hub leaf link with its NEW badge', async () => { const link = await modelsLink('/pricing') expect(link.getAttribute('href')).toBe('/models') expect(link.textContent).toMatch(/new/i) @@ -28,7 +28,7 @@ describe('HeaderMainDesktop', () => { expect(link.getAttribute('data-active')).not.toBeNull() }) - it('keeps Products inactive on the Models page it also links to', async () => { + it('keeps Products inactive on the Hub page it also links to', async () => { await modelsLink('/models') const products = screen.getByRole('button', { name: /products/i }) expect(products.getAttribute('data-active')).toBeNull() diff --git a/apps/website/src/components/common/HeaderMain/HeaderMainMobile.test.ts b/apps/website/src/components/common/HeaderMain/HeaderMainMobile.test.ts index 796d9691c7d..e06d3f8eb01 100644 --- a/apps/website/src/components/common/HeaderMain/HeaderMainMobile.test.ts +++ b/apps/website/src/components/common/HeaderMain/HeaderMainMobile.test.ts @@ -11,16 +11,16 @@ async function openMenu(workshopInBuild: boolean) { } describe('HeaderMainMobile', () => { - it('omits Models when the workshop is not in the build', async () => { + it('omits the Hub when the workshop is not in the build', async () => { await openMenu(false) - expect(screen.queryByRole('link', { name: /^Models\b/i })).toBeNull() + expect(screen.queryByRole('link', { name: /^Hub\b/i })).toBeNull() }) - it('offers Models when the workshop is in the build', async () => { + it('offers the Hub when the workshop is in the build', async () => { await openMenu(true) - expect(screen.getByRole('link', { name: /^Models\b/i })).toBeTruthy() + expect(screen.getByRole('link', { name: /^Hub\b/i })).toBeTruthy() }) it('labels a new top-level section with a NEW badge', async () => { diff --git a/apps/website/src/components/home/DiscoveryWorkflowCard.test.ts b/apps/website/src/components/home/DiscoveryWorkflowCard.test.ts new file mode 100644 index 00000000000..4212a5893c2 --- /dev/null +++ b/apps/website/src/components/home/DiscoveryWorkflowCard.test.ts @@ -0,0 +1,22 @@ +import { render, screen } from '@testing-library/vue' +import { describe, expect, it } from 'vitest' + +import type { DiscoveryWorkflow } from '../../data/modelDiscovery' +import DiscoveryWorkflowCard from './DiscoveryWorkflowCard.vue' + +const workflow: DiscoveryWorkflow = { + name: 'Turn a rough sketch into a finished product render with reflections', + href: '/models/workflows/sketch-to-render/', + thumbnailUrl: '/fixture-workflow.png' +} + +describe('DiscoveryWorkflowCard', () => { + it('keeps the whole name within reach of a name the card cuts short', () => { + render(DiscoveryWorkflowCard, { props: { workflow } }) + + expect(screen.getByText(workflow.name)).toHaveAttribute( + 'title', + workflow.name + ) + }) +}) diff --git a/apps/website/src/components/home/DiscoveryWorkflowCard.vue b/apps/website/src/components/home/DiscoveryWorkflowCard.vue index 5a8e1133eac..9f7f3a0b819 100644 --- a/apps/website/src/components/home/DiscoveryWorkflowCard.vue +++ b/apps/website/src/components/home/DiscoveryWorkflowCard.vue @@ -14,12 +14,15 @@ const { workflow } = defineProps<{ workflow: DiscoveryWorkflow }>() class="absolute inset-0 size-full object-cover transition-transform duration-300 group-hover/card:scale-105" />