diff --git a/apps/website/src/components/workshop/WorkflowResults.test.ts b/apps/website/src/components/workshop/WorkflowResults.test.ts
index 1359c1d1436..1190aafd6d4 100644
--- a/apps/website/src/components/workshop/WorkflowResults.test.ts
+++ b/apps/website/src/components/workshop/WorkflowResults.test.ts
@@ -262,7 +262,7 @@ describe('a refused request', () => {
expect(
screen.getAllByText('Not enough credits. Add credits to continue.').length
).toBeGreaterThan(0)
- expect(screen.queryByText('An example from this template.')).toBeNull()
+ expect(screen.queryByTestId('output-example')).toBeNull()
})
// The panel already knows how to send a reader to buy credits; it was never
@@ -285,7 +285,7 @@ describe('a refused request', () => {
it('shows nothing rather than the example for a refusal it cannot word', () => {
mountRefused('access_denied')
- expect(screen.queryByText('An example from this template.')).toBeNull()
+ expect(screen.queryByTestId('output-example')).toBeNull()
expect(screen.getByText('Your output will appear here.')).toBeTruthy()
})
})
diff --git a/apps/website/src/components/workshop/WorkflowResults.vue b/apps/website/src/components/workshop/WorkflowResults.vue
index 1996d3ea09a..de7cf460a9c 100644
--- a/apps/website/src/components/workshop/WorkflowResults.vue
+++ b/apps/website/src/components/workshop/WorkflowResults.vue
@@ -209,7 +209,6 @@ function captureDownload(kind: RunOutput['kind']) {
:state="outputState"
:attachments="outputs.slice(1)"
:now="now.getTime()"
- :model-name="model.name"
:modality="model.modality"
:retry-disabled="!canStart"
:cancelled-message="t('workshop.workflow.cancelled')"
@@ -221,7 +220,6 @@ function captureDownload(kind: RunOutput['kind']) {
@playback-started="delivery.beginPlayback"
@download="captureDownload"
>
-
+import type { Locale } from '../../i18n/translations'
+import { t } from '../../i18n/translations'
+
+const { locale = 'en' } = defineProps<{ locale?: Locale }>()
+
+
+
+
+ {{ t('workshop.card.comfyApi', locale) }}
+
+
diff --git a/apps/website/src/components/workshop/WorkshopHero.test.ts b/apps/website/src/components/workshop/WorkshopHero.test.ts
index 0ace27a6230..509604c266c 100644
--- a/apps/website/src/components/workshop/WorkshopHero.test.ts
+++ b/apps/website/src/components/workshop/WorkshopHero.test.ts
@@ -30,6 +30,24 @@ describe('WorkshopHero', () => {
expect(screen.queryByText('Browse')).toBeNull()
})
+ it('reserves room for every subtitle it may switch to, hidden from readers', () => {
+ render(WorkshopHero, {
+ props: {
+ heading: 'What will you make next?',
+ subtitle: 'Short',
+ subtitleSpace: ['Short', 'A much longer subtitle for another tab']
+ }
+ })
+
+ const space = screen.getAllByTestId('hero-subtitle-space')
+ expect(space.map((line) => line.textContent)).toEqual([
+ 'Short',
+ 'A much longer subtitle for another tab'
+ ])
+ for (const line of space)
+ expect(line).toHaveAttribute('aria-hidden', 'true')
+ })
+
// The live catalogue puts its tabs where the eyebrow goes, so a section that
// fills the slot replaces the line rather than sitting under it.
it('gives the eyebrow line up to whatever fills its slot', () => {
diff --git a/apps/website/src/components/workshop/WorkshopHero.vue b/apps/website/src/components/workshop/WorkshopHero.vue
index d6993a6bb39..439671a4dc3 100644
--- a/apps/website/src/components/workshop/WorkshopHero.vue
+++ b/apps/website/src/components/workshop/WorkshopHero.vue
@@ -7,10 +7,16 @@ import SplitReveal from './SplitReveal.vue'
// The copy arrives resolved, so the hero belongs to whichever catalogue renders
// it rather than to one section's translation table.
-const { eyebrow, heading, subtitle } = defineProps<{
+const {
+ eyebrow,
+ heading,
+ subtitle,
+ subtitleSpace = []
+} = defineProps<{
eyebrow?: string
heading: string
subtitle?: string
+ subtitleSpace?: readonly string[]
}>()
const slots = useSlots()
@@ -42,8 +48,18 @@ const slots = useSlots()
diff --git a/apps/website/src/components/workshop/WorkshopModelCard.test.ts b/apps/website/src/components/workshop/WorkshopModelCard.test.ts
index 43904b1dbaa..248fd673065 100644
--- a/apps/website/src/components/workshop/WorkshopModelCard.test.ts
+++ b/apps/website/src/components/workshop/WorkshopModelCard.test.ts
@@ -22,6 +22,41 @@ const base: WorkshopModel = {
}
describe('WorkshopModelCard', () => {
+ // Every workflow but a couple runs on the shared Cloud endpoint, so a mark
+ // on all of them would mark nothing.
+ const workflow = (slug: string): WorkshopModel => ({
+ slug,
+ name: 'Remove an object from a video',
+ workflowCount: 1,
+ href: `/models/${slug}/`,
+ type: 'CLOUD',
+ workflowId: 'ltx2-obscura-remova',
+ capabilities: [],
+ modality: 'video'
+ })
+
+ it.for([
+ { case: 'a model', model: base },
+ {
+ case: 'a workflow on the shared endpoint',
+ model: workflow('workflows/remove-object')
+ }
+ ])('says nothing about Comfy API for $case', ({ model }) => {
+ render(WorkshopModelCard, { props: { model } })
+
+ expect(screen.queryByTestId('model-card-comfy-api')).toBeNull()
+ })
+
+ it('marks a workflow that runs on its own deployment', () => {
+ render(WorkshopModelCard, {
+ props: { model: workflow('workflows/remove-object-from-video') }
+ })
+
+ expect(screen.getByTestId('model-card-comfy-api')).toHaveTextContent(
+ 'Comfy API'
+ )
+ })
+
it('links the name, provider badge and task to the model page', () => {
render(WorkshopModelCard, { props: { model: base } })
const link = screen.getByTestId('workshop-model-card')
diff --git a/apps/website/src/components/workshop/WorkshopModelCard.vue b/apps/website/src/components/workshop/WorkshopModelCard.vue
index 602857a8de9..0c95ef9274a 100644
--- a/apps/website/src/components/workshop/WorkshopModelCard.vue
+++ b/apps/website/src/components/workshop/WorkshopModelCard.vue
@@ -6,9 +6,11 @@ import type { Locale } from '../../i18n/translations'
import { t } from '../../i18n/translations'
import HubTypeBadge from '../hub/HubTypeBadge.vue'
import { getLogoPath } from '../../lib/hub/model-logos'
-import { taskLabelFor } from '../../lib/workshop/task-label'
+import { nameWithoutTask, taskLabelFor } from '../../lib/workshop/task-label'
+import { runsOnComfyApi } from '../../lib/workshop/comfy-api-workflows'
import TagRow from '../hub/TagRow.vue'
import ModelSupport from './ModelSupport.vue'
+import WorkshopCardApiMark from './WorkshopCardApiMark.vue'
import WorkshopCardMark from './WorkshopCardMark.vue'
import WorkshopCardMedia from './WorkshopCardMedia.vue'
@@ -44,7 +46,12 @@ const logo = computed(
getLogoPath(model.name)
)
+const onComfyApi = computed(
+ () => Boolean(workflow.value) && runsOnComfyApi(model.slug)
+)
+
const taskLabel = computed(() => taskLabelFor(model, locale))
+const cardName = computed(() => nameWithoutTask(model.name, taskLabel.value))
const thumbnailLabel = computed(() =>
model.thumbnail ? model.thumbnailLabel : undefined
)
@@ -70,6 +77,7 @@ const pillClass =
+
- {{ model.name }}
+ {{ cardName }}
diff --git a/apps/website/src/components/workshop/WorkshopModelsGrid.test.ts b/apps/website/src/components/workshop/WorkshopModelsGrid.test.ts
index ee02be61de3..67f60201897 100644
--- a/apps/website/src/components/workshop/WorkshopModelsGrid.test.ts
+++ b/apps/website/src/components/workshop/WorkshopModelsGrid.test.ts
@@ -1,16 +1,13 @@
import userEvent from '@testing-library/user-event'
import { render, screen, waitFor, within } from '@testing-library/vue'
-import { afterEach, describe, expect, it, vi } from 'vitest'
+import { afterEach, describe, expect, it, onTestFinished, vi } from 'vitest'
-import { computed, nextTick } from 'vue'
+import { nextTick } from 'vue'
import type { WorkshopModel } from '../../config/models-catalogue'
import { lastShelf } from '../../lib/workshop/shelf-memory'
-import { useWorkshopAppsEnabled } from '../../scripts/posthog'
import WorkshopModelsGrid from './WorkshopModelsGrid.vue'
-vi.mock(import('../../scripts/posthog'))
-
const models: WorkshopModel[] = [
{
slug: 'kling-ai',
@@ -146,7 +143,7 @@ describe('WorkshopModelsGrid', () => {
expect(cardNames()).toHaveLength(3)
})
- it('clears filter chips without leaving Browse all models', async () => {
+ it('clears the filters without leaving Browse all models', async () => {
const user = userEvent.setup()
render(WorkshopModelsGrid, { props: { models } })
@@ -156,7 +153,7 @@ describe('WorkshopModelsGrid', () => {
await user.click(
within(dialog).getByRole('button', { name: 'Edit images 1' })
)
- await user.click(screen.getByTestId('workshop-filter-chips-clear'))
+ await user.click(within(dialog).getByTestId('workshop-filter-clear'))
expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent(
'All models 3'
@@ -165,21 +162,28 @@ describe('WorkshopModelsGrid', () => {
expect(cardNames()).toHaveLength(3)
})
- it('names the section it was browsing, and leaves it from that name', async () => {
+ // A shelf and the filter are the same choice: opening "Edit images" has to
+ // leave the menu saying so, or the reader sees a narrowed grid with nothing
+ // anywhere to say what narrowed it.
+ it('opens a shelf as the filter it is', async () => {
const user = userEvent.setup()
render(WorkshopModelsGrid, { props: { models } })
await user.click(screen.getByRole('button', { name: 'Edit images' }))
- expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent(
+ expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent(
'Edit images'
)
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('1')
- await user.click(screen.getByRole('button', { name: 'Remove Edit images' }))
- expect(screen.queryByTestId('workshop-filter-chips')).toBeNull()
- expect(cardNames()).toHaveLength(3)
+ await user.click(screen.getByRole('button', { name: 'Use cases' }))
+ const dialog = await screen.findByRole('dialog', { name: 'Use cases' })
+ expect(
+ within(dialog).getByRole('button', { name: 'Edit images 1' })
+ ).toHaveAttribute('aria-pressed', 'true')
+ expect(within(dialog).getByText('1 selected')).toBeTruthy()
})
- it('names the use case it was narrowed by, and lets go of it from that name', async () => {
+ it('counts what the menu narrowed by, and lets go of it from the menu', async () => {
const user = userEvent.setup()
render(WorkshopModelsGrid, { props: { models } })
@@ -188,18 +192,18 @@ describe('WorkshopModelsGrid', () => {
await user.click(
within(dialog).getByRole('button', { name: 'Edit images 1' })
)
- expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent(
- 'Edit images'
- )
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('1')
- await user.click(screen.getByRole('button', { name: 'Remove Edit images' }))
- expect(screen.queryByTestId('workshop-filter-chips')).toBeNull()
+ await user.click(
+ within(dialog).getByRole('button', { name: 'Edit images 1' })
+ )
+ expect(screen.queryByTestId('workshop-filter-count')).toBeNull()
expect(cardNames()).toHaveLength(3)
})
- // A cross that cleared everything would pass a test that only ever set one
- // filter, so this one sets two and keeps the other.
- it('takes off the chip that was pressed and leaves the rest alone', async () => {
+ // Letting go of one choice must not take the others with it, which a test
+ // that only ever sets one would never catch.
+ it('lets go of one use case and leaves the rest alone', async () => {
const user = userEvent.setup()
render(WorkshopModelsGrid, { props: { models } })
@@ -211,23 +215,16 @@ describe('WorkshopModelsGrid', () => {
await user.click(
within(dialog).getByRole('button', { name: 'Generate videos 1' })
)
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('2')
- await user.click(screen.getByRole('button', { name: 'Remove Edit images' }))
- expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent(
- 'Generate videos'
+ await user.click(
+ within(dialog).getByRole('button', { name: 'Edit images 1' })
)
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('1')
expect(cardNames()).toEqual([expect.stringContaining('Kling AI')])
- // The pressed cross went with its chip; focus stays in the row.
- expect(
- screen.getByRole('button', { name: 'Remove Generate videos' })
- ).toHaveFocus()
-
- await user.click(screen.getByTestId('workshop-filter-chips-clear'))
- expect(screen.queryByTestId('workshop-filter-chips')).toBeNull()
- expect(screen.getByRole('button', { name: 'Use cases' })).toHaveFocus()
})
- it('replaces a browsed section with a use-case filter', async () => {
+ it('adds a menu choice to the shelf already open', async () => {
const user = userEvent.setup()
render(WorkshopModelsGrid, { props: { models } })
@@ -238,9 +235,54 @@ describe('WorkshopModelsGrid', () => {
within(dialog).getByRole('button', { name: 'Generate videos 1' })
)
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('2')
+ expect(cardNames()).toHaveLength(2)
+ expect(cardNames()).toEqual(
+ expect.arrayContaining([expect.stringContaining('Kling AI')])
+ )
+ })
+
+ // Coming back from a model, a browser can restore this page from its cache
+ // with the shelf still open, so the reader lands on a narrowed catalogue the
+ // address does not name. Reported by Eric: back should reach all models.
+ it('starts from the address again when the browser restores the page', async () => {
+ const user = userEvent.setup()
+ render(WorkshopModelsGrid, { props: { models } })
+
+ await user.click(screen.getByRole('button', { name: 'Edit images' }))
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('1')
+
+ // A different shelf in the address, so a handler that only emptied the
+ // selection would fail here rather than pass by coincidence.
+ history.replaceState(null, '', '/models/?useCase=generate-videos')
+ onTestFinished(() => history.replaceState(null, '', '/'))
+ const restored = new Event('pageshow')
+ Object.defineProperty(restored, 'persisted', { value: true })
+ window.dispatchEvent(restored)
+
+ await waitFor(() =>
+ expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent(
+ 'Generate videos'
+ )
+ )
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('1')
expect(cardNames()).toEqual([expect.stringContaining('Kling AI')])
})
+ // A first load is a pageshow too, and it must not throw away a shelf the
+ // visitor opened before the page had finished settling.
+ it('keeps the open shelf when the page was not restored', async () => {
+ const user = userEvent.setup()
+ render(WorkshopModelsGrid, { props: { models } })
+
+ await user.click(screen.getByRole('button', { name: 'Edit images' }))
+ window.dispatchEvent(new Event('pageshow'))
+
+ await waitFor(() =>
+ expect(screen.getByTestId('workshop-filter-count')).toHaveTextContent('1')
+ )
+ })
+
it('narrows the use-case menu with its search box', async () => {
const user = userEvent.setup()
render(WorkshopModelsGrid, { props: { models } })
@@ -273,48 +315,41 @@ describe('WorkshopModelsGrid', () => {
expect(cardNames()[0]).toContain('Flux')
})
- it.for([
- { studio: true, lead: ['Cinematic Studio'] },
- { studio: false, lead: [] }
- ])(
- 'keeps Flux 3 out of the featured models (studio flag $studio)',
- ({ studio, lead }) => {
- vi.mocked(useWorkshopAppsEnabled).mockReturnValue(computed(() => studio))
- const featured = [
- {
- slug: 'byteplus--seedance-2-fast-text-to-video--generate-videos',
- name: 'Seedance 2 Fast',
- rank: 32
- },
- {
- slug: 'bfl--flux-3-text-to-video--generate-videos',
- name: 'FLUX.3 Video',
- rank: 63
- },
- {
- slug: 'byteplus--seedream-5-pro--generate-images',
- name: 'Seedream 5 Pro',
- rank: 0
- }
- ].map(({ slug, name, rank }) => ({
- ...models[0],
- slug,
- name,
- href: `/models/${slug}/`,
- recommendedRank: rank,
- thumbnailUrl: `https://example.com/${rank}.webp`
- }))
-
- render(WorkshopModelsGrid, { props: { models: featured } })
-
- const pagination = screen.getByTestId('featured-pagination')
- expect(
- within(pagination)
- .getAllByRole('button')
- .map((button) => button.getAttribute('aria-label'))
- ).toEqual([...lead, 'Seedream 5 Pro', 'Seedance 2 Fast'])
- }
- )
+ it('keeps Flux 3 out of the featured models', () => {
+ const featured = [
+ {
+ slug: 'byteplus--seedance-2-fast-text-to-video--generate-videos',
+ name: 'Seedance 2 Fast',
+ rank: 32
+ },
+ {
+ slug: 'bfl--flux-3-text-to-video--generate-videos',
+ name: 'FLUX.3 Video',
+ rank: 63
+ },
+ {
+ slug: 'byteplus--seedream-5-pro--generate-images',
+ name: 'Seedream 5 Pro',
+ rank: 0
+ }
+ ].map(({ slug, name, rank }) => ({
+ ...models[0],
+ slug,
+ name,
+ href: `/models/${slug}/`,
+ recommendedRank: rank,
+ thumbnailUrl: `https://example.com/${rank}.webp`
+ }))
+
+ render(WorkshopModelsGrid, { props: { models: featured } })
+
+ const pagination = screen.getByTestId('featured-pagination')
+ expect(
+ within(pagination)
+ .getAllByRole('button')
+ .map((button) => button.getAttribute('aria-label'))
+ ).toEqual(['Seedream 5 Pro', 'Seedance 2 Fast'])
+ })
it('does not manufacture a return shelf before a model is opened', () => {
sessionStorage.setItem('comfy-models-shelf', 'generate-videos')
diff --git a/apps/website/src/components/workshop/WorkshopModelsGrid.vue b/apps/website/src/components/workshop/WorkshopModelsGrid.vue
index 1a3f62035c8..71aeda773d3 100644
--- a/apps/website/src/components/workshop/WorkshopModelsGrid.vue
+++ b/apps/website/src/components/workshop/WorkshopModelsGrid.vue
@@ -1,7 +1,14 @@
+
+
+
+
+ {{ tc(repo ? 'cinematic.repo.view' : 'cinematic.repo.soon', locale) }}
+
+
+
diff --git a/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionIcon.vue b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionIcon.vue
deleted file mode 100644
index f36fae010a5..00000000000
--- a/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionIcon.vue
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
diff --git a/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionSegments.vue b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionSegments.vue
index c3f008d5d17..86ae0ef6176 100644
--- a/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionSegments.vue
+++ b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionSegments.vue
@@ -14,7 +14,7 @@ import {
} from '../../../lib/workshop/cinematic-studio/catalog'
import type { Locale } from '../../../i18n/translations'
import { tc } from '../../../lib/workshop/cinematic-studio/copy'
-import CinematicDirectionIcon from './CinematicDirectionIcon.vue'
+import CinematicDirectionThumb from './CinematicDirectionThumb.vue'
import CinematicTooltip from './CinematicTooltip.vue'
const {
@@ -36,8 +36,7 @@ const segments = computed(() =>
part: group.part,
title: tc(group.title, locale),
label: tc(option.label, locale),
- option: option.id,
- palette: option.palette
+ option
}
})
)
@@ -69,24 +68,7 @@ const segments = computed(() =>
"
@click="emit('open', segment.part)"
>
-
-
-
-
+
diff --git a/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionThumb.test.ts b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionThumb.test.ts
new file mode 100644
index 00000000000..fbb2693c901
--- /dev/null
+++ b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionThumb.test.ts
@@ -0,0 +1,40 @@
+import { render, screen } from '@testing-library/vue'
+import { describe, expect, it } from 'vitest'
+
+import CinematicDirectionThumb from './CinematicDirectionThumb.vue'
+
+const frame = '/images/cinematic-studio/options/shot-wide.jpg'
+const palette = ['rgb(31, 78, 90)', 'rgb(224, 160, 96)']
+
+function renderThumb(option: { preview?: string; palette?: string[] }) {
+ render(CinematicDirectionThumb, { props: { option } })
+}
+
+describe('CinematicDirectionThumb', () => {
+ it('shows the preview frame of an option that has one', () => {
+ renderThumb({ preview: frame })
+
+ expect(screen.getByTestId('direction-thumb-frame')).toHaveAttribute(
+ 'src',
+ frame
+ )
+ })
+
+ it('shows a grade as its palette stripes, not a frame', () => {
+ renderThumb({ palette, preview: frame })
+
+ expect(screen.queryByTestId('direction-thumb-frame')).toBeNull()
+ expect(
+ screen
+ .getAllByTestId('direction-thumb-stripe')
+ .map((stripe) => stripe.style.backgroundColor)
+ ).toEqual(palette)
+ })
+
+ it('shows a dashed circle for an option with neither, like Auto', () => {
+ renderThumb({})
+
+ expect(screen.queryByTestId('direction-thumb-frame')).toBeNull()
+ expect(screen.getByTestId('direction-thumb-auto')).toBeInTheDocument()
+ })
+})
diff --git a/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionThumb.vue b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionThumb.vue
new file mode 100644
index 00000000000..9335546efee
--- /dev/null
+++ b/apps/website/src/components/workshop/cinematic-studio/CinematicDirectionThumb.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue b/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue
index d8bfda84889..de9541c3f2f 100644
--- a/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue
+++ b/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue
@@ -1,9 +1,11 @@