mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-06-05 20:54:56 +00:00
*PR Created by the Glary-Bot Agent* --- Draft, `noindex`-gated legal page rendering the **Comfy.org Affiliate Program Terms and Conditions** verbatim from the source document. Treats the copy as legal-final-pending-signoff: lives in i18n translations so legal/non-engineers can edit text without a code change, the page is excluded from search engines (`<meta robots noindex>` + `robots.txt` + sitemap filter), and a follow-up PR will flip it to indexable once legal signs off. ## What this adds - **Route:** `/affiliates/terms` (en) + `/zh-CN/affiliates/terms` (zh-CN), matching the existing privacy-policy / terms-of-service localization pattern. - **Anchor IDs match the spec exactly:** `#1-program-overview`, `#2-eligible-products`, …, `#11-miscellaneous` — stable deep-linking. - **Sticky desktop TOC** with active-section highlighting (IntersectionObserver, smooth scroll, header offset, `prefers-reduced-motion` aware). - **Collapsed `<details>` accordion TOC on mobile** that auto-closes after a click. - **Effective Date** is a single i18n key (`affiliate-terms.effective-date`) — currently `[TBD]`. One config var, consumed by the page footer. - **Plain accessible legal-doc styling:** site design tokens, no marketing flourish or gradients, narrow column for readable line length, high-contrast text. - **noindex everywhere:** robots `noindex,nofollow` meta via `BaseLayout.noindex`, `Disallow: /affiliates/terms` added to every UA block in `robots.txt` (including the AI-bot overrides), and the route excluded from `@astrojs/sitemap` for both locales. ## Implementation notes The website does not currently use MDX — it uses i18n translation keys + Vue `ContentSection` components for legal pages. I followed that established pattern (per AGENTS.md "Align with rest of subrepo on impl and design") rather than introducing MDX integration just for this page. Editing affiliates terms copy is a one-file change in `src/i18n/translations.ts`, no code touch required, which satisfies the "Nav or legal can edit without a code change" intent. A new component `LegalContentSection.vue` is added (rather than reusing `ContentSection.vue` directly) because legal docs need: (a) a `<details>` mobile accordion TOC instead of the existing horizontal-scroll `CategoryNav`, (b) a footer Effective Date, and (c) a tighter block-type set (paragraph + bullet list only). Privacy / Terms-of-Service pages are untouched. ## Skipped per spec Per the original brief, "Competitive analysis" bullets and the "Open questions for legal review" callout are internal-only and were not copied into the i18n keys. There is a unit test asserting no key matching `competitive-analysis|open-questions|legal-review` exists under the `affiliate-terms.*` namespace. ## ⚠️ Flag for legal review The source legal copy contains an internal contradiction that I copied verbatim rather than silently editing: - **Section 3 (Commission Structure)** says: *"Commission duration: 3 months from the referred customer's first paid subscription"* - **Section 7 (Termination)** says: *"Commissions on referred customers will cease at the time of termination, even if within the **12-month** commission window"* These two clauses imply different commission windows (3 months vs 12 months). I left the copy as-is for legal to resolve before the indexable follow-up PR — flagging here so it doesn't get missed. ## Verification - `pnpm typecheck` (root) — clean - `pnpm typecheck:website` — clean (91 Astro files, 0 errors) - `pnpm test:unit` (website) — 35/35 passing including 5 new unit tests for the affiliate-terms section structure - `pnpm exec playwright test affiliates-terms` — 8/8 passing (5 desktop `@smoke`, 3 mobile `@mobile`) - `pnpm format:check` — clean - `pnpm build` — clean, both routes generated, sitemap correctly excludes both locale variants - All pre-commit hooks pass (stylelint + oxfmt + oxlint + eslint + typecheck + typecheck:website + check-unused-i18n-keys) ## Manual verification Screenshots embedded below from the local Astro preview build at desktop (1280×900) and mobile (Pixel 5 / 393×852) viewports. The mobile accordion's collapsed and expanded states are both captured. ## Sub-agent review Ran the Oracle review against `main`. Initial pass flagged the Last-updated/Effective-Date footer duplication and a missing zh-CN route — both addressed in commit `8a1ce890d`. The 3-month vs 12-month contradiction is left for legal (see above). ## Preview URL The Vercel preview URL with the route appended will be posted as a PR comment after CI completes: `<vercel-preview-host>/affiliates/terms` ## Screenshots    ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11954-feat-draft-Affiliate-Program-Terms-page-at-affiliates-terms-3576d73d36508121851ef666a8c4c537) by [Unito](https://www.unito.io) --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com> Co-authored-by: glary-bot <glary-bot@comfy.org>