Compare commits

...

10 Commits

Author SHA1 Message Date
glary-bot
c2433d7b35 fix(affiliates-terms): bump effective date to May 16, 2026
Roll the effective date forward to today so the ship date and the
published Effective Date match. The previous May 15 value was set on
2026-05-14 to be 'tomorrow' relative to that day; shipping has slipped
into May 16, so the date is now stale by one day.

Verified: typecheck (90 files, 0 errors), 36/36 unit tests, format
check clean, oxlint clean, build clean (52 pages, /affiliates/terms
emits 'Effective Date: May 16, 2026', no /zh-CN/affiliates route).
2026-05-16 08:53:33 +00:00
glary-bot
d98cc41146 fix(routes): make affiliateTerms locale-invariant in getRoutes
Re-prefixing /affiliates/terms with /zh-CN/ would produce a dead link
now that the localized affiliate-terms route has been removed (no
zh-CN page is served from the legal-reviewed English-only document).

Today nothing in apps/website/src or apps/website/e2e calls
getRoutes(<non-en>).affiliateTerms, so this is not user-visible. The
change pre-empts a future regression: most likely from the sibling
affiliates landing PR (#12002), whose footer 'Read the affiliate
program terms' link could route through getRoutes(locale).affiliateTerms
and 404 in zh-CN.

Implementation:
- Add a LOCALE_INVARIANT_ROUTE_KEYS set in src/config/routes.ts and
  skip the /<locale>/ prefix for keys in that set. affiliateTerms is
  the only member today.
- Add a guard test in legalSections.test.ts asserting that both
  getRoutes('en').affiliateTerms and getRoutes('zh-CN').affiliateTerms
  resolve to '/affiliates/terms'. Test count: 35 → 36 passing.

Verification:
- 'pnpm --filter @comfyorg/website typecheck' — 0 errors (90 files)
- 'pnpm --filter @comfyorg/website test:unit' — 36/36 passing
- 'pnpm format:check apps/website' — clean
- 'pnpm exec oxlint apps/website/src apps/website/e2e --quiet' — 0 errors
- 'pnpm --filter @comfyorg/website build' — clean, 52 pages
- 'pnpm exec playwright test affiliates-terms' — 9/9 passing

Addresses the single low-severity finding from an Oracle code review of
the prior two commits on this branch.
2026-05-14 07:04:27 +00:00
glary-bot
0fe808ea10 fix(affiliates-terms): remove zh-CN route, English-only legal copy
The Affiliate Program Terms is a legal-reviewed document. Shipping
an unreviewed Chinese translation as the active terms (the previous
zh-CN page rendered translation keys whose 'zh-CN' values intentionally
mirrored 'en' verbatim) exposes us to liability from the translation
diverging from the legal-approved English source, particularly if a
future contributor 'fixes' the placeholder strings into real Chinese
without going through legal.

This change:

- Removes 'apps/website/src/pages/zh-CN/affiliates/terms.astro'.
- Removes the 9 'Disallow: /zh-CN/affiliates/terms' lines from robots.txt
  (one per UA stack); the route no longer exists.
- Simplifies '/affiliates/terms.astro' to be unconditionally English-only:
  drops the runtime locale switch and the 'Locale' import, hardcodes
  'locale=en' on the LegalContentSection.
- Updates the comment on the affiliate-terms i18n block in
  'translations.ts' from 'zh-CN mirrors en until legal approves a
  translation' (which implied a translation could later be approved
  edit-in-place) to an explicit 'ENGLISH ONLY — do NOT translate;
  if a translated terms page is ever needed, add a separate route
  only after legal signs off on that specific translation'. The
  'zh-CN' values themselves still mirror 'en' in source because the
  translations dictionary's type signature requires every entry to
  satisfy Record<Locale, string>; they are now unreachable through
  any route, sitemap, or robots rule.

Sitemap exclusion in astro.config.ts is unchanged — it generically
flatMaps NOINDEX_PATHNAMES over LOCALE_PREFIXES, so removing the
'/zh-CN/affiliates/terms' route automatically drops the (now-stale)
zh-CN entry from the excluded set.

Verification:
- 'pnpm --filter @comfyorg/website typecheck' — 0 errors (90 files, was 91)
- 'pnpm --filter @comfyorg/website test:unit' — 35/35 passing
  (including legalSections.test.ts, 5/5)
- 'pnpm format:check apps/website' — clean
- 'pnpm exec oxlint apps/website/src apps/website/e2e --quiet' — 0 errors
- 'pnpm knip' — clean (pre-existing unrelated warning)
- 'pnpm --filter @comfyorg/website build' — clean, 52 pages built,
  '/zh-CN/affiliates/' absent from dist output
- 'pnpm exec playwright test affiliates-terms' — 9/9 passing
- Probed running 'pnpm preview' server:
    /affiliates/terms        → 200
    /zh-CN/affiliates/terms  → 404 (standard site 404 page)
- Built sitemap-0.xml: zero affiliate-terms entries (en or zh-CN)
- Built robots.txt: 9 'Disallow: /affiliates/terms' entries, zero
  'Disallow: /zh-CN/...' entries

Manual verification:
Screenshots attached at .glary/screenshots/affiliate-terms-hero-date.png
(hero shows 'Effective Date: May 15, 2026' centered under H1) and
.glary/screenshots/affiliate-terms-zh-CN-404.png (zh-CN route resolves
to site 404).
2026-05-14 07:04:27 +00:00
glary-bot
178bb42271 fix(affiliates-terms): set effective date to May 15, 2026
Replaces the [TBD] placeholder in the affiliate-terms hero with a
real effective date. Updates both en and zh-CN entries (zh-CN
intentionally mirrors en per the existing convention noted at the
top of the affiliate-terms block in translations.ts).

