Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3c94ab1
fix(models): the run strip blurs what the viewer blurs
mariana953 Sep 14, 2026
2f7cff1
fix(models): the design pass on the catalogue, the credits dialog and…
mariana953 Sep 14, 2026
c3f593c
fix(models): Sign In is the size of the buttons beside it
mariana953 Sep 14, 2026
b98b3e5
fix(models): the sticky toolbar covers the rows passing under it
mariana953 Sep 14, 2026
42620a8
fix(models): the estimate reads as a price, and its caveat is an icon
mariana953 Sep 14, 2026
8cb714f
style(models): one spelling of the focus-visible variant on the file …
mariana953 Sep 14, 2026
876a26a
feat(models): the price caveat gets a real tooltip
mariana953 Sep 14, 2026
31429c7
test(models): the tooltip opens for a keyboard
mariana953 Sep 14, 2026
4335660
feat(models): leaving a running page is asked in our own words
mariana953 Sep 14, 2026
7dfc585
fix(models): the files under a result say what they are
mariana953 Sep 14, 2026
8e9d3f1
fix(models): the sort menu stops offering an order it cannot give
mariana953 Sep 14, 2026
3659a36
refactor(models): keep the sort order list module-private
mariana953 Sep 14, 2026
d5cbe07
refactor(models): the link guard is its own tested function
mariana953 Sep 14, 2026
ea49689
merge: bring the run strip blur fix into the design pass
mariana953 Sep 14, 2026
3918944
feat(models): templates browse on their own screen, beside models
mariana953 Sep 14, 2026
0828fa3
chore: register the templates routes with knip
mariana953 Sep 14, 2026
1a2df06
[automated] Apply ESLint and Oxfmt fixes
actions-user Sep 14, 2026
60ff6d8
fix(models): the templates routes are built, and gated like the rest
mariana953 Sep 14, 2026
dd647f0
merge: bring the v2 recommendation onto the QA branch
mariana953 Sep 14, 2026
4395f63
fix: make the model link filter the templates grid
mariana953 Sep 14, 2026
6da6a71
revert(models): the templates v2 leaves the V1 design pass
mariana953 Sep 14, 2026
15b453d
fix: keep the templates tree out of the language clusters
mariana953 Sep 14, 2026
c4dbc38
merge: keep the V1 fixes over the templates revert
mariana953 Sep 14, 2026
27e82df
fix(models): a copy pass over the Models screens
mariana953 Sep 14, 2026
ab19bb2
fix(models): the tag overflow opens on hover, and two alignment fixes
mariana953 Sep 14, 2026
0197665
[automated] Apply ESLint and Oxfmt fixes
actions-user Sep 14, 2026
fe0e30e
fix(models): the example hint names the model it offers to run
mariana953 Sep 14, 2026
e777c76
Merge remote-tracking branch 'origin/mariana/models-design-pass' into…
mariana953 Sep 14, 2026
511c979
fix(models): the form stops restating what its controls already show
mariana953 Sep 14, 2026
26bf1df
style(models): the drop zone stops crowding its own three lines
mariana953 Sep 14, 2026
a427519
fix(models): the examples row carries its own labels
mariana953 Sep 14, 2026
d086dc5
Merge remote-tracking branch 'origin/main' into mariana/models-design…
mariana953 Sep 14, 2026
8b73c90
refactor(models): the price is its own component again
mariana953 Sep 14, 2026
f77e667
fix(models): a summary stops naming the model twice
mariana953 Sep 14, 2026
6b91778
fix(website): address consolidated models review
benjcooley Sep 14, 2026
c37df27
fix(models): the toolbar holds one line, and two dialogs stop crowding
mariana953 Sep 14, 2026
866bda7
fix(models): the output panel puts each thing where it is read
mariana953 Sep 14, 2026
47dd32e
test(website): update snapshots for sign-in control
benjcooley Sep 14, 2026
3edb8ea
Merge remote-tracking branch 'origin/main' into benjcooley/mar-models…
benjcooley Sep 14, 2026
858571c
refactor(website): separate login fix from models review
benjcooley Sep 14, 2026
b20ac37
fix(models): the catalogue narrows by what a model does
mariana953 Sep 14, 2026
fd9e68e
Merge remote-tracking branch 'origin/mariana/models-design-pass' into…
mariana953 Sep 14, 2026
54d3b37
test(website): defer sign-in snapshots to login follow-up
benjcooley Sep 14, 2026
9896e87
Merge remote-tracking branch 'origin/mariana/models-design-pass' into…
mariana953 Sep 14, 2026
f920800
test(website): the e2e specs read the copy the screens now use
mariana953 Sep 14, 2026
e63a5bd
Merge remote-tracking branch 'origin/main' into mariana/models-design…
mariana953 Sep 14, 2026
6024f96
fix(models): the row that truncates says so, and a linked filter can …
mariana953 Sep 14, 2026
67fd1c4
fix(models): a category reaches every model that belongs in it
mariana953 Sep 15, 2026
85381ec
Merge remote-tracking branch 'origin/main' into mariana/models-design…
mariana953 Sep 15, 2026
6844103
fix(models): the output file switch is a named group, not a landmark
mariana953 Sep 15, 2026
2b134ed
Merge remote-tracking branch 'origin/main' into mariana/models-design…
mariana953 Sep 15, 2026
6de89c4
fix(models): the row keeps its bare count, and the banner stops match…
mariana953 Sep 15, 2026
35dc7e3
fix(models): the empty wallet says it once
mariana953 Sep 15, 2026
369cb14
feat(models): the arrows ride the row, and See all takes their old place
mariana953 Sep 15, 2026
aedeb3e
test(models): both ways into a category reach the same screen
mariana953 Sep 15, 2026
98965d1
fix(models): the arrow centres on the card, and the row's controls wa…
mariana953 Sep 15, 2026
67815cb
fix(models): the row arrow lines up with the middle of a card
mariana953 Sep 15, 2026
2ba371a
fix(models): the card stops naming the link it already is
mariana953 Sep 15, 2026
8c8c480
fix(models): the fade covers the whole width the row scrolls
mariana953 Sep 15, 2026
894630b
fix(models): the arrow sits on the edge the row runs past
mariana953 Sep 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions apps/website/e2e/models-sign-in-draft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ for (const { entry, randomUUID, failRead } of [
})
await page.goto(path)
const chooser = page.waitForEvent('filechooser')
await page
.getByText('Choose images or drop them here', { exact: true })
.click()
await page.getByText(/^Select or drop /).click()
await (await chooser).setFiles('e2e/assets/placeholder-1x1.webp')
const replacement = page.getByRole('button', {
name: 'Replace placeholder-1x1.webp'
Expand Down Expand Up @@ -154,9 +152,7 @@ test('unavailable draft storage does not trap sign-in and reports missing files
})
await page.goto(path)
const chooser = page.waitForEvent('filechooser')
await page
.getByText('Choose images or drop them here', { exact: true })
.click()
await page.getByText(/^Select or drop /).click()
await (await chooser).setFiles('e2e/assets/placeholder-1x1.webp')
await page.getByRole('link', { name: 'Sign in to run', exact: true }).click()
await expect(page).toHaveURL(/\/login\/\?returnTo=/)
Expand Down
53 changes: 47 additions & 6 deletions apps/website/e2e/workshop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ test.describe('Models catalog', () => {
const sections = page.getByTestId('workshop-sections')
await expect(sections).toBeVisible()
const videos = page.getByTestId('section-generate-videos')
const rowHeading = await videos
.getByRole('heading', { level: 2 })
const rowLabel = (
await videos.getByRole('heading', { level: 2 }).innerText()
).trim()
const seeAll = await videos
.getByTestId('section-generate-videos-see-all')
.innerText()
const promisedCount = Number(rowHeading.match(/(\d+)\s*$/)?.[1])
const rowLabel = rowHeading.replace(/\s*\d+\s*$/, '').trim()
const promisedCount = Number(seeAll.match(/(\d+)/)?.[1])
expect(promisedCount).toBeGreaterThan(0)
await videos.getByTestId('section-generate-videos-open').click()
const cards = page
Expand Down Expand Up @@ -370,6 +372,45 @@ test.describe('Models catalog', () => {
'/models/byteplus--seedance-2-5-text-to-video--generate-videos/'
)
})

test('the row arrow sits level with the middle of a card', async ({
page
}) => {
for (const width of [1440, 820, 420]) {
await page.setViewportSize({ width, height: 1000 })
await page.goto('/models/')
const row = page.getByTestId('section-generate-images')
const card = row.getByTestId('workshop-model-card').first()
await expect(card).toBeVisible()
await card.hover()
const cardBox = await card.boundingBox()
const arrowBox = await row.getByTestId('card-row-next').boundingBox()
if (!cardBox || !arrowBox) throw new Error('the row did not lay out')
const middleOf = (box: { y: number; height: number }) =>
box.y + box.height / 2
expect(Math.abs(middleOf(arrowBox) - middleOf(cardBox))).toBeLessThan(1)
}
})

test('the fade reaches both ends of the scrolling row', async ({ page }) => {
await page.goto('/models/')
const row = page.getByTestId('section-generate-images')
await expect(row.getByTestId('workshop-model-card').first()).toBeVisible()
await row.hover()
const edges = await row.evaluate((section) => {
const span = (selector: string) => {
const element = section.querySelector(selector)
if (!element) return undefined
const { x, width } = element.getBoundingClientRect()
return { left: x, right: x + width }
}
return {
scroller: span('ul'),
fades: span('[data-testid="card-row-arrows"]')
}
})
expect(edges.fades).toEqual(edges.scroller)
})
})

