diff --git a/apps/website/README.md b/apps/website/README.md index 642376d3301..3121c25ba87 100644 --- a/apps/website/README.md +++ b/apps/website/README.md @@ -273,12 +273,17 @@ refresh preserves the last confirmed answer for the same identity; a new identity never inherits a grant. Disabling it restores the public site: - The header and homepage retain their existing navigation and model links. -- `/models` shows the existing Models marketing page. -- Model render pages show the public marketing content until enabled. +- `/hub/models/` shows the Models marketing page in place of the catalogue. + The old `/models` address redirects there. +- Router model pages at `/hub/models//` render their public content. + Workflow pages show the marketing content until enabled. - Catalogue and playground markup is absent from public HTML; their components and page data load after enablement. Homepage islands still serialize public - model and provider summaries. `/models` remains indexable with its marketing content. -- Render pages stay out of sitemaps and markdown exports. `/models/showcase` + model and provider summaries. `/hub/models/` remains indexable with its + marketing content. +- Router model pages are indexable and listed in the sitemap and markdown + exports (`launchedModelPages`). Workflow pages stay out until + `launchedWorkflowPages` is on. `/models/showcase` is the unlisted public copy of the marketing page: noindex and out of the sitemap. - Once enabled, a neutral loading frame replaces the public content while a @@ -296,7 +301,7 @@ sign in through the website never join that cohort. The website identifies signed-in people with their Firebase UID, matching Cloud's PostHog identity. For a verified `comfy.org` or `drip.art` email it also sets `comfy_staff: true`; every other account sends nothing beyond the -UID. Give staff `/login/?returnTo=%2Fmodels%2F` so they can sign in before +UID. Give staff `/login/?returnTo=%2Fhub%2Fmodels%2F` so they can sign in before their Models flag is evaluated. Anyone who signed in before `comfy_staff` existed must sign out and back in once. Authentication is available before PostHog answers, including when flags are missing or unavailable; no separate diff --git a/apps/website/e2e/hub-navigation.spec.ts b/apps/website/e2e/hub-navigation.spec.ts index c61bd82fcfd..fe086989219 100644 --- a/apps/website/e2e/hub-navigation.spec.ts +++ b/apps/website/e2e/hub-navigation.spec.ts @@ -395,6 +395,25 @@ test('the mobile menu closes and reopens after its Hub link navigates', async ({ await expect(page.getByRole('heading', { level: 1 })).toBeVisible() }) +test('mobile search suggestions show a video model as a still frame', async ({ + page +}) => { + await page.setViewportSize({ width: 390, height: 900 }) + await page.goto('/hub/models/') + const open = page.getByTestId('workshop-search-button') + await waitForIsland(page, open) + await open.click() + await page.getByTestId('workshop-search-sheet-input').fill('seedance') + const sheet = page.getByTestId('workshop-search-sheet') + await expect(sheet.getByTestId('workshop-search-model')).toHaveCount(4) + await expect( + sheet.getByTestId('workshop-search-model-video') + ).not.toHaveCount(0) + await expect( + sheet.locator('img[src*=".mp4"], img[src*=".webm"], img[src*=".mov"]') + ).toHaveCount(0) +}) + test('keeps the current listing visible until a cold destination is ready', async ({ page, context diff --git a/apps/website/src/components/workshop/WorkshopSearchPanel.test.ts b/apps/website/src/components/workshop/WorkshopSearchPanel.test.ts index ff120de86ca..1e282c0a5b9 100644 --- a/apps/website/src/components/workshop/WorkshopSearchPanel.test.ts +++ b/apps/website/src/components/workshop/WorkshopSearchPanel.test.ts @@ -1,10 +1,12 @@ import userEvent from '@testing-library/user-event' -import { render, screen } from '@testing-library/vue' +import { fireEvent, render, screen } from '@testing-library/vue' import { describe, expect, it } from 'vitest' import type { WorkshopModel } from '@/config/models-catalogue' import WorkshopSearchPanel from './WorkshopSearchPanel.vue' +type ThumbnailFields = Pick + const models: WorkshopModel[] = [ { slug: 'zeta', @@ -59,6 +61,81 @@ describe('WorkshopSearchPanel', () => { ).toBeTruthy() }) + const clip = 'https://comfy-hub-assets.comfy.org/uploads/3f2a9c' + const still = 'https://media.comfy.org/still.webp' + + it.for<[string, ThumbnailFields, string]>([ + [ + 'a declared video', + { thumbnailUrl: clip, thumbnail: { url: clip, kind: 'video' } }, + clip + ], + [ + 'a .mp4 URL with no declared kind', + { thumbnailUrl: 'https://media.comfy.org/clip.mp4' }, + 'https://media.comfy.org/clip.mp4' + ], + [ + 'a declared video with no thumbnailUrl', + { thumbnail: { url: clip, kind: 'video' } }, + clip + ], + [ + 'a declared video whose thumbnailUrl names another file', + { thumbnailUrl: still, thumbnail: { url: clip, kind: 'video' } }, + clip + ] + ])('shows %s as a still frame, not a broken image', ([, fields, src]) => { + render(WorkshopSearchPanel, { + props: { models: [{ ...models[1], ...fields }], query: 'alpha' } + }) + expect( + screen.getByTestId('workshop-search-model-video').getAttribute('src') + ).toBe(`${src}#t=0.1`) + }) + + it.for<[string, ThumbnailFields]>([ + [ + 'a declared audio thumbnail', + { + thumbnailUrl: 'https://media.comfy.org/sound', + thumbnail: { url: 'https://media.comfy.org/sound', kind: 'audio' } + } + ], + [ + 'an .mp3 URL with no declared kind', + { thumbnailUrl: 'https://media.comfy.org/sound.mp3' } + ] + ])('shows the initial instead of a broken image for %s', ([, fields]) => { + render(WorkshopSearchPanel, { + props: { models: [{ ...models[1], ...fields }], query: 'alpha' } + }) + expect(screen.getByText('A')).toBeTruthy() + }) + + it.for<[string, ThumbnailFields, () => HTMLElement]>([ + [ + 'video', + { thumbnail: { url: clip, kind: 'video' } }, + () => screen.getByTestId('workshop-search-model-video') + ], + [ + 'image', + { thumbnailUrl: still }, + () => screen.getByTestId('workshop-search-model-image') + ] + ])( + 'shows the initial when the %s thumbnail fails to load', + async ([, fields, media]) => { + render(WorkshopSearchPanel, { + props: { models: [{ ...models[1], ...fields }], query: 'alpha' } + }) + expect(screen.queryByText('A')).toBeNull() + await fireEvent.error(media()) + expect(screen.getByText('A')).toBeTruthy() + } + ) + it('shows an empty state for a query without matches', () => { render(WorkshopSearchPanel, { props: { models, query: 'missing' } diff --git a/apps/website/src/components/workshop/WorkshopSearchPanel.vue b/apps/website/src/components/workshop/WorkshopSearchPanel.vue index 5f712bd830a..1a55c431718 100644 --- a/apps/website/src/components/workshop/WorkshopSearchPanel.vue +++ b/apps/website/src/components/workshop/WorkshopSearchPanel.vue @@ -1,5 +1,5 @@