The date renders in the centered caption directly under the page H1
via the existing 'affiliate-terms.effective-date' i18n key — no
component or layout changes needed.
2026-05-14 07:04:27 +00:00
Glary-Bot
893fb7429f fix(affiliates-terms): merge mobile TOC link colors via cn()
The mobile TOC anchor was setting text-primary-comfy-canvas in its
static class while the conditional :class added text-primary-comfy-
yellow or text-primary-warm-gray. Three text-* utilities targeting the
same property let CSS source order decide the winner instead of the
active-section state. Switch to cn() from @comfyorg/tailwind-utils so
tailwind-merge resolves the color conflict deterministically, matching
the codebase convention from AGENTS.md and ContentSection.vue.

The desktop TOC was already fine because its only static color rule
was hover:text-primary-comfy-canvas, which doesn't conflict with the
base text colors.
2026-05-05 21:00:38 +00:00
Glary-Bot
0f0bcc9de8 fix(affiliates-terms): preserve URL hash on TOC click for shareable permalinks
Because the TOC links use `@click.prevent` to drive smooth-scroll
manually, the browser's native hash update was suppressed and users
couldn't copy the URL after clicking a TOC entry to share a deep link.
`scrollToSection` now calls `history.replaceState` to sync the hash
without polluting back/forward history.

Adds an e2e regression test that asserts `window.location.hash` is
updated to the matching section anchor after a TOC click.
2026-05-05 20:50:23 +00:00
Glary-Bot
dcc81d9180 feat(affiliates-terms): apply Nav's four legal-copy edits
1. Section 7: change '12-month commission window' to '3-month
   commission window' so the termination clause matches Section 3's
   declared 3-month commission duration. Section 9's 'preceding 12
   months' liability cap is intentionally left unchanged.
2. Section 3: append a new 'Commission cessation' bullet covering
   subscription cancellation and refunded/charged-back transactions
   (cross-references Section 4).
3. Move the Effective Date from a footer at the end of the article to
   a centered caption directly under the H1, matching the legal-doc
   convention. Drops the now-unused effectiveDateKey/Label props from
   LegalContentSection so the component stays focused on body content.
4. Section 3: change the minimum payout threshold from $30 to $100.
2026-05-05 20:36:50 +00:00
Glary-Bot
5c215aa999 fix(affiliates-terms): address CodeRabbit review
- e2e: 'in order' test now actually verifies DOM ordering via
  compareDocumentPosition, not just element presence. The previous
  loop would have passed even with shuffled sections.
- robots.txt: also disallow /zh-CN/affiliates/terms in every
  user-agent block. The sitemap filter already excluded both locales
  but the robots rules only blocked /affiliates/terms, leaving the
  zh-CN draft crawlable.
- e2e: move the desktop TOC click/scroll test out of the @smoke
  describe block into a separate 'interactions' describe so smoke
  coverage stays render/visibility only, matching the convention used
  in apps/website/e2e/responsive.spec.ts.
2026-05-05 09:40:42 +00:00
Glary-Bot
8a1ce890d0 fix(affiliates-terms): address review feedback
- Drop the redundant 'Last updated' footer row that mirrored the
  Effective Date; the spec's last-updated stamp is satisfied by the
  single Effective Date line.
- Remove the now-unused 'lastUpdatedLabel' i18n key, prop, and
  associated test/e2e assertions.
- Add src/pages/zh-CN/affiliates/terms.astro so /zh-CN/affiliates/terms
  is generated alongside its en counterpart, matching the existing
  privacy-policy / terms-of-service localization pattern.
2026-05-05 03:55:43 +00:00
Glary-Bot
4453d858ed feat: draft Affiliate Program Terms page at /affiliates/terms
Adds a noindex'd legal page rendering the Comfy.org Affiliate Program
Terms and Conditions verbatim from i18n translations, so legal/non-
engineers can edit copy without a code change.

LegalContentSection.vue derives sections from i18n keys, renders
paragraph + bullet-list blocks, sticky desktop TOC, collapsed details
accordion TOC on mobile, smooth-scroll anchors with header offset,
IntersectionObserver-driven active state.

