Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion apps/website/e2e/gemini-omni.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { test } from './fixtures/blockExternalMedia'

const PATH = '/gemini-omni'
const ZH_PATH = '/zh-CN/gemini-omni'
const HERO_TITLE = `${t('geminiOmni.hero.titleModel', {}, { locale: 'en' })}${t('geminiOmni.hero.titleRest', {}, { locale: 'en' })}`
const HERO_TITLE = t(
'geminiOmni.hero.headline',
{ model: t('geminiOmni.hero.titleModel', {}, { locale: 'en' }) },
{ locale: 'en' }
)
const MODELS_HEADING = t('geminiOmni.models.heading', {}, { locale: 'en' })
const STEPS_HEADING = t('geminiOmni.steps.heading', {}, { locale: 'en' })
const STEPS_CTA = t('geminiOmni.steps.secondaryCta', {}, { locale: 'en' })
Expand Down
8 changes: 5 additions & 3 deletions apps/website/e2e/minimax-h3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { test } from './fixtures/blockExternalMedia'
import { waitForIsland } from './fixtures/islands'

const PATH = '/minimax-h3'
const HERO_TITLE =
t('minimax.hero.titleModel', {}, { locale: 'en' }) +
t('minimax.hero.titleRest', {}, { locale: 'en' })
const HERO_TITLE = t(
'minimax.hero.headline',
{ model: t('minimax.hero.titleModel', {}, { locale: 'en' }) },
{ locale: 'en' }
)
const MODELS_HEADING = t('minimax.models.heading', {}, { locale: 'en' })
const MODELS_ROUTE = getRoutes('en').workshop
const CTA_HEADING = t('minimax.cta.heading', {}, { locale: 'en' })
Expand Down
27 changes: 20 additions & 7 deletions apps/website/src/components/blocks/ReasonsSplit01.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ const meta: Meta<typeof ReasonsSplit01> = {
template: '<div class="bg-primary-comfy-ink"><story /></div>'
})
],
render: (args) => ({
components: { ReasonsSplit01 },
setup: () => ({ args }),
template: `
<ReasonsSplit01 v-bind="args">
<template #heading>
Why teams choose <span class="text-primary-comfy-yellow">ComfyUI</span>
</template>
</ReasonsSplit01>
`
}),
args: {
heading: 'Why teams choose ',
headingHighlight: 'ComfyUI',
highlightClass: 'text-primary-comfy-yellow',
subtitle: 'A flexible foundation for production-grade visual AI.',
reasons: [
{
Expand Down Expand Up @@ -45,8 +53,13 @@ type Story = StoryObj<typeof meta>
export const Default: Story = {}

export const WithoutHighlight: Story = {
args: {
heading: 'Why teams choose ComfyUI',
headingHighlight: undefined
}
render: (args) => ({
components: { ReasonsSplit01 },
setup: () => ({ args }),
template: `
<ReasonsSplit01 v-bind="args">
<template #heading>Why teams choose ComfyUI</template>
</ReasonsSplit01>
`
})
}
12 changes: 2 additions & 10 deletions apps/website/src/components/blocks/ReasonsSplit01.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ export interface Reason {
description: string
}

const { highlightClass = 'text-white' } = defineProps<{
heading: string
headingHighlight?: string
highlightClass?: string
defineProps<{
subtitle?: string
reasons: readonly Reason[]
}>()
Expand All @@ -18,24 +15,19 @@ const { highlightClass = 'text-white' } = defineProps<{
<section
class="mx-auto flex max-w-9xl flex-col gap-4 px-6 py-16 lg:flex-row lg:gap-16 lg:py-24"
>
<!-- Left heading -->
<div
class="sticky top-20 z-10 w-full shrink-0 self-start bg-primary-comfy-ink py-4 lg:top-28 lg:w-115 lg:py-0"
>
<h2
class="text-4xl/16 font-light whitespace-pre-line text-primary-comfy-canvas lg:text-5xl/16"
>
{{ heading
}}<span v-if="headingHighlight" :class="highlightClass">{{
headingHighlight
}}</span>
<slot name="heading" />
</h2>
<p v-if="subtitle" class="mt-6 text-sm text-primary-comfy-canvas/70">
{{ subtitle }}
</p>
</div>

<!-- Right reasons list -->
<div class="flex-1">
<div
v-for="reason in reasons"
Expand Down
75 changes: 75 additions & 0 deletions apps/website/src/components/interpolatedHeadings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { describe, expect, it } from 'vitest'
import OurValuesSection from './about/OurValuesSection.vue'
import StorySection from './about/StorySection.vue'
import WireNodeLayout from './common/WireNodeLayout.vue'
import CliWhySection from '@/templates/cli/WhySection.vue'
import CloudNodesWhySection from '@/templates/cloud-nodes/WhySection.vue'
import McpWhySection from '@/templates/mcp/WhySection.vue'
import AudienceSection from './product/cloud/AudienceSection.vue'
import CloudReasonSection from './product/cloud/ReasonSection.vue'
import DownloadReasonSection from './product/local/ReasonSection.vue'

type HighlightedHeadingCase = {
name: string
Expand Down Expand Up @@ -63,6 +68,76 @@ const highlightedHeadings: HighlightedHeadingCase[] = [
locale: 'zh-CN',
heading: '为追求质量、控制与简约的创作者而生。',
highlight: '创作者'
},
{
name: 'CloudReasonSection',
component: CloudReasonSection,
locale: 'en',
heading: 'Why\nprofessionals\nchoose Cloud',
highlight: 'Cloud'
},
{
name: 'CloudReasonSection',
component: CloudReasonSection,
locale: 'ja',
heading: 'プロフェッショナルが\n選ぶ理由 Cloud',
highlight: 'Cloud'
},
{
name: 'DownloadReasonSection',
component: DownloadReasonSection,
locale: 'en',
heading: 'Why\nprofessionals\nchoose Desktop',
highlight: 'Desktop'
},
{
name: 'DownloadReasonSection',
component: DownloadReasonSection,
locale: 'zh-CN',
heading: '专业人士为何\n选择桌面版',
highlight: '桌面版'
},
{
name: 'CliWhySection',
component: CliWhySection,
locale: 'en',
heading: 'Why build on\nComfy CLI?',
highlight: 'Comfy CLI?'
},
{
name: 'CliWhySection',
component: CliWhySection,
locale: 'ja',
heading: 'なぜ\nComfy CLI を選ぶのか?',
highlight: 'Comfy CLI を選ぶのか?'
},
{
name: 'McpWhySection',
component: McpWhySection,
locale: 'en',
heading: 'Why build on\nComfy MCP?',
highlight: 'Comfy MCP?'
},
{
name: 'McpWhySection',
component: McpWhySection,
locale: 'zh-CN',
heading: '为什么选择\nComfy MCP?',
highlight: 'Comfy MCP?'
},
{
name: 'CloudNodesWhySection',
component: CloudNodesWhySection,
locale: 'en',
heading: 'Maximum control.\nOffload only the compute.',
highlight: 'Offload only the compute.'
},
{
name: 'CloudNodesWhySection',
component: CloudNodesWhySection,
locale: 'zh-CN',
heading: '完全掌控。\n只把算力交给我们。',
highlight: '只把算力交给我们。'
}
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const reasons: CloudReason[] = [
<template>
<ReasonSection
:locale="locale"
heading-key="cloud.reason.heading"
heading-key="cloud.reason.headline"
heading-highlight-key="cloud.reason.headingHighlight"
:reasons="reasons"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const reasons: Reason[] = [
<template>
<ReasonSection
:locale="locale"
heading-key="download.reason.heading"
heading-key="download.reason.headline"
heading-highlight-key="download.reason.headingHighlight"
highlight-class="text-primary-warm-white"
:reasons="reasons"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const meta: Meta<typeof ReasonSection> = {
})
],
args: {
headingKey: 'download.reason.heading',
headingKey: 'download.reason.headline',
headingHighlightKey: 'download.reason.headingHighlight',
highlightClass: 'text-primary-warm-white',
reasons: defaultReasons
Expand Down
23 changes: 11 additions & 12 deletions apps/website/src/components/product/shared/ReasonSection.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
import type { Locale, TranslationKey } from '@/i18n/translations'

import { I18nT } from 'vue-i18n'

import { translationsFor } from '@/i18n/translations'
import SafeRichText from '@/components/common/SafeRichTextContent'

Expand All @@ -13,15 +15,13 @@ const {
locale = 'en',
headingKey,
headingHighlightKey,
headingSuffixKey,
subtitleKey,
highlightClass = 'text-white',
reasons
} = defineProps<{
locale?: Locale
headingKey: TranslationKey
headingHighlightKey?: TranslationKey
headingSuffixKey?: TranslationKey
headingHighlightKey: TranslationKey
subtitleKey?: TranslationKey
highlightClass?: string
reasons: Reason[]
Expand All @@ -33,25 +33,24 @@ const { t } = translationsFor(locale)
<section
class="mx-auto flex max-w-9xl flex-col gap-4 px-4 py-24 lg:flex-row lg:gap-16 lg:px-20 lg:py-40"
>
<!-- Left heading -->
<div
class="sticky top-20 z-10 w-full shrink-0 self-start bg-primary-comfy-ink py-4 lg:top-28 lg:w-115 lg:py-0"
>
<h2
<I18nT
:keypath="headingKey"
tag="h2"
:i18n="translationsFor(locale)"
class="text-4xl/16 font-light whitespace-pre-line text-primary-comfy-canvas lg:text-5xl/16"
>
{{ t(headingKey)
}}<span v-if="headingHighlightKey" :class="highlightClass">{{
t(headingHighlightKey)
}}</span
><template v-if="headingSuffixKey">{{ t(headingSuffixKey) }}</template>
</h2>
<template #highlight>
<span :class="highlightClass">{{ t(headingHighlightKey) }}</span>
</template>
</I18nT>
<p v-if="subtitleKey" class="mt-6 text-sm text-primary-comfy-canvas/70">
{{ t(subtitleKey) }}
</p>
</div>

<!-- Right reasons list -->
<div class="flex-1">
<div
v-for="reason in reasons"
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/data/fishAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const fishAudioPage: ModelLaunchPage = {
hero: {
videoSrc: 'https://media.comfy.org/website/fish-audio/fish-audio-hero2.mp4',
posterSrc: HERO_POSTER_SRC,
titleKey: 'fishAudio.hero.titleModel',
titleRestKey: 'fishAudio.hero.titleRest',
titleKey: 'fishAudio.hero.headline',
titleModelKey: 'fishAudio.hero.titleModel',
descriptionKey: 'fishAudio.hero.description',
primaryCta: {
labelKey: 'fishAudio.hero.primaryCta',
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/data/flux3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const flux3Page: ModelLaunchPage = {
breadcrumbUpdatedKey: 'flux3.breadcrumb.updated',
hero: {
videoSrc: media.hero.src,
titleKey: 'flux3.hero.title',
titleRestKey: 'flux3.hero.titleRest',
titleKey: 'flux3.hero.headline',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Interpolate model names in hero video labels

When this and the other four migrated launch configurations render a hero video, ModelLaunchHeroSection.vue still creates its accessible label with t(hero.titleKey) at lines 146, 157, 274, and 284. Because titleKey now points to a message containing {model}, the <video> is labeled with an unresolved placeholder such as “{model} is here” instead of the localized model name. Interpolate titleModelKey through t, or provide a separate non-parameterized media label.

AGENTS.md reference: apps/website/AGENTS.md:L35-L40

Useful? React with 👍 / 👎.

titleModelKey: 'flux3.hero.title',
descriptionKey: 'flux3.hero.description',
primaryCta: {
labelKey: 'flux3.hero.primaryCta',
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/data/geminiOmni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export const geminiOmniPage: ModelLaunchPage = {
videoSrc: media.hero.src,
posterSrc: media.hero.posterSrc,
logoSrc: '/icons/ai-models/gemini.svg',
titleKey: 'geminiOmni.hero.titleModel',
titleRestKey: 'geminiOmni.hero.titleRest',
titleKey: 'geminiOmni.hero.headline',
titleModelKey: 'geminiOmni.hero.titleModel',
descriptionKey: 'geminiOmni.hero.description',
primaryCta: {
labelKey: 'geminiOmni.hero.primaryCta',
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/data/minimax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export const minimaxPage = {
posterSrc: media.hero.posterSrc,
mobileFallbackImageSrc: heroFallbackSrc,
logoSrc: '/icons/ai-models/minimax.svg',
titleKey: 'minimax.hero.titleModel',
titleRestKey: 'minimax.hero.titleRest',
titleKey: 'minimax.hero.headline',
titleModelKey: 'minimax.hero.titleModel',
descriptionKey: 'minimax.hero.description',
primaryCta: {
labelKey: 'minimax.hero.primaryCta',
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/data/minimaxMusic3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export const minimaxMusic3Page: ModelLaunchPage = {
'https://media.comfy.org/website/minimax-music-3/16x9-option-01_v2.mp4',
posterSrc:
'https://media.comfy.org/website/minimax-music-3/16x9-thumb-01.jpeg',
titleKey: 'minimaxMusic3.hero.titleModel',
titleRestKey: 'minimaxMusic3.hero.titleRest',
titleKey: 'minimaxMusic3.hero.headline',
titleModelKey: 'minimaxMusic3.hero.titleModel',
descriptionKey: 'minimaxMusic3.hero.description',
primaryCta: {
labelKey: 'minimaxMusic3.hero.primaryCta',
Expand Down
Loading
Loading