From 23dd3d39fa9e8cc73cd4acb2719923ffe01eef4c Mon Sep 17 00:00:00 2001 From: Sarthak Agrawal Date: Sat, 15 Aug 2026 19:49:52 +0530 Subject: [PATCH 1/2] docs: record the public-root Core Web Vitals result The initial-response shell (#42) and its stylesheet-independent styling (#74) are live. Record the shipped product truth with the production five-run numbers, per the fleet rule that PROJECT_STATUS carries completed truth only. Co-Authored-By: Claude Opus 5 (1M context) --- PROJECT_STATUS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PROJECT_STATUS.md b/PROJECT_STATUS.md index f2da4ee..57a7207 100644 --- a/PROJECT_STATUS.md +++ b/PROJECT_STATUS.md @@ -1,6 +1,6 @@ # swe-interview-prep — PROJECT_STATUS -Last updated: 2026-08-14 +Last updated: 2026-08-15 ## Why/What @@ -116,6 +116,7 @@ External: LeetCode API (import), multi-provider LLM APIs - CI-enforced Fleet code-health ratchets across coverage, dead code, complexity, duplication, cycles, dependency advisories, suppression markers, documentation, builds, bundle size, and repository hygiene. - Fleet Ultracite lint baseline for core TypeScript, React, and Vitest code with a clean 345-file check. - Cloudflare Pages static frontend + Pages Functions backend in production architecture. +- **Core Web Vitals on the public root:** the generated curriculum summary is the initial-response shell and the LCP element on `/`, held until the lazy destination route commits, with its styles pinned against the asynchronously loaded stylesheet. Production five-run measurement: mobile-mid p75 LCP 1.22 s and CLS 0.010, desktop 656 ms and CLS 0.002, performance score 100 on both. - Cloudflare D1 persistence for problems, notes, chats, and authenticated progress. - Google One Tap auth with httpOnly JWT cookie issuance. - R2-backed Go WASM interpreter for in-browser code execution path. From 1704402ba5f17037a68d5376e9f10744e909d405 Mon Sep 17 00:00:00 2001 From: Sarthak Agrawal Date: Sat, 15 Aug 2026 23:36:01 +0530 Subject: [PATCH 2/2] feat: add page_view event to complete 5-event taxonomy Add page_view as the 5th event alongside signup, activated, core_action, and returned. Wire trackPageView() into the PostHog provider on mount and route changes. Part of fleet-workspace#348 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- src/App.tsx | 9 ++++++++- src/lib/analytics.ts | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 293f489..b878c08 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,7 +5,7 @@ import { ErrorBoundary } from './components/ErrorBoundary'; import Layout from './components/Layout'; import { SaaSMakerFeedback } from './components/saasmaker-feedback'; import { useAuth } from './contexts/AuthContext'; -import { trackReturned, trackSignup } from './lib/analytics'; +import { trackPageView, trackReturned, trackSignup } from './lib/analytics'; import { focusedRoute } from './lib/focusedRoute'; import { loadLocal, STORE_KEYS } from './lib/userStore'; @@ -184,6 +184,13 @@ export default function App() { } }, []); + // Manually track page_view on every route change. PostHog's built-in + // capture_pageview is disabled (see foundry-monitoring.ts) so we can attach + // the project_id property to every page view. + useEffect(() => { + trackPageView(); + }, [location.pathname]); + /** * Nobody is asked to sign in to use this. * diff --git a/src/lib/analytics.ts b/src/lib/analytics.ts index 2ba94bf..94c2386 100644 --- a/src/lib/analytics.ts +++ b/src/lib/analytics.ts @@ -1,10 +1,10 @@ /** - * Owner-facing analytics — the fixed 4-event taxonomy. + * Owner-facing analytics — the fixed 5-event taxonomy. * - * EVERY fleet project emits exactly these four events — `signup`, `activated`, - * `core_action`, `returned` — so a single PostHog project can build one - * cross-fleet funnel (signup -> activated -> core_action) and a D1/D7 - * retention insight, with no custom dashboard. + * EVERY fleet project emits exactly these five events — `signup`, `activated`, + * `core_action`, `returned`, `page_view` — so a single PostHog project can + * build one cross-fleet funnel (signup -> activated -> core_action) and a + * D1/D7 retention insight, with no custom dashboard. * * Every event carries a `project_id` property. This is what makes per-app and * cross-fleet views possible from one PostHog login. @@ -47,7 +47,7 @@ export type SystemsLabStage = /** * The fixed taxonomy. Do NOT add events here — the whole point is that all - * fleet projects emit the same four. Product-specific detail goes in + * fleet projects emit the same five. Product-specific detail goes in * `CoreAction` (or as extra properties), never as a new top-level event name. */ interface AnalyticsEventMap { @@ -59,6 +59,8 @@ interface AnalyticsEventMap { core_action: { project_id: typeof PROJECT; action: CoreAction }; /** A return session by a user with prior activity. */ returned: { project_id: typeof PROJECT }; + /** A page view, tracked manually on route change with the project_id. */ + page_view: { project_id: typeof PROJECT }; } export function trackEvent(event: string, properties: Record = {}): void { @@ -127,3 +129,8 @@ export function trackSystemsLabAction( export function trackReturned(): void { emit('returned', {}); } + +/** Fire on each route change to record a page view with the project_id. */ +export function trackPageView(): void { + emit('page_view', {}); +}