Anchor IDs match the spec (#1-program-overview through
#11-miscellaneous) for stable deep-linking.

BaseLayout noindex prop emits robots meta; robots.txt and the sitemap
filter both exclude /affiliates/terms (and the zh-CN locale variant).

Effective Date driven by a single i18n key
(affiliate-terms.effective-date), consumed by the page footer.

Unit tests assert the eleven canonical sections, numbered titles, and
that internal-only sections are not leaked. Playwright covers desktop
and mobile flows including accordion toggle, anchor scroll, and
viewport overflow.
2026-05-05 03:45:00 +00:00
8 changed files with 706 additions and 4 deletions

View File

@@ -9,10 +9,12 @@ const PAYMENT_STATUSES = ['success', 'failed'] as const
const LOCALE_PREFIXES = LOCALES.map((locale) =>
locale === DEFAULT_LOCALE ? '' : `/${locale}`
)
const NOINDEX_PATHNAMES = ['/affiliates/terms']
const SITEMAP_EXCLUDED_PATHNAMES = new Set(
LOCALE_PREFIXES.flatMap((prefix) =>
PAYMENT_STATUSES.map((status) => `${prefix}/payment/${status}`)
)
LOCALE_PREFIXES.flatMap((prefix) => [
...PAYMENT_STATUSES.map((status) => `${prefix}/payment/${status}`),
...NOINDEX_PATHNAMES.map((path) => `${prefix}${path}`)
])
)
function isExcludedFromSitemap(page: string): boolean {

View File

@@ -0,0 +1,143 @@
import { expect } from '@playwright/test'
import { test } from './fixtures/blockExternalMedia'
const PATH = '/affiliates/terms'
const SECTION_IDS = [
'1-program-overview',
'2-eligible-products',
'3-commission-structure',
'4-attribution-rules',
'5-prohibited-activities',
'6-content-guidelines',
'7-termination',
'8-program-modifications',
'9-indemnification',
'10-governing-law',
'11-miscellaneous'
] as const
test.describe('Affiliate Terms — desktop @smoke', () => {
test.beforeEach(async ({ page }) => {
await page.goto(PATH)
})
test('renders heading and is marked noindex', async ({ page }) => {
await expect(
page.getByRole('heading', { name: 'Affiliate Terms', level: 1 })
).toBeVisible()
const robotsContent = await page
.locator('meta[name="robots"]')
.getAttribute('content')
expect(robotsContent).toContain('noindex')
})
test('exposes one anchor per legal section in order', async ({ page }) => {
for (const id of SECTION_IDS) {
await expect(page.locator(`[id="${id}"]`)).toBeAttached()
}
const orderedIds = await page.evaluate(
(ids) => {
const elements = ids
.map((id) => document.getElementById(id))
.filter((el): el is HTMLElement => el !== null)
return elements
.slice()
.sort((a, b) => {
const relation = a.compareDocumentPosition(b)
if (relation & Node.DOCUMENT_POSITION_FOLLOWING) return -1
if (relation & Node.DOCUMENT_POSITION_PRECEDING) return 1
return 0
})
.map((el) => el.id)
},
[...SECTION_IDS]
)
expect(orderedIds).toEqual([...SECTION_IDS])
})
test('renders an effective date footer', async ({ page }) => {
await expect(page.getByText(/Effective Date:/)).toBeVisible()
})
test('skips internal-only sections (competitive analysis, open questions)', async ({
page
}) => {
await expect(page.getByText(/Competitive analysis/i)).toHaveCount(0)
await expect(
page.getByText(/Open questions for legal review/i)
).toHaveCount(0)
})
})
test.describe('Affiliate Terms — desktop interactions', () => {
test.beforeEach(async ({ page }) => {
await page.goto(PATH)
})
test('clicking a desktop TOC link scrolls to the matching section', async ({
page
}) => {
const desktopToc = page.getByRole('navigation', { name: 'On this page' })
await expect(desktopToc).toBeVisible()
const link = desktopToc.getByRole('link', { name: /5\. Prohibited/ })
await link.click()
const target = page.locator('[id="5-prohibited-activities"]')
await expect(target).toBeInViewport()
})
test('clicking a TOC link updates the URL hash so the section is shareable', async ({
page
}) => {
const desktopToc = page.getByRole('navigation', { name: 'On this page' })
await desktopToc.getByRole('link', { name: /7\. Termination/ }).click()
await expect
.poll(() => page.evaluate(() => window.location.hash))
.toBe('#7-termination')
})
})
test.describe('Affiliate Terms — mobile @mobile', () => {
test.beforeEach(async ({ page }) => {
await page.goto(PATH)
})
test('shows a collapsed accordion TOC by default', async ({ page }) => {
const accordion = page.locator('details', {
has: page.getByText('On this page')
})
await expect(accordion).toBeVisible()
await expect(accordion).not.toHaveAttribute('open', '')
})
test('expanding the accordion reveals every section link', async ({
page
}) => {
const accordion = page.locator('details', {
has: page.getByText('On this page')
})
await accordion.locator('summary').click()
await expect(accordion).toHaveAttribute('open', '')
for (const id of SECTION_IDS) {
await expect(accordion.locator(`a[href="#${id}"]`).first()).toBeVisible()
}
})
test('headings remain readable at narrow viewports without horizontal overflow', async ({
page
}) => {
const heading = page.getByRole('heading', { name: '1. Program Overview' })
await expect(heading).toBeVisible()
const box = await heading.boundingBox()
expect(box, 'heading box').not.toBeNull()
expect(box!.x).toBeGreaterThanOrEqual(0)
expect(box!.x + box!.width).toBeLessThanOrEqual(page.viewportSize()!.width)
})
})

View File

@@ -30,29 +30,38 @@ Disallow: /_astro/
Disallow: /_website/
Disallow: /_vercel/
Disallow: /payment/
Disallow: /affiliates/terms
User-agent: GPTBot
Allow: /
Disallow: /affiliates/terms
User-agent: OAI-SearchBot
Allow: /
Disallow: /affiliates/terms
User-agent: ChatGPT-User
Allow: /
Disallow: /affiliates/terms
User-agent: ClaudeBot
Allow: /
Disallow: /affiliates/terms
User-agent: Claude-User
Allow: /
Disallow: /affiliates/terms
User-agent: Claude-SearchBot
Allow: /
Disallow: /affiliates/terms
User-agent: PerplexityBot
Allow: /
Disallow: /affiliates/terms
User-agent: Google-Extended
Allow: /
Disallow: /affiliates/terms
Sitemap: https://comfy.org/sitemap-index.xml

View File

@@ -0,0 +1,244 @@
<script setup lang="ts">
import { cn } from '@comfyorg/tailwind-utils'
import { useIntersectionObserver, useTemplateRefsList } from '@vueuse/core'
import { computed, ref } from 'vue'
import type { Locale, TranslationKey } from '../../i18n/translations'
import { hasKey, t, translationKeys } from '../../i18n/translations'
import { prefersReducedMotion } from '../../composables/useReducedMotion'
import { scrollTo } from '../../scripts/smoothScroll'
const {
prefix,
locale = 'en',
tocLabelKey
} = defineProps<{
prefix: string
locale?: Locale
tocLabelKey: TranslationKey
}>()
interface Block {
type: 'paragraph' | 'list'
key: TranslationKey
}
interface LegalSection {
id: string
title: string
blocks: Block[]
}
function escapeRegex(s: string): string {
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}
function buildSections(): LegalSection[] {
const labelRegex = new RegExp(`^${escapeRegex(prefix)}\\.([^.]+)\\.label$`)
const sectionIds: string[] = []
for (const key of translationKeys) {
const match = key.match(labelRegex)
if (match && !sectionIds.includes(match[1])) sectionIds.push(match[1])
}
return sectionIds.map((id) => {
const blockRegex = new RegExp(
`^${escapeRegex(prefix)}\\.${escapeRegex(id)}\\.block\\.(\\d+)$`
)
const indices: number[] = []
for (const key of translationKeys) {
const match = key.match(blockRegex)
if (match) indices.push(parseInt(match[1]))
}
indices.sort((a, b) => a - b)
const blocks: Block[] = indices.map((i) => {
const key = `${prefix}.${id}.block.${i}` as TranslationKey
const value = t(key, locale)
return { type: value.includes('\n') ? 'list' : 'paragraph', key }
})
const titleKey = `${prefix}.${id}.title` as TranslationKey
return {
id,
title: hasKey(titleKey)
? t(titleKey, locale)
: t(`${prefix}.${id}.label` as TranslationKey, locale),
blocks
}
})
}
const sections = buildSections()
const tocItems = computed(() =>
sections.map((s) => ({ id: s.id, title: s.title }))
)
const activeSection = ref(sections[0]?.id ?? '')
const sectionRefs = useTemplateRefsList<HTMLElement>()
const mobileTocOpen = ref(false)
let isScrolling = false
const HEADER_OFFSET = -144
useIntersectionObserver(
sectionRefs,
(entries) => {
if (isScrolling) return
let best: IntersectionObserverEntry | null = null
for (const entry of entries) {
if (!entry.isIntersecting) continue
if (!best || entry.boundingClientRect.top < best.boundingClientRect.top)
best = entry
}
if (best) activeSection.value = best.target.id
},
{ rootMargin: '-20% 0px -60% 0px' }
)
function scrollToSection(id: string) {
activeSection.value = id
isScrolling = true
mobileTocOpen.value = false
const nextHash = `#${id}`
if (window.location.hash !== nextHash) {
history.replaceState(null, '', nextHash)
}
const el = document.getElementById(id)
if (el) {
scrollTo(el, {
offset: HEADER_OFFSET,
duration: 0.8,
immediate: prefersReducedMotion(),
onComplete: () => {
isScrolling = false
}
})
return
}
isScrolling = false
}
function listItems(key: TranslationKey): string[] {
return t(key, locale).split('\n')
}
</script>
<template>
<section class="px-4 pt-8 pb-24 lg:px-20 lg:pt-12 lg:pb-32">
<div class="mx-auto max-w-7xl lg:flex lg:gap-16">
<aside class="lg:w-64 lg:shrink-0">
<details
:open="mobileTocOpen"
class="border-transparency-white-t4 mb-8 rounded-2xl border bg-(--site-bg-soft) lg:hidden"
@toggle="
(e) => (mobileTocOpen = (e.target as HTMLDetailsElement).open)
"
>
<summary
class="text-primary-comfy-canvas flex cursor-pointer items-center justify-between px-4 py-3 text-sm font-semibold tracking-wide select-none"
>
<span>{{ t(tocLabelKey, locale) }}</span>
<span
:class="
mobileTocOpen
? 'rotate-180 transition-transform'
: 'transition-transform'
"
aria-hidden="true"
>
</span>
</summary>
<ul class="border-transparency-white-t4 border-t p-2">
<li v-for="item in tocItems" :key="item.id">
<a
:href="`#${item.id}`"
:aria-current="activeSection === item.id ? 'true' : undefined"
:class="
cn(
'hover:bg-transparency-white-t4 block rounded-lg px-3 py-2 text-sm transition-colors',
activeSection === item.id
? 'text-primary-comfy-yellow font-semibold'
: 'text-primary-warm-gray'
)
"
@click.prevent="scrollToSection(item.id)"
>
{{ item.title }}
</a>
</li>
</ul>
</details>
<nav
class="hidden lg:sticky lg:top-32 lg:block"
:aria-label="t(tocLabelKey, locale)"
>
<p
class="text-primary-warm-gray mb-4 text-xs font-semibold tracking-widest uppercase"
>
{{ t(tocLabelKey, locale) }}
</p>
<ul class="space-y-2">
<li v-for="item in tocItems" :key="item.id">
<a
:href="`#${item.id}`"
:aria-current="activeSection === item.id ? 'true' : undefined"
class="hover:text-primary-comfy-canvas block text-sm/snug transition-colors"
:class="
activeSection === item.id
? 'text-primary-comfy-yellow font-semibold'
: 'text-primary-warm-gray'
"
@click.prevent="scrollToSection(item.id)"
>
{{ item.title }}
</a>
</li>
</ul>
</nav>
</aside>
<article class="flex-1 lg:max-w-3xl">
<section
v-for="section in sections"
:id="section.id"
:ref="sectionRefs.set"
:key="section.id"
class="mb-16 scroll-mt-24 lg:scroll-mt-36"
>
<h2
class="text-primary-comfy-canvas mb-6 text-2xl font-light lg:text-3xl"
>
{{ section.title }}
</h2>
<template v-for="block in section.blocks" :key="block.key">
<p
v-if="block.type === 'paragraph'"
class="text-primary-comfy-canvas mt-4 text-sm/relaxed lg:text-base/relaxed"
v-html="t(block.key, locale)"
/>
<ul
v-else
class="mt-4 space-y-2 pl-5 text-sm/relaxed lg:text-base/relaxed"
>
<li
v-for="(item, j) in listItems(block.key)"
:key="j"
class="text-primary-comfy-canvas flex items-start gap-2"
>
<span
class="bg-primary-comfy-yellow mt-2 size-1.5 shrink-0 rounded-full"
aria-hidden="true"
/>
<span v-html="item" />
</li>
</ul>
</template>
</section>
</article>
</div>
</section>
</template>

View File

@@ -0,0 +1,76 @@
import { describe, expect, it } from 'vitest'
import { getRoutes } from '../../config/routes'
import { hasKey, t, translationKeys } from '../../i18n/translations'
const PREFIX = 'affiliate-terms'
const EXPECTED_SECTION_IDS = [
'1-program-overview',
'2-eligible-products',
'3-commission-structure',
'4-attribution-rules',
'5-prohibited-activities',
'6-content-guidelines',
'7-termination',
'8-program-modifications',
'9-indemnification',
'10-governing-law',
'11-miscellaneous'
] as const
function deriveAffiliateSectionIds(): string[] {
const labelRegex = new RegExp(`^${PREFIX}\\.([0-9]+-[a-z-]+)\\.label$`)
const ids: string[] = []
for (const key of translationKeys) {
const match = key.match(labelRegex)
if (match && !ids.includes(match[1])) ids.push(match[1])
}
return ids
}
describe('affiliate terms i18n', () => {
it('exposes the eleven canonical sections in numeric order', () => {
const ids = deriveAffiliateSectionIds()
expect(ids).toEqual([...EXPECTED_SECTION_IDS])
})
it('every section has a label, title, and at least one block', () => {
for (const id of EXPECTED_SECTION_IDS) {
expect(hasKey(`${PREFIX}.${id}.label`)).toBe(true)
expect(hasKey(`${PREFIX}.${id}.title`)).toBe(true)
expect(hasKey(`${PREFIX}.${id}.block.0`)).toBe(true)
}
})
it('section titles follow the "N. Section Name" pattern', () => {
for (const id of EXPECTED_SECTION_IDS) {
const title = t(`${PREFIX}.${id}.title` as never)
const numberPrefix = id.split('-')[0]
expect(title).toMatch(new RegExp(`^${numberPrefix}\\. `))
}
})
it('exposes the effective date and page-chrome keys editors will need', () => {
expect(hasKey('affiliate-terms.effective-date')).toBe(true)
expect(hasKey('affiliate-terms.page.title')).toBe(true)
expect(hasKey('affiliate-terms.page.heading')).toBe(true)
expect(hasKey('affiliate-terms.page.tocLabel')).toBe(true)
expect(hasKey('affiliate-terms.page.effectiveDateLabel')).toBe(true)
})
it('does not include any internal-only "Competitive analysis" or "Open questions" keys', () => {
const internalRegex = /(competitive-analysis|open-questions|legal-review)/
const leaks = translationKeys.filter(
(key) => key.startsWith(PREFIX) && internalRegex.test(key)
)
expect(leaks).toEqual([])
})
it('exposes affiliate terms at the canonical /affiliates/terms path regardless of locale', () => {
// Guards against re-introducing /zh-CN/affiliates/terms, which would
// serve an unreviewed translation of legal-reviewed copy. See the
// comment on LOCALE_INVARIANT_ROUTE_KEYS in src/config/routes.ts.
expect(getRoutes('en').affiliateTerms).toBe('/affiliates/terms')
expect(getRoutes('zh-CN').affiliateTerms).toBe('/affiliates/terms')
})
})

View File

@@ -14,16 +14,30 @@ const baseRoutes = {
demos: '/demos',
termsOfService: '/terms-of-service',
privacyPolicy: '/privacy-policy',
affiliateTerms: '/affiliates/terms',
contact: '/contact'
} as const
type Routes = typeof baseRoutes
// Routes that are served only at their canonical path regardless of the
// active locale. Localized variants of these routes intentionally do not
// exist, so getRoutes(<non-en>) must not prefix them — emitting
// /zh-CN/<route> would produce a dead link.
//
// affiliateTerms: legal-reviewed English-only document. See the comment
// header in src/pages/affiliates/terms.astro and the affiliate-terms i18n
// block in src/i18n/translations.ts for the reasoning.
const LOCALE_INVARIANT_ROUTE_KEYS = new Set<keyof Routes>(['affiliateTerms'])
export function getRoutes(locale: Locale = 'en'): Routes {
if (locale === 'en') return baseRoutes
const prefix = `/${locale}`
return Object.fromEntries(
Object.entries(baseRoutes).map(([k, v]) => [k, `${prefix}${v}`])
Object.entries(baseRoutes).map(([k, v]) => [
k,
LOCALE_INVARIANT_ROUTE_KEYS.has(k as keyof Routes) ? v : `${prefix}${v}`
])
) as unknown as Routes
}

View File

@@ -2170,6 +2170,189 @@ const translations = {
'如果您对本条款有任何疑问,请通过 <a href="mailto:legal@comfy.org" class="text-white underline">legal@comfy.org</a> 与我们联系。'
},
// ── Affiliate Program Terms ───────────────────────────────────────
// Legal-reviewed copy — ENGLISH ONLY. There is no /zh-CN/affiliates/terms
// route, and the `'zh-CN'` values below intentionally duplicate `en`
// verbatim only to satisfy the translations dictionary's required
// Record<Locale, string> shape. Do NOT translate these into Chinese:
// shipping an unreviewed translation as the active terms exposes us to
// liability from the translation diverging from the legal-approved
// English source. If a translated terms page is ever needed, add a
// separate `/affiliates/terms/<locale>` route only after legal signs
// off on that specific translation as the authoritative version.
'affiliate-terms.effective-date': {
en: 'May 16, 2026',
'zh-CN': 'May 16, 2026'
},
'affiliate-terms.1-program-overview.label': {
en: 'PROGRAM',
'zh-CN': 'PROGRAM'
},
'affiliate-terms.1-program-overview.title': {
en: '1. Program Overview',
'zh-CN': '1. Program Overview'
},
'affiliate-terms.1-program-overview.block.0': {
en: 'The <a href="https://comfy.org" class="text-white underline">Comfy.org</a> Affiliate Program ("<strong>Program</strong>") allows approved participants ("<strong>Affiliates</strong>") to earn commissions by referring new paying customers to Comfy Cloud. By participating in this program, you agree to these terms.',
'zh-CN':
'The <a href="https://comfy.org" class="text-white underline">Comfy.org</a> Affiliate Program ("<strong>Program</strong>") allows approved participants ("<strong>Affiliates</strong>") to earn commissions by referring new paying customers to Comfy Cloud. By participating in this program, you agree to these terms.'
},
'affiliate-terms.2-eligible-products.label': {
en: 'PRODUCTS',
'zh-CN': 'PRODUCTS'
},
'affiliate-terms.2-eligible-products.title': {
en: '2. Eligible Products',
'zh-CN': '2. Eligible Products'
},
'affiliate-terms.2-eligible-products.block.0': {
en: 'Commissions are earned on Comfy Cloud paid subscription plans only. The following are excluded from commission eligibility: free tier signups (unless they later convert to paid), one-time credit purchases, enterprise contracts negotiated directly with Comfy sales, and API-only usage billed outside of standard subscription plans.',
'zh-CN':
'Commissions are earned on Comfy Cloud paid subscription plans only. The following are excluded from commission eligibility: free tier signups (unless they later convert to paid), one-time credit purchases, enterprise contracts negotiated directly with Comfy sales, and API-only usage billed outside of standard subscription plans.'
},
'affiliate-terms.3-commission-structure.label': {
en: 'COMMISSION',
'zh-CN': 'COMMISSION'
},
'affiliate-terms.3-commission-structure.title': {
en: '3. Commission Structure',
'zh-CN': '3. Commission Structure'
},
'affiliate-terms.3-commission-structure.block.0': {
en: 'Commission rate: 30% recurring on the net subscription amount received by Comfy.org\nCommission duration: 3 months from the referred customer\u2019s first paid subscription\nCookie/attribution window: 60 days from the referral click\nMinimum payout threshold: $100\nPayout schedule: Monthly, within the first 10 business days of each month after the receipt of applicable payment by Comfy from its referred customer\nPayout method: Via the affiliate tracking platform (Stripe Express or PayPal)\nCommission cessation: To the extent a referred customer\u2019s subscription is canceled, in whole or in part, the affiliate shall correspondingly cease to receive commission payments, even within the 3-month commission window. Refunded or charged-back transactions are not eligible for commission, and any commission previously paid for such transactions will be deducted from future payouts (see Section 4).',
'zh-CN':
'Commission rate: 30% recurring on the net subscription amount received by Comfy.org\nCommission duration: 3 months from the referred customer\u2019s first paid subscription\nCookie/attribution window: 60 days from the referral click\nMinimum payout threshold: $100\nPayout schedule: Monthly, within the first 10 business days of each month after the receipt of applicable payment by Comfy from its referred customer\nPayout method: Via the affiliate tracking platform (Stripe Express or PayPal)\nCommission cessation: To the extent a referred customer\u2019s subscription is canceled, in whole or in part, the affiliate shall correspondingly cease to receive commission payments, even within the 3-month commission window. Refunded or charged-back transactions are not eligible for commission, and any commission previously paid for such transactions will be deducted from future payouts (see Section 4).'
},
'affiliate-terms.4-attribution-rules.label': {
en: 'ATTRIBUTION',
'zh-CN': 'ATTRIBUTION'
},
'affiliate-terms.4-attribution-rules.title': {
en: '4. Attribution Rules',
'zh-CN': '4. Attribution Rules'
},
'affiliate-terms.4-attribution-rules.block.0': {
en: 'Commissions are attributed on a last-click basis within the 60-day cookie window\nIf a referred customer cancels and re-subscribes within 60 days, the original affiliate retains attribution\nIf a referred customer upgrades their plan, commission is calculated on the upgraded amount\nIf a referred customer downgrades their plan, commission adjusts to the new plan amount\nRefunded transactions are not eligible for commission\nAny commission paid on refunded transactions will be deducted from future payouts to you',
'zh-CN':
'Commissions are attributed on a last-click basis within the 60-day cookie window\nIf a referred customer cancels and re-subscribes within 60 days, the original affiliate retains attribution\nIf a referred customer upgrades their plan, commission is calculated on the upgraded amount\nIf a referred customer downgrades their plan, commission adjusts to the new plan amount\nRefunded transactions are not eligible for commission\nAny commission paid on refunded transactions will be deducted from future payouts to you'
},
'affiliate-terms.5-prohibited-activities.label': {
en: 'PROHIBITED',
'zh-CN': 'PROHIBITED'
},
'affiliate-terms.5-prohibited-activities.title': {
en: '5. Prohibited Activities',
'zh-CN': '5. Prohibited Activities'
},
'affiliate-terms.5-prohibited-activities.block.0': {
en: 'Affiliates must NOT:',
'zh-CN': 'Affiliates must NOT:'
},
'affiliate-terms.5-prohibited-activities.block.1': {
en: '<strong>Self-refer</strong>: Use your own affiliate link to purchase or receive discounts on your own account\n<strong>Bid on branded keywords</strong>: Run paid search campaigns (Google Ads, Bing Ads, etc.) targeting "ComfyUI," "Comfy.org," "Comfy Cloud," or any misspellings or variations thereof\n<strong>Misrepresent</strong>: Impersonate Comfy.org, claim to be an employee, or create assets that could be confused with official Comfy.org materials\n<strong>Spam</strong>: Send unsolicited bulk emails, messages, or engage in any form of spam promotion\n<strong>Cookie stuff</strong>: Use hidden iframes, pop-unders, or any technical means to set cookies without genuine user intent\n<strong>Incentivize clicks</strong>: Offer monetary rewards, points, or other incentives solely for clicking your affiliate link (content recommendations are fine)\n<strong>Use misleading claims</strong>: Make false or exaggerated claims about Comfy.org products, pricing, or features\n<strong>Promote on prohibited content</strong>: Place affiliate links on sites containing illegal content, hate speech, or adult content\n<strong>Contrary to laws</strong>: Place affiliate links in any market that is prohibited as a region under the laws of the United States of America.',
'zh-CN':
'<strong>Self-refer</strong>: Use your own affiliate link to purchase or receive discounts on your own account\n<strong>Bid on branded keywords</strong>: Run paid search campaigns (Google Ads, Bing Ads, etc.) targeting "ComfyUI," "Comfy.org," "Comfy Cloud," or any misspellings or variations thereof\n<strong>Misrepresent</strong>: Impersonate Comfy.org, claim to be an employee, or create assets that could be confused with official Comfy.org materials\n<strong>Spam</strong>: Send unsolicited bulk emails, messages, or engage in any form of spam promotion\n<strong>Cookie stuff</strong>: Use hidden iframes, pop-unders, or any technical means to set cookies without genuine user intent\n<strong>Incentivize clicks</strong>: Offer monetary rewards, points, or other incentives solely for clicking your affiliate link (content recommendations are fine)\n<strong>Use misleading claims</strong>: Make false or exaggerated claims about Comfy.org products, pricing, or features\n<strong>Promote on prohibited content</strong>: Place affiliate links on sites containing illegal content, hate speech, or adult content\n<strong>Contrary to laws</strong>: Place affiliate links in any market that is prohibited as a region under the laws of the United States of America.'
},
'affiliate-terms.6-content-guidelines.label': {
en: 'CONTENT & IP',
'zh-CN': 'CONTENT & IP'
},
'affiliate-terms.6-content-guidelines.title': {
en: '6. Content Guidelines and Intellectual Property Rights',
'zh-CN': '6. Content Guidelines and Intellectual Property Rights'
},
'affiliate-terms.6-content-guidelines.block.0': {
en: 'Affiliates must clearly disclose the affiliate relationship in accordance with FTC guidelines (US) and equivalent regulations in their jurisdiction\nRecommended disclosure: "This page contains affiliate links. I may earn a commission if you sign up through my link."\nAffiliates may use Comfy.org logos and brand assets only as provided in the official affiliate asset kit, and may not modify them\nComfy.org retains all rights, including in any of its intellectual property apart from the limited use rights granted herein',
'zh-CN':
'Affiliates must clearly disclose the affiliate relationship in accordance with FTC guidelines (US) and equivalent regulations in their jurisdiction\nRecommended disclosure: "This page contains affiliate links. I may earn a commission if you sign up through my link."\nAffiliates may use Comfy.org logos and brand assets only as provided in the official affiliate asset kit, and may not modify them\nComfy.org retains all rights, including in any of its intellectual property apart from the limited use rights granted herein'
},
'affiliate-terms.7-termination.label': {
en: 'TERMINATION',
'zh-CN': 'TERMINATION'
},
'affiliate-terms.7-termination.title': {
en: '7. Termination',
'zh-CN': '7. Termination'
},
'affiliate-terms.7-termination.block.0': {
en: 'Either party may terminate the affiliate relationship at any time with 14 days\u2019 prior written notice\nComfy.org reserves the right to immediately terminate and withhold commissions if an affiliate violates any of the prohibited activities listed above\nUpon termination, any unpaid commissions above the minimum threshold will be paid in the next regular payout cycle\nCommissions on referred customers will cease at the time of termination, even if within the 3-month commission window',
'zh-CN':
'Either party may terminate the affiliate relationship at any time with 14 days\u2019 prior written notice\nComfy.org reserves the right to immediately terminate and withhold commissions if an affiliate violates any of the prohibited activities listed above\nUpon termination, any unpaid commissions above the minimum threshold will be paid in the next regular payout cycle\nCommissions on referred customers will cease at the time of termination, even if within the 3-month commission window'
},
'affiliate-terms.8-program-modifications.label': {
en: 'MODIFICATIONS',
'zh-CN': 'MODIFICATIONS'
},
'affiliate-terms.8-program-modifications.title': {
en: '8. Program Modifications',
'zh-CN': '8. Program Modifications'
},
'affiliate-terms.8-program-modifications.block.0': {
en: 'Comfy.org reserves the right to modify these terms, commission rates, or program structure with 30 days notice to active affiliates\nContinued participation after notice constitutes acceptance of modified terms',
'zh-CN':
'Comfy.org reserves the right to modify these terms, commission rates, or program structure with 30 days notice to active affiliates\nContinued participation after notice constitutes acceptance of modified terms'
},
'affiliate-terms.9-indemnification.label': {
en: 'LIABILITY',
'zh-CN': 'LIABILITY'
},
'affiliate-terms.9-indemnification.title': {
en: '9. Indemnification and Limitation of Liability',
'zh-CN': '9. Indemnification and Limitation of Liability'
},
'affiliate-terms.9-indemnification.block.0': {
en: 'You will indemnify Comfy.org from any third party claim arising out of your breach of these terms.\nComfy.org\u2019s liability to any affiliate shall not (i) exceed the total commissions paid to that affiliate in the preceding 12 months, and (ii) include any indirect, consequential, punitive or any other type of special damages.\nComfy.org is not responsible for tracking failures caused by user browser settings, ad blockers, or VPNs, though we employ server-side tracking to minimize these issues',
'zh-CN':
'You will indemnify Comfy.org from any third party claim arising out of your breach of these terms.\nComfy.org\u2019s liability to any affiliate shall not (i) exceed the total commissions paid to that affiliate in the preceding 12 months, and (ii) include any indirect, consequential, punitive or any other type of special damages.\nComfy.org is not responsible for tracking failures caused by user browser settings, ad blockers, or VPNs, though we employ server-side tracking to minimize these issues'
},
'affiliate-terms.10-governing-law.label': {
en: 'GOVERNING LAW',
'zh-CN': 'GOVERNING LAW'
},
'affiliate-terms.10-governing-law.title': {
en: '10. Governing Law',
'zh-CN': '10. Governing Law'
},
'affiliate-terms.10-governing-law.block.0': {
en: 'These terms shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to conflict of law principles. All disputes arising under this Agreement shall be resolved exclusively in the state or federal courts in the State of Delaware.',
'zh-CN':
'These terms shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to conflict of law principles. All disputes arising under this Agreement shall be resolved exclusively in the state or federal courts in the State of Delaware.'
},
'affiliate-terms.11-miscellaneous.label': {
en: 'MISCELLANEOUS',
'zh-CN': 'MISCELLANEOUS'
},
'affiliate-terms.11-miscellaneous.title': {
en: '11. Miscellaneous',
'zh-CN': '11. Miscellaneous'
},
'affiliate-terms.11-miscellaneous.block.0': {
en: '<strong>(a) Entire Agreement.</strong> These terms constitutes the sole and entire agreement (including the attached schedules and exhibits) of the Parties with respect to the subject matter of these terms, and supersedes all prior and contemporaneous understandings, agreements, representations, and warranties, both written and oral, with respect to the subject matter. <strong>(b) Relationship of Parties.</strong> Each party is an independent contractor with regard to these terms. Nothing contained in These terms shall be construed as creating any agency, partnership, joint venture, or other form of joint enterprise, employment, or fiduciary relationship between the Parties. Neither party, by virtue of these terms, will have any right, power, or authority to act or create an obligation, express or implied, on behalf of the other party. <strong>(c) Assignment.</strong> Neither party shall assign any of its rights or delegate any of its obligations hereunder without the prior written consent of the other party, which consent shall not be unreasonably withheld, conditioned or delayed. <strong>(d) Severability.</strong> If any term or provision of these terms is invalid, illegal, or unenforceable in any jurisdiction, such invalidity, illegality, or unenforceability shall not affect any other term or provision of these terms or invalidate or render unenforceable such term or provision in any other jurisdiction. Upon a determination that any term or provision is invalid, illegal or unenforceable, the Parties hereto shall negotiate in good faith to modify these terms to effect the original intent of the Parties as closely as possible in order that the transactions contemplated hereby be consummated as originally contemplated to the greatest extent possible. <strong>(e) Waiver.</strong> No waiver by either party of any of the provisions hereof shall be effective unless explicitly set forth in writing and signed by the party so waiving. <strong>(f) Notice.</strong> Each party shall deliver all notices, requests, consents, claims, demands, waivers, and other communications under these terms in writing to the email utilized for the primary contact for the other party. <strong>(g) Cumulative Remedies.</strong> All rights and remedies provided in these terms are cumulative and not exclusive, and the exercise by a party of any right or remedy does not preclude the exercise of any other rights or remedies that may now or subsequently be available at Law, in equity, by statute, in any other agreement between the Parties or otherwise. <strong>(h) No Third-Party Beneficiaries.</strong> These terms benefits solely the Parties to these terms and their respective permitted successors and assigns and nothing in these terms, express or implied, confers on any other person or entity any legal or equitable right, benefit, or remedy of any nature whatsoever under or by reason of these terms.',
'zh-CN':
'<strong>(a) Entire Agreement.</strong> These terms constitutes the sole and entire agreement (including the attached schedules and exhibits) of the Parties with respect to the subject matter of these terms, and supersedes all prior and contemporaneous understandings, agreements, representations, and warranties, both written and oral, with respect to the subject matter. <strong>(b) Relationship of Parties.</strong> Each party is an independent contractor with regard to these terms. Nothing contained in These terms shall be construed as creating any agency, partnership, joint venture, or other form of joint enterprise, employment, or fiduciary relationship between the Parties. Neither party, by virtue of these terms, will have any right, power, or authority to act or create an obligation, express or implied, on behalf of the other party. <strong>(c) Assignment.</strong> Neither party shall assign any of its rights or delegate any of its obligations hereunder without the prior written consent of the other party, which consent shall not be unreasonably withheld, conditioned or delayed. <strong>(d) Severability.</strong> If any term or provision of these terms is invalid, illegal, or unenforceable in any jurisdiction, such invalidity, illegality, or unenforceability shall not affect any other term or provision of these terms or invalidate or render unenforceable such term or provision in any other jurisdiction. Upon a determination that any term or provision is invalid, illegal or unenforceable, the Parties hereto shall negotiate in good faith to modify these terms to effect the original intent of the Parties as closely as possible in order that the transactions contemplated hereby be consummated as originally contemplated to the greatest extent possible. <strong>(e) Waiver.</strong> No waiver by either party of any of the provisions hereof shall be effective unless explicitly set forth in writing and signed by the party so waiving. <strong>(f) Notice.</strong> Each party shall deliver all notices, requests, consents, claims, demands, waivers, and other communications under these terms in writing to the email utilized for the primary contact for the other party. <strong>(g) Cumulative Remedies.</strong> All rights and remedies provided in these terms are cumulative and not exclusive, and the exercise by a party of any right or remedy does not preclude the exercise of any other rights or remedies that may now or subsequently be available at Law, in equity, by statute, in any other agreement between the Parties or otherwise. <strong>(h) No Third-Party Beneficiaries.</strong> These terms benefits solely the Parties to these terms and their respective permitted successors and assigns and nothing in these terms, express or implied, confers on any other person or entity any legal or equitable right, benefit, or remedy of any nature whatsoever under or by reason of these terms.'
},
'affiliate-terms.page.title': {
en: 'Affiliate Terms — Comfy',
'zh-CN': 'Affiliate Terms — Comfy'
},
'affiliate-terms.page.description': {
en: 'Comfy.org Affiliate Program Terms and Conditions.',
'zh-CN': 'Comfy.org Affiliate Program Terms and Conditions.'
},
'affiliate-terms.page.heading': {
en: 'Affiliate Terms',
'zh-CN': 'Affiliate Terms'
},
'affiliate-terms.page.tocLabel': {
en: 'On this page',
'zh-CN': '本页内容'
},
'affiliate-terms.page.effectiveDateLabel': {
en: 'Effective Date',
'zh-CN': '生效日期'
},
// Customers page
'customers.hero.label': {
en: 'CUSTOMER STORIES',

View File

@@ -0,0 +1,31 @@
---
// Affiliate Program Terms — English only, by design.
// Legal-reviewed copy must not be served under a localized route until
// legal explicitly approves a translation; rendering an unreviewed
// translation as the active terms exposes us to liability from the
// translation diverging from the approved English source. See the
// matching comment in src/i18n/translations.ts for the i18n block.
import BaseLayout from '../../layouts/BaseLayout.astro'
import HeroSection from '../../components/legal/HeroSection.vue'
import LegalContentSection from '../../components/legal/LegalContentSection.vue'
import { t } from '../../i18n/translations'
---
<BaseLayout
title={t('affiliate-terms.page.title')}
description={t('affiliate-terms.page.description')}
noindex
>
<HeroSection title={t('affiliate-terms.page.heading')} />
<p class="text-primary-warm-gray mt-2 text-center text-sm">
{t('affiliate-terms.page.effectiveDateLabel')}: {
t('affiliate-terms.effective-date')
}
</p>
<LegalContentSection
prefix="affiliate-terms"
locale="en"
tocLabelKey="affiliate-terms.page.tocLabel"
client:load
/>
</BaseLayout>