From 83b994c11db23b09e7b25c80090dbed69dc11e54 Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Wed, 14 Oct 2026 22:05:29 +0000 Subject: [PATCH 1/3] feat(website): open a Hub home at /hub/ behind its own flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /hub/ had no page of its own: the Hub was a menu whose entries each led straight to a catalogue. This builds the address and renders the three doors — Models, Workflows, Apps — each with one line of what it is for and a still from the catalogue it opens. The page reads the public showcase until the hub-home-enabled flag answers for the visitor, so it ships closed and opens per person without a deploy. Unlike the other gated hub sections it holds no loading frame: a visitor without the flag gets the showcase on the first frame, and the address stays noindex while it is closed. The home loads straight from the page entry rather than through ModelsCatalogue, so the three live catalogues keep the markup and the component they have in production. Search, popular items and the category tiles follow in a second change. --- .../components/workshop/ExploreDoors.test.ts | 82 ++++++++++ .../src/components/workshop/ExploreDoors.vue | 131 ++++++++++++++++ .../src/components/workshop/ExploreHome.vue | 74 +++++++++ .../workshop/ModelsPage.home.test.ts | 63 ++++++++ .../src/components/workshop/ModelsPage.vue | 48 ++++-- .../workshop/explore-doors/DoorAppPanel.vue | 55 +++++++ .../workshop/explore-doors/DoorModelPanel.vue | 48 ++++++ .../explore-doors/DoorWorkflowPanel.vue | 71 +++++++++ .../workshop/explore-doors/ExploreDoorArt.vue | 65 ++++++++ .../explore-doors/doorPanelClasses.ts | 8 + apps/website/src/config/hub-models.ts | 1 + .../src/config/models-url-registry.test.ts | 16 +- .../website/src/config/models-url-registry.ts | 4 +- apps/website/src/config/routes.ts | 5 +- .../workshop-release-gate.test.ts | 5 +- .../src/integrations/workshop-release-gate.ts | 2 + .../src/lib/workshop/explore-art.test.ts | 142 ++++++++++++++++++ apps/website/src/lib/workshop/explore-art.ts | 124 +++++++++++++++ apps/website/src/lib/workshop/hub-section.ts | 6 + apps/website/src/locales/en/main.json | 25 ++- apps/website/src/locales/zh-CN/main.json | 23 +++ .../src/routes/models/hub-section-copy.ts | 10 +- .../src/routes/models/hub-section.astro | 11 +- 23 files changed, 990 insertions(+), 29 deletions(-) create mode 100644 apps/website/src/components/workshop/ExploreDoors.test.ts create mode 100644 apps/website/src/components/workshop/ExploreDoors.vue create mode 100644 apps/website/src/components/workshop/ExploreHome.vue create mode 100644 apps/website/src/components/workshop/ModelsPage.home.test.ts create mode 100644 apps/website/src/components/workshop/explore-doors/DoorAppPanel.vue create mode 100644 apps/website/src/components/workshop/explore-doors/DoorModelPanel.vue create mode 100644 apps/website/src/components/workshop/explore-doors/DoorWorkflowPanel.vue create mode 100644 apps/website/src/components/workshop/explore-doors/ExploreDoorArt.vue create mode 100644 apps/website/src/components/workshop/explore-doors/doorPanelClasses.ts create mode 100644 apps/website/src/lib/workshop/explore-art.test.ts create mode 100644 apps/website/src/lib/workshop/explore-art.ts create mode 100644 apps/website/src/lib/workshop/hub-section.ts diff --git a/apps/website/src/components/workshop/ExploreDoors.test.ts b/apps/website/src/components/workshop/ExploreDoors.test.ts new file mode 100644 index 00000000000..f25a4a9ef4b --- /dev/null +++ b/apps/website/src/components/workshop/ExploreDoors.test.ts @@ -0,0 +1,82 @@ +import { render, screen, within } from '@testing-library/vue' +import { describe, expect, it } from 'vitest' + +import ExploreDoors from './ExploreDoors.vue' + +const ALL = { models: 3, workflows: 2, apps: 1 } + +describe('ExploreDoors', () => { + it('says who each door is for', () => { + render(ExploreDoors, { props: { counts: ALL } }) + + expect( + screen + .getAllByRole('link') + .map((door) => [ + within(door).getByTestId('explore-door-intent').textContent.trim(), + within(door).getByTestId('explore-door-hint').textContent.trim() + ]) + ).toEqual([ + [ + 'Run or call any model', + 'Call the latest models from your code. Try them here first.' + ], + ['Download and remix', 'Open the graph and change any step.'], + ['Make it in one click', 'Upload, click, done. No nodes, no setup.'] + ]) + }) + + it.for([ + { + door: 'models', + copy: ['Alpine lake at blue hour', 'Nano Banana Pro', 'Run'] + }, + { + door: 'workflows', + copy: ['Relight', 'light', '45°', 'strength', '0.80', 'Save Image'] + }, + { + door: 'apps', + copy: ['Focal length', '35mm', 'Generate'] + } + ] as const)('shows the $door interface over its image', ({ door, copy }) => { + render(ExploreDoors, { + props: { + counts: ALL, + art: { + models: { + src: '/lake.png', + name: 'Nano Banana Pro', + provider: 'Google', + usd: 0.03, + credits: 6, + prompt: 'workshop.explore.doorModelPromptLake' + }, + workflows: { src: '/bottle.webp' }, + apps: { + src: '/studio.jpg', + control: 'workshop.explore.doorAppControlFocal', + value: '35mm' + } + } + } + }) + + const art = within( + within(screen.getByTestId(`explore-door-${door}`)).getByTestId( + 'explore-door-art' + ) + ) + for (const text of copy) expect(art.getByText(text)).toBeInTheDocument() + }) + + it('keeps a door without art to its words', () => { + render(ExploreDoors, { props: { counts: ALL } }) + + expect(screen.queryByTestId('explore-door-art')).not.toBeInTheDocument() + expect(screen.getByRole('link', { name: /Models/ })).toHaveAttribute( + 'href', + '/hub/models/' + ) + }) +}) diff --git a/apps/website/src/components/workshop/ExploreDoors.vue b/apps/website/src/components/workshop/ExploreDoors.vue new file mode 100644 index 00000000000..e24c3472088 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreDoors.vue @@ -0,0 +1,131 @@ + + + diff --git a/apps/website/src/components/workshop/ExploreHome.vue b/apps/website/src/components/workshop/ExploreHome.vue new file mode 100644 index 00000000000..b52c189dc86 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreHome.vue @@ -0,0 +1,74 @@ + + + diff --git a/apps/website/src/components/workshop/ModelsPage.home.test.ts b/apps/website/src/components/workshop/ModelsPage.home.test.ts new file mode 100644 index 00000000000..7c6ee2e9807 --- /dev/null +++ b/apps/website/src/components/workshop/ModelsPage.home.test.ts @@ -0,0 +1,63 @@ +import { respondToFetch } from '@comfyorg/test-utils/fetch' +import { render, screen } from '@testing-library/vue' +import { beforeEach, describe, expect, it, vi } from 'vitest' +import { readonly, ref } from 'vue' +import type { Ref } from 'vue' + +import { workshopModels } from '@/config/workshop-browse-content' +import './ModelsCatalogue.vue' +import { HUB_HOME_FLAG } from '@/lib/workshop/hub-section' +import { + useWorkshopAppsEnabled, + useWorkshopAuthFlag, + useWorkshopEnabled, + useWorkshopEnabledSettled, + useWorkshopFlag, + useWorkshopWorkflowsEnabled +} from '@/scripts/posthog' +import ModelsPage from './ModelsPage.vue' + +vi.mock(import('@/scripts/posthog')) + +let homeEnabled: Ref + +beforeEach(() => { + homeEnabled = ref(false) + vi.mocked(useWorkshopFlag).mockImplementation((name) => + readonly(name === HUB_HOME_FLAG ? homeEnabled : ref(false)) + ) + vi.mocked(useWorkshopEnabled).mockReturnValue(readonly(ref(false))) + vi.mocked(useWorkshopEnabledSettled).mockReturnValue(readonly(ref(true))) + vi.mocked(useWorkshopAuthFlag).mockReturnValue(readonly(ref(false))) + vi.mocked(useWorkshopWorkflowsEnabled).mockReturnValue(readonly(ref(false))) + vi.mocked(useWorkshopAppsEnabled).mockReturnValue(readonly(ref(false))) + respondToFetch('/models/catalogue.json', () => Response.json(workshopModels)) +}) + +const renderHome = () => + render(ModelsPage, { + props: { section: 'explore' as const, heading: 'What will you make?' }, + slots: { fallback: '

Public showcase

' } + }) + +describe('Hub home', () => { + it('reads the public showcase while its flag is closed', async () => { + renderHome() + + expect(await screen.findByText('Public showcase')).toBeTruthy() + expect(screen.queryByTestId('explore-home')).toBeNull() + expect(screen.queryByTestId('workshop-heading')).toBeNull() + }) + + it('opens the doors once the flag answers for this visitor', async () => { + homeEnabled.value = true + renderHome() + + expect(await screen.findByTestId('explore-home')).toBeTruthy() + expect(screen.getByTestId('explore-doors')).toBeTruthy() + expect(screen.queryByText('Public showcase')).toBeNull() + expect(screen.getByRole('heading', { level: 1 }).textContent).toContain( + 'What will you make?' + ) + }) +}) diff --git a/apps/website/src/components/workshop/ModelsPage.vue b/apps/website/src/components/workshop/ModelsPage.vue index a20f8b4538f..0b217a50925 100644 --- a/apps/website/src/components/workshop/ModelsPage.vue +++ b/apps/website/src/components/workshop/ModelsPage.vue @@ -1,4 +1,5 @@ + + diff --git a/apps/website/src/components/workshop/explore-doors/DoorModelPanel.vue b/apps/website/src/components/workshop/explore-doors/DoorModelPanel.vue new file mode 100644 index 00000000000..f4e8ae5f298 --- /dev/null +++ b/apps/website/src/components/workshop/explore-doors/DoorModelPanel.vue @@ -0,0 +1,48 @@ + + + diff --git a/apps/website/src/components/workshop/explore-doors/DoorWorkflowPanel.vue b/apps/website/src/components/workshop/explore-doors/DoorWorkflowPanel.vue new file mode 100644 index 00000000000..87518862b23 --- /dev/null +++ b/apps/website/src/components/workshop/explore-doors/DoorWorkflowPanel.vue @@ -0,0 +1,71 @@ + + + diff --git a/apps/website/src/components/workshop/explore-doors/ExploreDoorArt.vue b/apps/website/src/components/workshop/explore-doors/ExploreDoorArt.vue new file mode 100644 index 00000000000..55e15986d09 --- /dev/null +++ b/apps/website/src/components/workshop/explore-doors/ExploreDoorArt.vue @@ -0,0 +1,65 @@ + + + diff --git a/apps/website/src/components/workshop/explore-doors/doorPanelClasses.ts b/apps/website/src/components/workshop/explore-doors/doorPanelClasses.ts new file mode 100644 index 00000000000..9d30144e385 --- /dev/null +++ b/apps/website/src/components/workshop/explore-doors/doorPanelClasses.ts @@ -0,0 +1,8 @@ +export const GLASS = + 'rounded-2xl bg-primary-comfy-ink/40 text-primary-warm-white shadow-[0_16px_40px_-16px_rgb(0_0_0/0.55)] ring-1 ring-primary-warm-white/20 backdrop-blur-xl backdrop-saturate-150' +export const FLOAT = + 'absolute top-1/2 right-2 z-10 origin-right -translate-y-1/2 max-sm:w-[calc((100%-0.5rem)*4/3)] max-sm:scale-75 sm:right-auto sm:left-0 sm:origin-left motion-safe:group-hover:animate-[platform-builder-float_2.4s_ease-in-out_infinite] motion-safe:group-focus-visible:animate-[platform-builder-float_2.4s_ease-in-out_infinite]' +export const PORT = + 'absolute top-1/2 size-2.5 -translate-y-1/2 rounded-full bg-primary-warm-white ring-2 ring-primary-warm-white/30 motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-150 motion-safe:group-focus-visible:scale-150' +export const ACTION_PILL = + 'inline-flex items-center justify-center gap-1 rounded-full bg-primary-comfy-yellow text-3xs font-bold tracking-wider text-primary-comfy-ink uppercase group-hover:ring-4 group-hover:ring-primary-comfy-yellow/30 group-focus-visible:ring-4 group-focus-visible:ring-primary-comfy-yellow/30 motion-safe:transition motion-safe:duration-300' diff --git a/apps/website/src/config/hub-models.ts b/apps/website/src/config/hub-models.ts index 4b71cb34ae2..9528d550617 100644 --- a/apps/website/src/config/hub-models.ts +++ b/apps/website/src/config/hub-models.ts @@ -2,6 +2,7 @@ import hubAppNames from './hub-app-names.json' with { type: 'json' } import hubWorkflowNames from './hub-workflow-names.json' with { type: 'json' } import { modelAliasUrls, modelPageUrls } from './model-urls' +export const HUB_PATH = '/hub' export const HUB_MODELS_PATH = '/hub/models' export const HUB_WORKFLOWS_PATH = '/hub/workflows' export const HUB_APPS_PATH = '/hub/apps' diff --git a/apps/website/src/config/models-url-registry.test.ts b/apps/website/src/config/models-url-registry.test.ts index 830aed15cc6..b4bd40b7e1a 100644 --- a/apps/website/src/config/models-url-registry.test.ts +++ b/apps/website/src/config/models-url-registry.test.ts @@ -16,7 +16,7 @@ import { } from './models-url-registry' const hub: ModelsUrlEntry = { path: '/models', kind: 'hub' } -const roots = ['/models', '/hub/models', '/hub/workflows', '/hub/apps'] +const roots = ['/models', '/hub'] const sources = { models: new Map([['acme--image--generate-images', 'acme-image']]), @@ -28,6 +28,7 @@ const sources = { describe('models URL registry', () => { it.for<[string, string | undefined]>([ + ['/hub/', 'section'], ['/hub/models/', 'hub'], ['/models/', 'alias'], ['/hub/workflows/', 'section'], @@ -142,7 +143,7 @@ describe('models URL registry', () => { [ 'an address outside every root', [hub, { path: '/workflows/new', kind: 'model' }], - '/workflows/new is outside /models, /hub/models, /hub/workflows, /hub/apps' + '/workflows/new is outside /models, /hub' ] ])('rejects a registry with %s', ([, entries, message]) => { expect(() => buildModelsUrlRegistry(entries, roots)).toThrow(message) @@ -216,16 +217,9 @@ describe('models URL registry', () => { it('matches built pages when a root ends in a slash', () => { const registry = buildModelsUrlRegistry(modelsUrlEntries(sources), [ '/models/', - '/hub/models/', - '/hub/workflows/', - '/hub/apps/' - ]) - expect(registry.roots).toEqual([ - '/models', - '/hub/models', - '/hub/workflows', - '/hub/apps' + '/hub/' ]) + expect(registry.roots).toEqual(['/models', '/hub']) expect(modelsUrlKind('/hub/models/acme-image/', registry)).toBe('model') expect( unregisteredModelsPaths( diff --git a/apps/website/src/config/models-url-registry.ts b/apps/website/src/config/models-url-registry.ts index 88a24644779..a45665fd3dc 100644 --- a/apps/website/src/config/models-url-registry.ts +++ b/apps/website/src/config/models-url-registry.ts @@ -1,6 +1,7 @@ import { HUB_APPS_PATH, HUB_MODELS_PATH, + HUB_PATH, HUB_WORKFLOWS_PATH, hubAppHref, hubAppSlugs, @@ -75,6 +76,7 @@ export function modelsUrlEntries({ destination: atHub(hubSlug) }) return [ + { path: HUB_PATH, kind: 'section' }, { path: HUB_MODELS_PATH, kind: 'hub' }, { path: HUB_WORKFLOWS_PATH, kind: 'section' }, { path: HUB_APPS_PATH, kind: 'section' }, @@ -177,7 +179,7 @@ const modelsUrlRegistry = buildModelsUrlRegistry( aliases: hubModelAliases, localFiles: localModels.map(({ slug }) => slug) }), - [MODELS_BASE_PATH, HUB_MODELS_PATH, HUB_WORKFLOWS_PATH, HUB_APPS_PATH] + [MODELS_BASE_PATH, HUB_PATH] ) export const modelsUrlRoots = modelsUrlRegistry.roots diff --git a/apps/website/src/config/routes.ts b/apps/website/src/config/routes.ts index 1b006051604..e9388759bd4 100644 --- a/apps/website/src/config/routes.ts +++ b/apps/website/src/config/routes.ts @@ -56,6 +56,7 @@ const baseRoutes = { nanoBanana: '/nano-banana/', brand: '/brand/', // The hub catalogue. `workshop` keeps its old name. + hubExplore: '/hub/', workshop: '/hub/models/', hubWorkflows: '/hub/workflows/', hubApps: '/hub/apps/', @@ -89,7 +90,8 @@ type Routes = Readonly> // form, so no localized variant exists. See the comment header in // src/pages/minimax/license/professional-request.astro. // -// workshop, hubWorkflows, hubApps, workshopSignIn, cinematicStudio, reshoot: +// hubExplore, workshop, hubWorkflows, hubApps, workshopSignIn, cinematicStudio, +// reshoot: // English only. Every locale links the one catalogue. // // customerVideoBlackMath / customerVideoSilversideAi: dedicated watch pages @@ -107,6 +109,7 @@ const LOCALE_INVARIANT_ROUTE_KEYS = new Set([ 'enterpriseMsa', 'models', 'minimaxLicenseProfessionalRequest', + 'hubExplore', 'workshop', 'hubWorkflows', 'hubApps', diff --git a/apps/website/src/integrations/workshop-release-gate.test.ts b/apps/website/src/integrations/workshop-release-gate.test.ts index 8bd035103af..f9c7651366b 100644 --- a/apps/website/src/integrations/workshop-release-gate.test.ts +++ b/apps/website/src/integrations/workshop-release-gate.test.ts @@ -130,6 +130,7 @@ describe('Workshop release output', () => { it('builds every Models page either way and adds checkout only with Workshop', () => { const disabled = modelsBuildRoutes(false) expect(disabled.map((route) => route.pattern)).toEqual([ + '/hub', '/hub/models', '/hub/models/[slug]', '/hub/workflows', @@ -151,7 +152,9 @@ describe('Workshop release output', () => { '/zh-CN/checkout-return' ]) for (const routes of [disabled, enabled]) { - expect(routes[0].entrypoint).toContain('/routes/models/index.astro') + expect( + routes.find(({ pattern }) => pattern === '/hub/models')?.entrypoint + ).toContain('/routes/models/index.astro') for (const route of routes) expect(existsSync(route.entrypoint)).toBe(true) } diff --git a/apps/website/src/integrations/workshop-release-gate.ts b/apps/website/src/integrations/workshop-release-gate.ts index 87c6db7e272..4d06db96958 100644 --- a/apps/website/src/integrations/workshop-release-gate.ts +++ b/apps/website/src/integrations/workshop-release-gate.ts @@ -13,6 +13,7 @@ import { workshopClientBoundary } from './workshop-client-boundary' import { HUB_APPS_PATH, HUB_MODELS_PATH, + HUB_PATH, HUB_WORKFLOWS_PATH, oldModelLinks } from '@/config/hub-models' @@ -43,6 +44,7 @@ const WORKSHOP_ONLY_ROUTES = [ export function modelsBuildRoutes(enabled: boolean) { return [ + { pattern: HUB_PATH, entrypoint: entry('hub-section.astro') }, { pattern: HUB_MODELS_PATH, entrypoint: entry('index.astro') }, { pattern: `${HUB_MODELS_PATH}/[slug]`, entrypoint: entry('[slug].astro') }, { pattern: HUB_WORKFLOWS_PATH, entrypoint: entry('hub-section.astro') }, diff --git a/apps/website/src/lib/workshop/explore-art.test.ts b/apps/website/src/lib/workshop/explore-art.test.ts new file mode 100644 index 00000000000..6b73a1a8f8d --- /dev/null +++ b/apps/website/src/lib/workshop/explore-art.test.ts @@ -0,0 +1,142 @@ +import { describe, expect, it } from 'vitest' + +import type { WorkshopModel } from '@/config/models-catalogue' +import type { CatalogueApp } from './catalogue-apps' +import { doorArt } from './explore-art' + +const model = ( + slug: string, + thumbnail?: WorkshopModel['thumbnail'], + creditsPerRun?: number +): WorkshopModel => ({ + routerId: `acme/${slug}`, + slug, + name: `Name of ${slug}`, + workflowCount: 0, + capabilities: [], + thumbnail, + creditsPerRun +}) + +const app = (key: string, thumbnail?: CatalogueApp['thumbnail']) => ({ + key, + name: key, + task: '', + href: `/hub/${key}/`, + thumbnail +}) + +const NANO = 'vertexai--gemini-3-pro-image--generate-images' +const RUNWAY = 'runway--gen4-image--generate-images' + +describe('door art', () => { + it('fronts each door with the first candidate the catalogue holds', () => { + expect( + doorArt({ + models: [ + model(RUNWAY, { url: '/rowboat.png', kind: 'image' }, 6), + { + ...model(NANO, { url: '/lake.png', kind: 'image' }, 9), + provider: 'Google' + } + ], + workflows: [ + model('workflows/product-in-scene', { + url: '/bottle.webp', + kind: 'image' + }) + ], + apps: [ + app('apps/reshoot', { + url: '/reshoot.mp4', + kind: 'video', + poster: '/reshoot.jpg' + }) + ] + }) + ).toEqual({ + models: { + src: '/lake.png', + name: `Name of ${NANO}`, + provider: 'Google', + credits: 9, + prompt: 'workshop.explore.doorModelPromptLake' + }, + workflows: { src: '/bottle.webp' }, + apps: { + src: '/reshoot.jpg', + control: 'workshop.explore.doorAppControlRotation', + value: '35°' + } + }) + }) + + it.for([ + ['has no still', model(NANO, { url: '/clip.mp4', kind: 'video' })], + ['has no art', model(NANO)] + ] as const)('passes over a candidate that %s', ([, unusable]) => { + expect( + doorArt({ + models: [unusable, model(RUNWAY, { url: '/row.png', kind: 'image' })], + workflows: [], + apps: [] + }).models + ).toMatchObject({ + src: '/row.png', + prompt: 'workshop.explore.doorModelPromptRowboat' + }) + }) + + it.for([ + [ + 'its cover poster', + { url: '/studio.mp4', kind: 'video', poster: '/studio.jpg' }, + '/studio.jpg' + ], + ['its still cover', { url: '/studio.webp', kind: 'image' }, '/studio.webp'], + [ + 'the studio scene when its cover has no still', + { url: '/studio.mp4', kind: 'video' }, + '/images/cinematic-studio/neon-street.jpg' + ], + [ + 'the studio scene without a cover', + undefined, + '/images/cinematic-studio/neon-street.jpg' + ] + ] as const)('fronts the app door with %s', ([, cover, src]) => { + expect( + doorArt({ + models: [], + workflows: [], + apps: [app('apps/cinematic-studio', cover)] + }).apps?.src + ).toBe(src) + }) + + it('names a model without the task its card already shows', () => { + expect( + doorArt({ + models: [ + { + ...model(NANO, { url: '/lake.png', kind: 'image' }), + name: 'Nano Banana Pro Text-to-Image', + task: 'text-to-image' + } + ], + workflows: [], + apps: [] + }).models?.name + ).toBe('Nano Banana Pro') + }) + + it('leaves a door bare when the catalogue holds none of its candidates', () => { + expect( + doorArt({ + models: [model('other', { url: '/other.png', kind: 'image' })], + workflows: [], + apps: [app('apps/elsewhere', { url: '/x.jpg', kind: 'image' })] + }) + ).toEqual({}) + }) +}) diff --git a/apps/website/src/lib/workshop/explore-art.ts b/apps/website/src/lib/workshop/explore-art.ts new file mode 100644 index 00000000000..1e94e65441f --- /dev/null +++ b/apps/website/src/lib/workshop/explore-art.ts @@ -0,0 +1,124 @@ +import type { WorkshopModel } from '@/config/models-catalogue' +import type { Locale, TranslationKey } from '@/i18n/translations' +import type { CatalogueApp } from '@/lib/workshop/catalogue-apps' +import { nameWithoutTask, taskLabelFor } from '@/lib/workshop/task-label' + +export type HubDoor = 'models' | 'workflows' | 'apps' + +interface ModelDoorArt { + readonly src: string + readonly name: string + readonly provider?: string + readonly usd?: number + readonly credits?: number + readonly prompt: TranslationKey +} + +interface WorkflowDoorArt { + readonly src: string +} + +interface AppDoorArt { + readonly src: string + readonly control: TranslationKey + readonly value: string +} + +export interface DoorArt { + readonly models?: ModelDoorArt + readonly workflows?: WorkflowDoorArt + readonly apps?: AppDoorArt +} + +/** Each door's candidates, best first, with the copy that matches its image. */ +const MODEL_CANDIDATES = [ + { + slug: 'vertexai--gemini-3-pro-image--generate-images', + prompt: 'workshop.explore.doorModelPromptLake' + }, + { + slug: 'runway--gen4-image--generate-images', + prompt: 'workshop.explore.doorModelPromptRowboat' + } +] as const satisfies readonly { slug: string; prompt: TranslationKey }[] + +const WORKFLOW_CANDIDATES = ['workflows/product-in-scene'] as const + +const APP_CANDIDATES = [ + { + key: 'apps/cinematic-studio', + image: '/images/cinematic-studio/neon-street.jpg', + control: 'workshop.explore.doorAppControlFocal', + value: '35mm' + }, + { + key: 'apps/reshoot', + image: '/images/cinematic-studio/train.jpg', + control: 'workshop.explore.doorAppControlRotation', + value: '35°' + } +] as const satisfies readonly { + key: string + image: string + control: TranslationKey + value: string +}[] + +type Thumbnail = WorkshopModel['thumbnail'] + +const stillOf = (thumbnail: Thumbnail) => + thumbnail?.kind === 'image' ? thumbnail.url : thumbnail?.poster + +function firstWithStill( + candidates: readonly C[], + find: (candidate: C) => T | undefined +) { + for (const candidate of candidates) { + const item = find(candidate) + const src = stillOf(item?.thumbnail) + if (item && src) return { candidate, item, src } + } + return undefined +} + +/** Picks one real catalogue item per door to show what that format looks like. */ +export function doorArt( + catalogue: { + readonly models: readonly WorkshopModel[] + readonly workflows: readonly WorkshopModel[] + readonly apps: readonly CatalogueApp[] + }, + locale: Locale = 'en' +): DoorArt { + const model = firstWithStill(MODEL_CANDIDATES, ({ slug }) => + catalogue.models.find((item) => item.slug === slug) + ) + const workflow = firstWithStill(WORKFLOW_CANDIDATES, (slug) => + catalogue.workflows.find((item) => item.slug === slug) + ) + const app = APP_CANDIDATES.flatMap((candidate) => { + const listed = catalogue.apps.find((item) => item.key === candidate.key) + return listed + ? [{ ...candidate, image: stillOf(listed.thumbnail) ?? candidate.image }] + : [] + }).at(0) + return { + ...(model && { + models: { + src: model.src, + name: nameWithoutTask( + model.item.name, + taskLabelFor(model.item, locale) + ), + provider: model.item.provider, + usd: model.item.priceUsdFrom, + credits: model.item.creditsPerRun, + prompt: model.candidate.prompt + } + }), + ...(workflow && { workflows: { src: workflow.src } }), + ...(app && { + apps: { src: app.image, control: app.control, value: app.value } + }) + } +} diff --git a/apps/website/src/lib/workshop/hub-section.ts b/apps/website/src/lib/workshop/hub-section.ts new file mode 100644 index 00000000000..47b5a94e719 --- /dev/null +++ b/apps/website/src/lib/workshop/hub-section.ts @@ -0,0 +1,6 @@ +import type { CatalogueTab } from '@/components/workshop/CatalogueTabs.vue' + +export type HubSection = CatalogueTab | 'explore' + +/** PostHog flag that opens the Hub home; everyone else reads the showcase. */ +export const HUB_HOME_FLAG = 'hub-home-enabled' diff --git a/apps/website/src/locales/en/main.json b/apps/website/src/locales/en/main.json index 7e1f737d073..80624eb9ec4 100644 --- a/apps/website/src/locales/en/main.json +++ b/apps/website/src/locales/en/main.json @@ -663,7 +663,30 @@ "notSaved": "This generation could not be saved to your assets. The result is still on the page until it expires.", "cancelError": "Could not request cancellation. Your generation may still be running." }, - "cinematic": {} + "cinematic": {}, + "explore": { + "subtitle": "Pick an app, remix a workflow or call a model.", + "doors": "Browse by format", + "modelsIntent": "Run or call any model", + "modelsTitle": "Models", + "modelsHint": "Call the latest models from your code. Try them here first.", + "workflowsIntent": "Download and remix", + "workflowsHint": "Open the graph and change any step.", + "appsIntent": "Make it in one click", + "appsHint": "Upload, click, done. No nodes, no setup.", + "doorModelRun": "Run", + "doorModelPromptLake": "Alpine lake at blue hour", + "doorModelPromptRowboat": "Rowboat on a tropical lagoon", + "doorWorkflows": "Workflows", + "doorWorkflowStep": "Relight", + "doorWorkflowLight": "light", + "doorWorkflowStrength": "strength", + "doorWorkflowSave": "Save Image", + "doorApps": "Apps", + "doorAppGenerate": "Generate", + "doorAppControlFocal": "Focal length", + "doorAppControlRotation": "Rotation" + } }, "auth": { "signIn": { diff --git a/apps/website/src/locales/zh-CN/main.json b/apps/website/src/locales/zh-CN/main.json index a98bcfc1223..94b4a1772e0 100644 --- a/apps/website/src/locales/zh-CN/main.json +++ b/apps/website/src/locales/zh-CN/main.json @@ -5149,6 +5149,29 @@ "zoomIn": "放大", "zoomOut": "缩小", "zoomReset": "重置" + }, + "explore": { + "subtitle": "挑一个应用,改编一个工作流,或调用一个模型。", + "doors": "按类型浏览", + "modelsIntent": "运行或调用任意模型", + "modelsTitle": "模型", + "modelsHint": "在代码中调用最新模型,也可以先在这里试用。", + "workflowsIntent": "下载并二次创作", + "workflowsHint": "打开节点图,修改任意步骤。", + "appsIntent": "一键生成", + "appsHint": "上传,点击,完成。无需节点,无需配置。", + "doorModelRun": "运行", + "doorModelPromptLake": "蓝调时刻的高山湖泊", + "doorModelPromptRowboat": "热带泻湖上的小划艇", + "doorWorkflows": "工作流", + "doorWorkflowStep": "重新打光", + "doorWorkflowLight": "光线", + "doorWorkflowStrength": "强度", + "doorWorkflowSave": "Save Image", + "doorApps": "应用", + "doorAppGenerate": "生成", + "doorAppControlFocal": "焦距", + "doorAppControlRotation": "旋转" } } } diff --git a/apps/website/src/routes/models/hub-section-copy.ts b/apps/website/src/routes/models/hub-section-copy.ts index aaa982fe783..d1ebecc2676 100644 --- a/apps/website/src/routes/models/hub-section-copy.ts +++ b/apps/website/src/routes/models/hub-section-copy.ts @@ -1,7 +1,13 @@ -import type { CatalogueTab } from '@/components/workshop/CatalogueTabs.vue' +import type { HubSection } from '@/lib/workshop/hub-section' // Server-rendered only: translations.ts ships whole to every island, so page head copy lives here. export const HUB_SECTION_COPY = { + explore: { + title: 'Comfy Hub: AI Apps, Workflows & Models - Comfy', + description: + 'Find a starting point in the Comfy Hub: ready-made apps, workflows you can control step by step, and models you can call by API.', + heading: 'What will you make?' + }, workflows: { title: 'ComfyUI Workflows: Multi-Step AI Image & Video Workflows - Comfy', description: @@ -15,6 +21,6 @@ export const HUB_SECTION_COPY = { heading: 'ComfyUI apps' } } as const satisfies Record< - Exclude, + Exclude, Readonly> > diff --git a/apps/website/src/routes/models/hub-section.astro b/apps/website/src/routes/models/hub-section.astro index 6732b49a1f8..f7c3aecfc99 100644 --- a/apps/website/src/routes/models/hub-section.astro +++ b/apps/website/src/routes/models/hub-section.astro @@ -1,13 +1,18 @@ --- import BaseLayout from '@/layouts/BaseLayout.astro' import ModelsPage from '@/components/workshop/ModelsPage.vue' -import type { CatalogueTab } from '@/components/workshop/CatalogueTabs.vue' +import type { HubSection } from '@/lib/workshop/hub-section' import ModelsShowcase from '@/components/models/ModelsShowcase.astro' -import { HUB_APPS_PATH, HUB_WORKFLOWS_PATH } from '@/config/hub-models' +import { + HUB_APPS_PATH, + HUB_PATH, + HUB_WORKFLOWS_PATH +} from '@/config/hub-models' import { isIndexableModelPage } from '@/config/indexing' import { HUB_SECTION_COPY } from './hub-section-copy' -const SECTIONS: Readonly>> = { +const SECTIONS: Readonly>> = { + [HUB_PATH]: 'explore', [HUB_WORKFLOWS_PATH]: 'workflows', [HUB_APPS_PATH]: 'apps' } From 611824875dc9c65fa7ceecf4ab4efca3fef854f2 Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Wed, 14 Oct 2026 23:04:45 +0000 Subject: [PATCH 2/3] feat(website): search and a popular row on the Hub home The Hub home opened on the three doors alone. Add a search box above them that answers across apps, workflows and models, and a popular row underneath so the page is never empty. Typing puts the doors away and shows what matches, with a count per kind linking into each catalogue; clearing brings the doors back. All of it stays behind the Hub home flag. --- .../src/components/workshop/ExploreFinder.vue | 31 +++++ .../components/workshop/ExploreHome.test.ts | 51 +++++++ .../src/components/workshop/ExploreHome.vue | 86 +++++++++++- .../components/workshop/ExploreKindTag.vue | 59 +++++++++ .../workshop/ExploreResultCard.test.ts | 116 ++++++++++++++++ .../components/workshop/ExploreResultCard.vue | 95 +++++++++++++ .../components/workshop/ExploreResults.vue | 125 ++++++++++++++++++ .../workshop/ExploreResultsHeading.vue | 67 ++++++++++ apps/website/src/lib/hub/model-logos.ts | 2 + .../src/lib/workshop/explore-search.test.ts | 91 +++++++++++++ .../src/lib/workshop/explore-search.ts | 71 ++++++++++ apps/website/src/locales/en/main.json | 48 ++++--- apps/website/src/locales/zh-CN/main.json | 48 ++++--- 13 files changed, 856 insertions(+), 34 deletions(-) create mode 100644 apps/website/src/components/workshop/ExploreFinder.vue create mode 100644 apps/website/src/components/workshop/ExploreHome.test.ts create mode 100644 apps/website/src/components/workshop/ExploreKindTag.vue create mode 100644 apps/website/src/components/workshop/ExploreResultCard.test.ts create mode 100644 apps/website/src/components/workshop/ExploreResultCard.vue create mode 100644 apps/website/src/components/workshop/ExploreResults.vue create mode 100644 apps/website/src/components/workshop/ExploreResultsHeading.vue create mode 100644 apps/website/src/lib/workshop/explore-search.test.ts create mode 100644 apps/website/src/lib/workshop/explore-search.ts diff --git a/apps/website/src/components/workshop/ExploreFinder.vue b/apps/website/src/components/workshop/ExploreFinder.vue new file mode 100644 index 00000000000..6e143dc42d7 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreFinder.vue @@ -0,0 +1,31 @@ + + + diff --git a/apps/website/src/components/workshop/ExploreHome.test.ts b/apps/website/src/components/workshop/ExploreHome.test.ts new file mode 100644 index 00000000000..a85a58e60df --- /dev/null +++ b/apps/website/src/components/workshop/ExploreHome.test.ts @@ -0,0 +1,51 @@ +import userEvent from '@testing-library/user-event' +import { render, screen, waitFor, within } from '@testing-library/vue' +import { describe, expect, it } from 'vitest' + +import { workshopModels } from '@/config/workshop-browse-content' +import ExploreHome from './ExploreHome.vue' + +const renderHome = () => + render(ExploreHome, { props: { models: workshopModels, appsShown: true } }) + +const resultNames = () => + within(screen.getByTestId('explore-results')) + .getAllByRole('link') + .map((link) => link.textContent.trim()) + +describe('Hub home', () => { + it('opens on the doors and the popular row', () => { + renderHome() + + expect(screen.getByTestId('explore-doors')).toBeTruthy() + expect(resultNames().length).toBeGreaterThan(0) + }) + + it('answers a search with what matches it, and puts the doors away', async () => { + renderHome() + + await userEvent + .setup() + .type(screen.getByTestId('explore-search'), 'upscale') + + await waitFor(() => + expect(screen.queryByTestId('explore-doors')).toBeNull() + ) + const names = resultNames().join(' ').toLowerCase() + expect(names).toContain('upscale') + }) + + it('brings the doors back when the search is cleared', async () => { + renderHome() + const user = userEvent.setup() + const box = screen.getByTestId('explore-search') + + await user.type(box, 'upscale') + await waitFor(() => + expect(screen.queryByTestId('explore-doors')).toBeNull() + ) + await user.clear(box) + + expect(await screen.findByTestId('explore-doors')).toBeTruthy() + }) +}) diff --git a/apps/website/src/components/workshop/ExploreHome.vue b/apps/website/src/components/workshop/ExploreHome.vue index b52c189dc86..699f455de8c 100644 --- a/apps/website/src/components/workshop/ExploreHome.vue +++ b/apps/website/src/components/workshop/ExploreHome.vue @@ -1,17 +1,26 @@ diff --git a/apps/website/src/components/workshop/ExploreKindTag.vue b/apps/website/src/components/workshop/ExploreKindTag.vue new file mode 100644 index 00000000000..76ae6ce5448 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreKindTag.vue @@ -0,0 +1,59 @@ + + + diff --git a/apps/website/src/components/workshop/ExploreResultCard.test.ts b/apps/website/src/components/workshop/ExploreResultCard.test.ts new file mode 100644 index 00000000000..044f1a9f5d9 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreResultCard.test.ts @@ -0,0 +1,116 @@ +import { render, screen, within } from '@testing-library/vue' +import { describe, expect, it } from 'vitest' + +import ExploreResultCard from './ExploreResultCard.vue' + +const still = { + name: 'Relight', + thumbnail: { url: '/still.jpg', kind: 'image' } +} as const + +describe('ExploreResultCard', () => { + it.for([ + { art: 'a still', model: still, images: ['/still.jpg'] }, + { art: 'nothing', model: undefined, images: [] } + ] as const)( + 'reads as its name and its pills with $art', + ({ model, images }) => { + render(ExploreResultCard, { + props: { + href: '/hub/workflows/relight/', + kind: 'workflow', + name: 'Relight', + pills: ['Edit images'], + model + } + }) + + expect(screen.getByRole('link')).toHaveTextContent( + /^\s*Workflow\s*Relight\s*Edit images\s*$/ + ) + expect( + screen.queryAllByAltText('').map((img) => img.getAttribute('src')) + ).toEqual(images) + } + ) + + it('marks its kind top left and its maker top right over the artwork', () => { + render(ExploreResultCard, { + props: { + href: '/hub/models/beeble/', + kind: 'model', + name: 'Beeble SwitchX', + model: still, + source: 'Beeble', + logo: '/logos/beeble.svg', + pills: ['Edit images'] + } + }) + + const artwork = within(screen.getByTestId('explore-artwork')) + const meta = within(screen.getByTestId('explore-meta')) + expect(artwork.getByTestId('explore-kind')).toHaveTextContent('Model') + expect(artwork.getByTestId('explore-kind')).toHaveClass('top-4', 'left-4') + expect(artwork.getByTestId('explore-source')).toHaveTextContent('Beeble') + expect(artwork.getByTestId('explore-source')).toHaveClass( + 'top-4', + 'right-4' + ) + expect(artwork.getByTestId('model-card-provider-logo')).toHaveStyle({ + maskImage: 'url(/logos/beeble.svg)' + }) + expect( + within(meta.getByTestId('explore-pills')) + .getAllByText(/./) + .map((pill) => pill.textContent.trim()) + ).toEqual(['Edit images']) + expect(screen.getByRole('link')).toHaveTextContent( + /^\s*Model\s*Beeble\s*Beeble SwitchX\s*Edit images\s*$/ + ) + }) + + it('names the maker over the artwork when it has no logo', () => { + render(ExploreResultCard, { + props: { kind: 'workflow', name: 'Relight', source: 'Nobody', pills: [] } + }) + + expect(screen.getByTestId('explore-source')).toHaveTextContent('Nobody') + expect(screen.queryByTestId('model-card-provider-logo')).toBeNull() + }) + + it('shows the kind as an icon and keeps its name for screen readers', () => { + render(ExploreResultCard, { + props: { kind: 'model', name: 'Beeble SwitchX', model: still, pills: [] } + }) + + expect(screen.getByText('Model')).toHaveClass('sr-only') + }) + + it.for([ + { + href: '/hub/apps/cinematic-studio/', + newTab: true, + links: 1, + target: '_blank' + }, + { + href: '/hub/workflows/relight/', + newTab: false, + links: 1, + target: undefined + }, + { href: undefined, newTab: true, links: 0, target: undefined } + ])( + 'opens an app in a tab of its own, and nothing for one still coming ($href)', + ({ href, newTab, links, target }) => { + render(ExploreResultCard, { + props: { href, newTab, kind: 'app', name: 'Relight', pills: [] } + }) + + expect(screen.queryAllByRole('link')).toHaveLength(links) + expect( + screen.getByTestId('explore-result').getAttribute('target') ?? undefined + ).toBe(target) + } + ) +}) diff --git a/apps/website/src/components/workshop/ExploreResultCard.vue b/apps/website/src/components/workshop/ExploreResultCard.vue new file mode 100644 index 00000000000..9a7d56f4f43 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreResultCard.vue @@ -0,0 +1,95 @@ + + + diff --git a/apps/website/src/components/workshop/ExploreResults.vue b/apps/website/src/components/workshop/ExploreResults.vue new file mode 100644 index 00000000000..96e89beec51 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreResults.vue @@ -0,0 +1,125 @@ + + + diff --git a/apps/website/src/components/workshop/ExploreResultsHeading.vue b/apps/website/src/components/workshop/ExploreResultsHeading.vue new file mode 100644 index 00000000000..79b6b3836e6 --- /dev/null +++ b/apps/website/src/components/workshop/ExploreResultsHeading.vue @@ -0,0 +1,67 @@ + + + diff --git a/apps/website/src/lib/hub/model-logos.ts b/apps/website/src/lib/hub/model-logos.ts index 2b14f42da0b..f56a6a57eab 100644 --- a/apps/website/src/lib/hub/model-logos.ts +++ b/apps/website/src/lib/hub/model-logos.ts @@ -43,6 +43,8 @@ const MODEL_TO_LOGO: Record = { Sonilo: 'sonilo' } +export const COMFY_LOGO_PATH = '/icons/logomark.svg' + function escapeRegex(value: string): string { return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') } diff --git a/apps/website/src/lib/workshop/explore-search.test.ts b/apps/website/src/lib/workshop/explore-search.test.ts new file mode 100644 index 00000000000..1658cd0c2b1 --- /dev/null +++ b/apps/website/src/lib/workshop/explore-search.test.ts @@ -0,0 +1,91 @@ +import { describe, expect, it } from 'vitest' + +import type { + WorkflowWorkshopModel, + WorkshopModel +} from '@/config/models-catalogue' +import type { CatalogueApp } from './catalogue-apps' +import { exploreRow, searchExplore } from './explore-search' + +const workflow = (name: string, summary = ''): WorkflowWorkshopModel => ({ + type: 'CLOUD', + workflowId: name, + slug: `workflows/${name}`, + name, + href: `/hub/workflows/${name}/`, + workflowCount: 0, + capabilities: [], + summary +}) + +const model = ( + name: string, + capabilities: readonly string[] = [] +): WorkshopModel => ({ + routerId: `lab/${name}`, + slug: name, + name, + href: `/hub/models/${name}/`, + workflowCount: 0, + capabilities +}) + +const app = ( + name: string, + task: string, + href = '/hub/apps/' +): CatalogueApp => ({ + key: name, + name, + task, + href +}) + +const catalogue = { + apps: [ + app('Cinematic Studio', 'Direct every shot', '/hub/apps/cinematic-studio/'), + app('Relight', 'Point the light where you want it.') + ], + workflows: [ + workflow('Match lighting', 'Relight a portrait from a reference.'), + workflow('Upscale a video', 'Sharper footage.') + ], + models: [ + model('Switch Video', ['relighting']), + model('Relight Pro'), + model('Painter', ['text-to-image']) + ] +} + +describe('searchExplore', () => { + it('finds every kind a query names, by name, capability or summary', () => { + const found = searchExplore(catalogue, ' Relight ') + + expect(found.apps.map(({ name }) => name)).toEqual(['Relight']) + expect(found.workflows.map(({ name }) => name)).toEqual(['Match lighting']) + expect(found.models.map(({ name }) => name)).toEqual([ + 'Relight Pro', + 'Switch Video' + ]) + }) + + it('finds nothing for a query nothing names', () => { + expect(searchExplore(catalogue, 'sprite')).toEqual({ + apps: [], + workflows: [], + models: [] + }) + }) +}) + +describe('exploreRow', () => { + it('lists workflows, then apps, then models, up to the limit', () => { + const found = searchExplore(catalogue, 'relight') + + expect( + exploreRow(found, 3).map((entry) => + entry.kind === 'app' ? `app:${entry.app.name}` : entry.model.slug + ) + ).toEqual(['workflows/Match lighting', 'app:Relight', 'Relight Pro']) + }) +}) diff --git a/apps/website/src/lib/workshop/explore-search.ts b/apps/website/src/lib/workshop/explore-search.ts new file mode 100644 index 00000000000..7d1ae2fbcbf --- /dev/null +++ b/apps/website/src/lib/workshop/explore-search.ts @@ -0,0 +1,71 @@ +import type { + WorkflowWorkshopModel, + WorkshopModel +} from '@/config/models-catalogue' +import { filterWorkshopModels } from '@/config/models-catalogue' +import type { CatalogueApp } from './catalogue-apps' + +export type ExploreKind = 'model' | 'workflow' | 'app' + +export type ExploreEntry = + | { readonly kind: 'app'; readonly app: CatalogueApp } + | { readonly kind: 'workflow' | 'model'; readonly model: WorkshopModel } + +export interface ExploreCount { + readonly kind: 'models' | 'workflows' | 'apps' + readonly count: number + /** That kind's own page, narrowed to the query where it can be. */ + readonly href: string +} + +export interface ExploreMatches { + readonly apps: readonly CatalogueApp[] + readonly workflows: readonly WorkflowWorkshopModel[] + readonly models: readonly WorkshopModel[] +} + +function namedFirst( + list: readonly T[], + needle: string +): T[] { + const leads = (item: T) => item.name.toLowerCase().startsWith(needle) + return [...list].sort((a, b) => Number(leads(b)) - Number(leads(a))) +} + +/** + * Everything in the Hub a query finds: a model or workflow by what the + * catalogue search reads (name, provider, use case, capabilities) or by its + * summary, an app by its name or what it does. Names that start with the + * query lead each kind. + */ +export function searchExplore( + catalogue: ExploreMatches, + query: string +): ExploreMatches { + const needle = query.trim().toLowerCase() + const matches = (model: WorkshopModel) => + filterWorkshopModels([model], { query: needle }).length > 0 || + (model.summary ?? '').toLowerCase().includes(needle) + return { + apps: namedFirst( + catalogue.apps.filter((app) => + `${app.name} ${app.task}`.toLowerCase().includes(needle) + ), + needle + ), + workflows: namedFirst(catalogue.workflows.filter(matches), needle), + models: namedFirst(catalogue.models.filter(matches), needle) + } +} + +/** One row of results: workflows, then apps, then models, up to `limit`. */ +export function exploreRow( + matches: ExploreMatches, + limit: number +): ExploreEntry[] { + return [ + ...matches.workflows.map((model) => ({ kind: 'workflow' as const, model })), + ...matches.apps.map((app) => ({ kind: 'app' as const, app })), + ...matches.models.map((model) => ({ kind: 'model' as const, model })) + ].slice(0, limit) +} diff --git a/apps/website/src/locales/en/main.json b/apps/website/src/locales/en/main.json index 80624eb9ec4..d6900e78443 100644 --- a/apps/website/src/locales/en/main.json +++ b/apps/website/src/locales/en/main.json @@ -665,27 +665,43 @@ }, "cinematic": {}, "explore": { - "subtitle": "Pick an app, remix a workflow or call a model.", - "doors": "Browse by format", - "modelsIntent": "Run or call any model", - "modelsTitle": "Models", - "modelsHint": "Call the latest models from your code. Try them here first.", - "workflowsIntent": "Download and remix", - "workflowsHint": "Open the graph and change any step.", - "appsIntent": "Make it in one click", + "appOpen": "Open", + "appSoon": "Soon", "appsHint": "Upload, click, done. No nodes, no setup.", - "doorModelRun": "Run", + "appsIntent": "Make it in one click", + "clear": "Clear search", + "countApps": "{count} app | {count} apps", + "countModels": "{count} model | {count} models", + "countWorkflows": "{count} workflow | {count} workflows", + "doorAppControlFocal": "Focal length", + "doorAppControlRotation": "Rotation", + "doorAppGenerate": "Generate", + "doorApps": "Apps", "doorModelPromptLake": "Alpine lake at blue hour", "doorModelPromptRowboat": "Rowboat on a tropical lagoon", - "doorWorkflows": "Workflows", - "doorWorkflowStep": "Relight", + "doorModelRun": "Run", "doorWorkflowLight": "light", - "doorWorkflowStrength": "strength", "doorWorkflowSave": "Save Image", - "doorApps": "Apps", - "doorAppGenerate": "Generate", - "doorAppControlFocal": "Focal length", - "doorAppControlRotation": "Rotation" + "doorWorkflowStep": "Relight", + "doorWorkflowStrength": "strength", + "doorWorkflows": "Workflows", + "doors": "Browse by format", + "empty": "Nothing matches yet.", + "kindApp": "App", + "kindModel": "Model", + "kinds": "Results by kind", + "modelsHint": "Call the latest models from your code. Try them here first.", + "modelsIntent": "Run or call any model", + "modelsTitle": "Models", + "popularTitle": "Popular", + "resultsFor": "Results for “{query}”", + "searchLabel": "Search the Hub", + "searchPlaceholder": "Try “relight”, “upscale” or a model name", + "subtitle": "Pick an app, remix a workflow or call a model.", + "useCasesTitle": "Browse by what you want to make", + "workflowPill": "Workflow", + "workflowsHint": "Open the graph and change any step.", + "workflowsIntent": "Download and remix" } }, "auth": { diff --git a/apps/website/src/locales/zh-CN/main.json b/apps/website/src/locales/zh-CN/main.json index 94b4a1772e0..5eea1598c1d 100644 --- a/apps/website/src/locales/zh-CN/main.json +++ b/apps/website/src/locales/zh-CN/main.json @@ -5151,27 +5151,43 @@ "zoomReset": "重置" }, "explore": { - "subtitle": "挑一个应用,改编一个工作流,或调用一个模型。", - "doors": "按类型浏览", - "modelsIntent": "运行或调用任意模型", - "modelsTitle": "模型", - "modelsHint": "在代码中调用最新模型,也可以先在这里试用。", - "workflowsIntent": "下载并二次创作", - "workflowsHint": "打开节点图,修改任意步骤。", - "appsIntent": "一键生成", + "appOpen": "打开", + "appSoon": "即将推出", "appsHint": "上传,点击,完成。无需节点,无需配置。", - "doorModelRun": "运行", + "appsIntent": "一键生成", + "clear": "清除搜索", + "countApps": "{count} 个应用 | {count} 个应用", + "countModels": "{count} 个模型 | {count} 个模型", + "countWorkflows": "{count} 个工作流 | {count} 个工作流", + "doorAppControlFocal": "焦距", + "doorAppControlRotation": "旋转", + "doorAppGenerate": "生成", + "doorApps": "应用", "doorModelPromptLake": "蓝调时刻的高山湖泊", "doorModelPromptRowboat": "热带泻湖上的小划艇", - "doorWorkflows": "工作流", - "doorWorkflowStep": "重新打光", + "doorModelRun": "运行", "doorWorkflowLight": "光线", - "doorWorkflowStrength": "强度", "doorWorkflowSave": "Save Image", - "doorApps": "应用", - "doorAppGenerate": "生成", - "doorAppControlFocal": "焦距", - "doorAppControlRotation": "旋转" + "doorWorkflowStep": "重新打光", + "doorWorkflowStrength": "强度", + "doorWorkflows": "工作流", + "doors": "按类型浏览", + "empty": "暂时没有匹配的结果。", + "kindApp": "应用", + "kindModel": "模型", + "kinds": "按类型查看结果", + "modelsHint": "在代码中调用最新模型,也可以先在这里试用。", + "modelsIntent": "运行或调用任意模型", + "modelsTitle": "模型", + "popularTitle": "热门", + "resultsFor": "“{query}”的结果", + "searchLabel": "搜索 Hub", + "searchPlaceholder": "试试“relight”、“upscale”或模型名称", + "subtitle": "挑一个应用,改编一个工作流,或调用一个模型。", + "useCasesTitle": "按你想创作的内容浏览", + "workflowPill": "工作流", + "workflowsHint": "打开节点图,修改任意步骤。", + "workflowsIntent": "下载并二次创作" } } } From 7b8d8893ce9abbfec59a1ac40b1b45b3a2bcf679 Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Thu, 15 Oct 2026 07:50:39 +0000 Subject: [PATCH 3/3] feat(website): a way into the Hub home from the Hub menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Hub home had no way in: nothing on the site linked to it. Add a row at the top of the Hub menu — an intro line and "Explore the Hub" — on desktop and on mobile, and left-align the open panel so the wider row sits under its trigger. It rides the same flag as the Hub home, so a visitor the flag has not answered for sees the menu exactly as it is today. --- .../common/HeaderMain/HeaderMain.vue | 4 + .../HeaderMain/HeaderMainDesktop.test.ts | 28 ++- .../common/HeaderMain/HeaderMainDesktop.vue | 10 +- .../HeaderMain/HeaderMainMobile.test.ts | 24 +- .../common/HeaderMain/HeaderMainMobile.vue | 17 ++ .../common/HeaderMain/NavExploreRow.vue | 34 +++ .../ui/navigation-menu/NavigationMenu.vue | 10 +- apps/website/src/data/mainNavigation.test.ts | 31 ++- apps/website/src/data/mainNavigation.ts | 21 +- apps/website/src/locales/en/main.json | 208 +++++++++--------- apps/website/src/locales/zh-CN/main.json | 2 + 11 files changed, 274 insertions(+), 115 deletions(-) create mode 100644 apps/website/src/components/common/HeaderMain/NavExploreRow.vue diff --git a/apps/website/src/components/common/HeaderMain/HeaderMain.vue b/apps/website/src/components/common/HeaderMain/HeaderMain.vue index f2bedd7658d..9fe749136e9 100644 --- a/apps/website/src/components/common/HeaderMain/HeaderMain.vue +++ b/apps/website/src/components/common/HeaderMain/HeaderMain.vue @@ -26,8 +26,10 @@ import { useWorkshopAppsEnabled, useWorkshopAuthFlag, useWorkshopEnabled, + useWorkshopFlag, useWorkshopWorkflowsEnabled } from '@/scripts/posthog.ts' +import { HUB_HOME_FLAG } from '@/lib/workshop/hub-section.ts' import { isWorkshopModelShown } from '@/scripts/workshop-model-flags.ts' import type { HubApp, HubSections } from '@/data/mainNavigation.ts' import GitHubStarBadge from '@/components/common/GitHubStarBadge.vue' @@ -57,9 +59,11 @@ const showWorkshop = computed( ) const workflowsEnabled = useWorkshopWorkflowsEnabled() const appsEnabled = useWorkshopAppsEnabled() +const hubHomeEnabled = useWorkshopFlag(HUB_HOME_FLAG) const hubSections = computed(() => ({ workflows: showWorkshop.value && workflowsEnabled.value, apps: showWorkshop.value && appsEnabled.value, + explore: mounted.value && hubHomeEnabled.value, reshoot: showWorkshop.value && appsEnabled.value && diff --git a/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts b/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts index 684ec6acdb3..bc7812d31c6 100644 --- a/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts +++ b/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.test.ts @@ -9,7 +9,8 @@ import HeaderMainDesktop from './HeaderMainDesktop.vue' const ALL_SECTIONS: HubSections = { workflows: true, apps: true, - reshoot: true + reshoot: true, + explore: true } async function openHub(hubSections: HubSections = ALL_SECTIONS) { @@ -111,7 +112,8 @@ describe('HeaderMainDesktop', () => { const menu = await openHub({ workflows: false, apps: false, - reshoot: false + reshoot: false, + explore: false }) expect(menu.queryByRole('list', { name: 'Workflows' })).toBeNull() @@ -152,3 +154,25 @@ describe('HeaderMainDesktop', () => { } ) }) + +describe('Hub menu: the way into the Hub home', () => { + it('offers the way in once the flag opens the Hub home', async () => { + const menu = await openHub() + + expect(menu.getByTestId('nav-explore-row')).toBeTruthy() + expect(menu.getByTestId('nav-explore-link').getAttribute('href')).toBe( + '/hub/' + ) + }) + + it('leaves the way in out while the flag is closed', async () => { + const menu = await openHub({ + workflows: true, + apps: true, + reshoot: true, + explore: false + }) + + expect(menu.queryByTestId('nav-explore-row')).toBeNull() + }) +}) diff --git a/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.vue b/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.vue index 40e9674f1f2..9d9f0df88af 100644 --- a/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.vue +++ b/apps/website/src/components/common/HeaderMain/HeaderMainDesktop.vue @@ -15,6 +15,7 @@ import { NO_HUB_SECTIONS, getMainNavigation } from '@/data/mainNavigation' import type { HubSections, NavItem } from '@/data/mainNavigation' import type { Locale } from '@/i18n/translations' import NavColumn from './NavColumn.vue' +import NavExploreRow from './NavExploreRow.vue' import NavFeaturedCard from './NavFeaturedCard.vue' import NewBadge from './NewBadge.vue' @@ -58,7 +59,10 @@ function isNavItemActive(navItem: NavItem, path: string): boolean {