Add Statsig-driven marketing hero layouts with query overrides#2937
Add Statsig-driven marketing hero layouts with query overrides#2937
Conversation
Introduce hero_layout experiment (0 aside, 1 bottom two-line title, 2 bottom one-line title) evaluated on the server and mirrored on the client for exposure logging. Add URL query overrides for title, subtitle, and layout, optional variation config heroLayout, and dashboard placement styling. Tighten bottom-layout spacing, align CTA-to-screenshot gap with nav-to-banner padding, and add dev-only Statsig experiment console logging (plus ?debug_statsig for preview builds). Made-with: Cursor
Greptile SummaryThis PR introduces the Two previously-flagged issues remain open: Confidence Score: 3/5Not safe to merge until the phishing reflection vector for hero_title/hero_subtitle on production is addressed. Two previously-flagged issues remain unresolved: an unguarded URL-content-reflection P0 security issue and a production-accessible debug param. The new P2 finding (layout/exposure mismatch on bootstrap divergence) does not lower the score further, but the open P0 caps confidence at 2/5 ceiling; score is set at 3 to reflect that the new code itself is otherwise well-structured. src/lib/statsig/hero-query-overrides.ts and src/routes/(marketing)/+page.server.ts — the hero_title/hero_subtitle server-side reflection needs a non-production environment gate before merging. Important Files Changed
Reviews (3): Last reviewed commit: "fixes" | Re-trigger Greptile |
| import { normalizeHeroLayout, type HeroLayoutVariant } from './hero-layout'; | ||
|
|
||
| /** Query overrides for marketing hero experiments (Statsig parity for local QA). */ | ||
|
|
||
| export const HERO_LAYOUT_QUERY_KEY = 'hero_layout'; | ||
| export const HERO_SUBTITLE_QUERY_KEY = 'hero_subtitle'; | ||
| export const HERO_TITLE_QUERY_KEY = 'hero_title'; | ||
|
|
||
| const MAX_SUBTITLE_LEN = 560; | ||
| const MAX_TITLE_LEN = 160; |
There was a problem hiding this comment.
Content injection phishing vector on production
?hero_title and ?hero_subtitle are processed server-side in +page.server.ts via resolveHeroQueryOverrides(url.searchParams, ...) and baked into SSR HTML. A shareable URL like https://appwrite.io/?hero_title=Your+account+has+been+compromised.+Reset+your+password+now will render arbitrary attacker-controlled text as the <h1> on Appwrite's branded homepage — a classic URL-reflection phishing vector. The MAX_TITLE_LEN = 160 / MAX_SUBTITLE_LEN = 560 limits still allow ample deceptive copy.
Consider gating hero_title and hero_subtitle query overrides to non-production environments (e.g. !building && ENV.PREVIEW) on the server load, while keeping hero_layout open if visual QA on production is intentional.
Introduce hero_layout experiment (0 aside, 1 bottom two-line title, 2 bottom one-line title) evaluated on the server and mirrored on the client for exposure logging. Add URL query overrides for title, subtitle, and layout, optional variation config heroLayout, and dashboard placement styling.
Tighten bottom-layout spacing, align CTA-to-screenshot gap with nav-to-banner padding, and add dev-only Statsig experiment console logging (plus ?debug_statsig for preview builds).
Made-with: Cursor
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)