test.describe('Model playground', () => {
Expand Down Expand Up @@ -427,7 +468,7 @@ test.describe('Model playground', () => {
await expect(page.getByTestId('run-button')).toBeEnabled()
const [chooser] = await Promise.all([
page.waitForEvent('filechooser'),
page.getByText('Choose images or drop them here', { exact: true }).click()
page.getByText(/^Select or drop /).click()
])
await chooser.setFiles('e2e/assets/placeholder-1x1.webp')
await expect(
Expand Down Expand Up @@ -473,7 +514,7 @@ test.describe('Model playground', () => {
await page.goto('/models/byteplus--seedream-4-5--edit-images/')
const [chooser] = await Promise.all([
page.waitForEvent('filechooser'),
page.getByText('Choose images or drop them here', { exact: true }).click()
page.getByText(/^Select or drop /).click()
])
await chooser.setFiles('e2e/assets/placeholder-1x1.webp')
await page.getByRole('tab', { name: 'API', exact: true }).click()
Expand Down
37 changes: 20 additions & 17 deletions apps/website/src/components/workshop/CardRow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { describe, expect, it } from 'vitest'
import CardRow from './CardRow.vue'

describe('CardRow', () => {
it('shows paging controls and disables each one at its edge', async () => {
it('offers each arrow only while that side has somewhere to go', async () => {
render(CardRow, {
slots: { default: '<li>One</li><li>Two</li>' }
})
Expand All @@ -18,24 +18,27 @@ describe('CardRow', () => {

await fireEvent.scroll(row)
await nextTick()
expect(
screen.getByRole<HTMLButtonElement>('button', { name: 'Scroll back' })
.disabled
).toBe(true)
expect(
screen.getByRole<HTMLButtonElement>('button', { name: 'Scroll forward' })
.disabled
).toBe(false)
expect(screen.queryByRole('button', { name: 'Scroll back' })).toBeNull()
expect(screen.getByRole('button', { name: 'Scroll forward' })).toBeTruthy()

row.scrollLeft = 200
await fireEvent.scroll(row)
expect(
screen.getByRole<HTMLButtonElement>('button', { name: 'Scroll back' })
.disabled
).toBe(false)
expect(
screen.getByRole<HTMLButtonElement>('button', { name: 'Scroll forward' })
.disabled
).toBe(true)
await nextTick()
expect(screen.getByRole('button', { name: 'Scroll back' })).toBeTruthy()
expect(screen.queryByRole('button', { name: 'Scroll forward' })).toBeNull()
})

it('carries no arrows while every card already fits', async () => {
render(CardRow, { slots: { default: '<li>Only</li>' } })
const row = screen.getByRole('list')
Object.defineProperties(row, {
clientWidth: { configurable: true, value: 300 },
scrollWidth: { configurable: true, value: 300 },
scrollLeft: { configurable: true, writable: true, value: 0 }
})

await fireEvent.scroll(row)
await nextTick()
expect(screen.queryByTestId('card-row-arrows')).toBeNull()
})
})
74 changes: 51 additions & 23 deletions apps/website/src/components/workshop/CardRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const { locale = 'en' } = defineProps<{ locale?: Locale }>()
const row = useTemplateRef<HTMLElement>('row')
const atStart = ref(true)
const atEnd = ref(true)
const scrollable = ref(false)

// The row carries a little padding so focus rings are not clipped, and snapping
// rests inside it, so "at the start" is a few pixels wide.
Expand All @@ -22,7 +21,6 @@ const EDGE = 8
function measure() {
const el = row.value
if (!el) return
scrollable.value = el.scrollWidth > el.clientWidth + EDGE
atStart.value = el.scrollLeft <= EDGE
atEnd.value = el.scrollLeft + el.clientWidth >= el.scrollWidth - EDGE
}
Expand All @@ -39,13 +37,24 @@ onMounted(() => void nextTick(measure))
useResizeObserver(row, measure)
useMutationObserver(row, measure, { childList: true, subtree: true })

const arrowClass = (spent: boolean) =>
cn(
'grid size-9 place-items-center rounded-xl border border-transparency-white-t20 text-primary-warm-white transition-colors outline-none focus-visible:ring-3 focus-visible:ring-primary-comfy-yellow/50',
spent
? 'cursor-default opacity-30'
: 'cursor-pointer hover:border-primary-comfy-yellow hover:text-primary-comfy-yellow'
)
// The arrows straddle the edge of the row, half over the cards and half over
// the page, so the row reads as running past them. They are opaque, because a
// card showing through a control reads as a rendering fault. Hovering lifts
// them without colour: the yellow belongs to See all, and two yellows on one
// row compete.
const arrowClass =
'focus-visible:ring-primary-comfy-yellow/50 hover:border-primary-warm-gray hover:bg-site-dropdown bg-page pointer-events-auto absolute top-1/2 z-10 grid size-9 -translate-y-1/2 cursor-pointer place-items-center rounded-xl border border-transparency-white-t20 text-primary-warm-white shadow-lg shadow-black/40 transition-colors outline-none focus-visible:ring-3'

// A pointer that can hover earns them by hovering, so a page of rows is not a
// page of chrome, and a keyboard earns them by focusing. A touch screen can do
// neither, so there they stay: the fade is the only thing saying there is more.
const revealClass =
'pointer-events-none absolute -inset-x-1 top-0 bottom-2 transition-opacity duration-200 can-hover:opacity-0 can-hover:group-hover/row:opacity-100 can-hover:group-focus-within/row:opacity-100'

// The fade says there is more that way, so it keeps the arrows' company: each
// side carries one only while that side has somewhere to go.
const fadeClass =
'pointer-events-none absolute inset-y-0 z-0 w-20 from-page via-page/70 to-transparent'
</script>

<template>
Expand All @@ -54,37 +63,56 @@ const arrowClass = (spent: boolean) =>
<slot name="heading" />
<div class="flex items-center gap-3">
<slot name="actions" />
<div v-if="scrollable" class="flex items-center gap-2">
</div>
</div>

<div class="group/row relative">
<ul
ref="row"
class="-mx-1 scrollbar-hide flex snap-x snap-mandatory gap-5 overflow-x-auto px-1 pb-2"
@scroll="measure"
>
<slot />
</ul>

<!-- An arrow is only there while it has somewhere to go, so the row
never carries a control it cannot honour. -->
<div
v-if="!atStart || !atEnd"
:class="revealClass"
data-testid="card-row-arrows"
>
<template v-if="!atStart">
<span
:class="cn(fadeClass, 'left-0 bg-linear-to-r')"
aria-hidden="true"
/>
<button
type="button"
:aria-label="t('workshop.sections.scrollBack', locale)"
:disabled="atStart"
:class="arrowClass(atStart)"
:class="cn(arrowClass, 'left-0 -translate-x-1/2')"
data-testid="card-row-prev"
@click="page(-1)"
>
<ChevronLeft class="size-4" aria-hidden="true" />
</button>
</template>
<template v-if="!atEnd">
Comment thread
benjcooley marked this conversation as resolved.
Resolved
<span
:class="cn(fadeClass, 'right-0 bg-linear-to-l')"
aria-hidden="true"
/>
<button
type="button"
:aria-label="t('workshop.sections.scrollForward', locale)"
:disabled="atEnd"
:class="arrowClass(atEnd)"
:class="cn(arrowClass, 'right-0 translate-x-1/2')"
data-testid="card-row-next"
@click="page(1)"
>
<ChevronRight class="size-4" aria-hidden="true" />
</button>
</div>
</template>
</div>
</div>

<ul
ref="row"
class="-mx-1 scrollbar-hide flex snap-x snap-mandatory gap-5 overflow-x-auto px-1 pb-2"
@scroll="measure"
>
<slot />
</ul>
</div>
</template>
3 changes: 0 additions & 3 deletions apps/website/src/components/workshop/ExamplesTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ function actionFor(example: PlaygroundExample, active = false) {
)
}}
</h2>
<p v-if="samplesOnly" class="text-sm text-primary-warm-gray">
{{ t('workshop.examples.samplesSubtitle', locale) }}
</p>
</div>

<p v-if="!examples.length" class="text-sm text-primary-warm-gray">
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/workshop/FeaturedBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

<template>
<section
v-if="active"

Check warning on line 109 in apps/website/src/components/workshop/FeaturedBanner.vue

View workflow job for this annotation

GitHub Actions / fallow

High cognitive complexity (moderate)

Function '<template>' is hard to understand (cognitive: 23, threshold: 15). • Severity: moderate • Cyclomatic: 12 • Cognitive: 23 • Lines: 234 High cognitive complexity means deeply nested or interleaved logic. Consider flattening control flow or extracting helper functions.
ref="banner"
:aria-label="t('workshop.sections.featured', locale)"
class="relative isolate overflow-hidden rounded-4.5xl border border-transparency-white-t8"
Expand Down Expand Up @@ -145,7 +145,7 @@
decoding="async"
/>
<div
class="pointer-events-none absolute inset-0 bg-linear-to-t from-page via-page/85 to-page/20 sm:bg-linear-to-r sm:via-page/80 sm:to-transparent"
class="pointer-events-none absolute inset-0 bg-linear-to-t from-page/90 via-page/80 to-page/20 sm:bg-linear-to-r sm:via-page/75 sm:to-transparent"
aria-hidden="true"
/>

Expand Down
12 changes: 11 additions & 1 deletion apps/website/src/components/workshop/FileSourceInput.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('file source selection', () => {
expect(screen.getByText('2 KB')).toBeTruthy()
expect(screen.queryByRole('img')).toBeNull()
expect(values.value).toMatchObject([{ file }])
expect(screen.getByText('Choose files or drop them here')).toBeTruthy()
expect(screen.getByText('Select or drop up to 2 files')).toBeTruthy()
await user.click(screen.getByRole('button', { name: `Replace ${name}` }))
const replacement = new File(['replacement bytes'], 'replacement.fbx', {
type: 'application/octet-stream'
Expand Down Expand Up @@ -244,6 +244,16 @@ describe('file source selection', () => {
expect(screen.getAllByRole('img')).toHaveLength(1)
})

it('promises one image where a second would replace the first', async () => {
const single = { ...field, multiple: false, maxItems: 1 }
const value = mountInput(false, single)
expect(screen.getByText('Select or drop an image')).toBeTruthy()
await drop([new File(['one'], 'one.png', { type: 'image/png' })])
expect(screen.getByText('Select or drop to replace')).toBeTruthy()
await drop([new File(['two'], 'two.png', { type: 'image/png' })])
expect(value.value).toMatchObject({ name: 'two.png' })
})

it('ignores file drops while disabled', async () => {
const value = mountInput(true)
await drop([new File(['one'], 'one.png', { type: 'image/png' })])
Expand Down
28 changes: 19 additions & 9 deletions apps/website/src/components/workshop/FileSourceInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,25 @@ const description = computed(
.join(' ') || undefined
)

// A field that takes one file replaces what it holds, so plural copy would
// promise a second slot that does not exist.
const prompt = computed(() => {
const replacing = selectedFiles.value.length > 0 && !field.multiple
if (replacing)
return imageOnly.value
? 'workshop.field.replaceOrDropImage'
: 'workshop.field.replaceOrDropFile'
return imageOnly.value
? 'workshop.field.chooseOrDropImages'
: 'workshop.field.chooseOrDropFiles'
const allowed = field.multiple ? field.maxItems : undefined
if (allowed !== undefined && allowed > 1)
return t(
imageOnly.value
? 'workshop.field.selectOrDropImages'
: 'workshop.field.selectOrDropFiles',
locale
).replace('{count}', String(allowed))
if (selectedFiles.value.length > 0)
return t('workshop.field.selectOrDropReplacement', locale)
return t(
imageOnly.value
? 'workshop.field.selectOrDropImage'
: 'workshop.field.selectOrDropFile',
locale
)
})

const acceptedTypes = computed(() =>
Expand Down Expand Up @@ -188,7 +198,7 @@ function remove(index: number) {
@click="replacement = undefined"
>
<Upload class="size-5" aria-hidden="true" />
<span>{{ t(prompt, locale) }}</span>
<span>{{ prompt }}</span>
<span class="text-2xs">
<template v-if="acceptedTypes">{{ acceptedTypes }} · </template>
{{ t('workshop.field.uploadLimit', locale) }}
Expand Down
12 changes: 11 additions & 1 deletion apps/website/src/components/workshop/ModelDetail.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment happy-dom
import userEvent from '@testing-library/user-event'
import { fireEvent, render, screen, within } from '@testing-library/vue'
import { IDBFactory } from 'fake-indexeddb'
Expand Down Expand Up @@ -657,6 +658,16 @@ describe('ModelDetail', () => {
expect(screen.getByTestId('router-request-id').textContent).toContain(
'request-123'
)
expect(screen.getByTestId('output-expires').textContent).toContain(
'expire 24 hours'
)
const copyRequestId = screen.getByRole('button', {
name: 'Copy request ID'
})
await user().click(copyRequestId)
await vi.waitFor(() =>
expect(copyRequestId.textContent).toContain('Copied')
)
expect(refreshWorkshopCredits).toHaveBeenCalledWith({ force: true })
})

Expand Down Expand Up @@ -1699,7 +1710,6 @@ describe('ModelDetail', () => {
expect(
screen.getByRole('heading', { name: 'Sample outputs' })
).toBeTruthy()
expect(screen.getByText(/without touching your inputs/)).toBeTruthy()
if (nativeJson)
await user().click(screen.getByRole('button', { name: 'Native JSON' }))
const input = screen.getByTestId<HTMLTextAreaElement>(
Expand Down
Loading
Loading