Skip to content

docs: add homepage hero slogan A/B test with PostHog tracking.#3161

Open
clemra wants to merge 4 commits into
mainfrom
feat/homepage-hero-slogan-experiment
Open

docs: add homepage hero slogan A/B test with PostHog tracking.#3161
clemra wants to merge 4 commits into
mainfrom
feat/homepage-hero-slogan-experiment

Merge branch 'main' into feat/homepage-hero-slogan-experiment

6b3ad0c
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 19, 2026 in 12m 31s

Code review found 2 important issues

Found 5 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 2
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important components/home/HeroSlogan.tsx:129-148 is_new_assignment derived from localStorage but variant comes from cookie — biased analytics
🔴 Important app/(home)/page.tsx:9-19 build:static breaks: cookies()/headers() + middleware incompatible with output:"export"
🟡 Nit middleware.ts:9 HERO_SLOGAN_VARIANT_HEADER duplicated between middleware.ts and lib/hero-slogan-variant.ts

Annotations

Check failure on line 148 in components/home/HeroSlogan.tsx

See this annotation in the file changed.

@claude claude / Claude Code Review

is_new_assignment derived from localStorage but variant comes from cookie — biased analytics

🟡 `is_new_assignment` is derived from localStorage (`hadLocalStorage = readStoredVariant() !== null` in components/home/HeroSlogan.tsx:130), but after this PR variant assignment authoritatively lives in the server-side cookie set by `middleware.ts` — localStorage is now just a write-only mirror that `persistVariant(initialVariant)` overwrites. The two stores diverge in real-world cleanup scenarios (Safari ITP cookie expiry clears cookies but not localStorage; quota eviction / dev tools / extensi

Check failure on line 19 in app/(home)/page.tsx

See this annotation in the file changed.

@claude claude / Claude Code Review

build:static breaks: cookies()/headers() + middleware incompatible with output:"export"

`pnpm build:static` (package.json:16, used for the Cloudflare static-export build path with maintained `lib/_headers` + `scripts/generate-cloudflare-redirects.js` infrastructure) breaks after this PR: under `STATIC_EXPORT=true` → `output: "export"` (next.config.mjs:43), Next.js does not support `middleware.ts`, and calling `cookies()`/`headers()` in `app/(home)/page.tsx` unconditionally opts the route into dynamic rendering — which the export build rejects ("`headers` was called in a route that 

Check warning on line 9 in middleware.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

HERO_SLOGAN_VARIANT_HEADER duplicated between middleware.ts and lib/hero-slogan-variant.ts

`HERO_SLOGAN_VARIANT_HEADER = "x-hero-slogan-variant"` is declared locally here, but `lib/hero-slogan-variant.ts` also exports the same constant (which `app/(home)/page.tsx` imports for the SSR read). The two literals must stay byte-identical for the middleware → page handshake to work, with no test or type linking them. middleware.ts already imports `HERO_SLOGAN_VARIANT_KEY`/`isHeroSloganVariant`/`pickHeroSloganVariant` from the same lib — add `HERO_SLOGAN_VARIANT_HEADER` to that import and rem