Skip to content

feat(docs): add to posthog event#7817

Open
aidankmcalister wants to merge 3 commits intomainfrom
feat/add-guides-to-2.2-check
Open

feat(docs): add to posthog event#7817
aidankmcalister wants to merge 3 commits intomainfrom
feat/add-guides-to-2.2-check

Conversation

@aidankmcalister
Copy link
Copy Markdown
Member

@aidankmcalister aidankmcalister commented Apr 22, 2026

Summary by CodeRabbit

Documentation Updates

  • New Features

    • Implemented step tracking functionality that allows documentation pages to track user progress through interactive, step-by-step guides.
  • Chores

    • Enabled step tracking across 60+ documentation pages covering quickstart guides, framework integrations, deployment configurations, and database guides.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Apr 22, 2026 6:44pm
docs Ready Ready Preview, Comment Apr 22, 2026 6:44pm
eclipse Ready Ready Preview, Comment Apr 22, 2026 6:44pm
site Ready Ready Preview, Comment Apr 22, 2026 6:44pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Walkthrough

This pull request enables step tracking across documentation pages by adding stepTracking: true to 60+ MDX file frontmatters, extending the MDX schema to support this optional field, and implementing tracking infrastructure that captures initial step state via sessionStorage and emits PostHog analytics events.

Changes

Cohort / File(s) Summary
Prisma ORM & Postgres Quick Starts
apps/docs/content/docs/(index)/prisma-orm/quickstart/*, apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/*
Added stepTracking: true to frontmatter across 16 MDX files (CockroachDB, MongoDB, MySQL, PlanetScale, PostgreSQL, PrismaPostgres, SQL Server, SQLite variants).
Prisma Postgres Guides
apps/docs/content/docs/(index)/prisma-postgres/*, apps/docs/content/docs/(index)/prisma-postgres/quickstart/*
Added stepTracking: true to frontmatter across 7 MDX files covering CLI, database imports, and ORM quickstarts (Drizzle, Kysely, PrismaORM, TypeORM).
Authentication Guides
apps/docs/content/docs/guides/authentication/*/\*.mdx
Added stepTracking: true to frontmatter across 6 MDX files (AuthJS, Better Auth, Clerk providers for Astro/Next.js).
Database & Deployment Guides
apps/docs/content/docs/guides/database/*, apps/docs/content/docs/guides/deployment/*
Added stepTracking: true to frontmatter across 10 MDX files (data migration, schema changes, Docker, Cloudflare, workspaces, Turborepo).
Framework Guides
apps/docs/content/docs/guides/frameworks/*
Added stepTracking: true to frontmatter across 12 MDX files (Astro, Elysia, Hono, NestJS, Next.js, Nuxt, React Router, SolidStart, SvelteKit, TanStack, index).
Integration & Platform Guides
apps/docs/content/docs/guides/integrations/*, apps/docs/content/docs/guides/postgres/*, apps/docs/content/docs/guides/runtimes/*
Added stepTracking: true to frontmatter across 21 MDX files (AI SDK, Datadog, Deno, Embed Studio, GitHub Actions, Neon, Permit, pgfence, Shopify, Supabase, Vercel, Fly.io, idx, Netlify, viewing-data, VSCode, Bun, Deno runtimes).
Migration & Upgrade Guides
apps/docs/content/docs/guides/switch-to-prisma-orm/*, apps/docs/content/docs/guides/switch-to-prisma-postgres/*, apps/docs/content/docs/guides/upgrade-prisma-orm/*
Added stepTracking: true to frontmatter across 11 MDX files (Drizzle, Mongoose, SQL ORMs migrations; Neon, Supabase switches; v1–v7 upgrades).
Schema Configuration
apps/docs/source.config.ts
Extended MDX frontmatter Zod schema for docs collection to include optional stepTracking: z.boolean().optional() field; docsV6 collection schema unchanged.
Page Component Infrastructure
apps/docs/src/app/(docs)/(default)/[[...slug]]/page.tsx
Updated Page component to extract and forward page.data.stepTracking prop to DocsPage component, enabling step tracking configuration at the page render level.
DocsPage Component
apps/docs/src/components/layout/notebook/page/index.tsx
Extended DocsPageProps interface with optional stepTracking?: boolean prop (defaults to false); forwarded prop to TrackedTOCWrapper to gate tracking behavior.
Tracking Logic & Analytics
apps/docs/src/components/toc/tracked-wrapper.tsx
Added conditional stepTracking?: boolean prop to gate all tracking behavior; introduced sessionStorage-backed initial step computation via getInitialStepStorageKey() / getInitialStep(); changed PostHog event from dynamic pageview_${match.id} to fixed pageview_quickstart with initial_step property; added useEffect to reset tracking state on pathname changes with proper cleanup via clearTimeout().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Rationale: The diff is dominated by 60+ homogeneous frontmatter additions (each +1/-0 line), which individually require minimal scrutiny. However, the infrastructure changes demand careful review: the schema extension requires understanding Zod validation semantics; the component prop threading must trace correctly through the hierarchy; and the TrackedTOCWrapper logic introduces sessionStorage handling, event naming changes (from dynamic to fixed), and cleanup patterns in useEffect that warrant verification for memory leaks and correctness of the initial step fallback logic.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and incomplete, using non-descriptive terms with unclear intent and missing critical information about the actual change. Revise the title to clearly describe the main change, e.g., 'feat(docs): enable step tracking with initial step capture in PostHog events' or 'feat(docs): add stepTracking field to documentation pages'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

829 links: ✅ 373 OK | 🚫 14 errors | 🔀 0 redirects | 👻 442 excluded

❌ Errors

apps/docs/content/docs/guides/deployment/bun-workspaces.mdx

apps/docs/content/docs/guides/deployment/cloudflare-d1.mdx

apps/docs/content/docs/guides/deployment/cloudflare-workers.mdx

apps/docs/content/docs/guides/deployment/docker.mdx

apps/docs/content/docs/guides/deployment/pnpm-workspaces.mdx

apps/docs/content/docs/guides/deployment/turborepo.mdx

apps/docs/content/docs/guides/frameworks/astro.mdx

apps/docs/content/docs/guides/frameworks/hono.mdx

apps/docs/content/docs/guides/integrations/ai-sdk.mdx

apps/docs/content/docs/guides/integrations/pgfence.mdx

apps/docs/content/docs/guides/integrations/vercel-deployment.mdx


Full Statistics Table
Status Count
✅ Successful 373
🔀 Redirected 0
👻 Excluded 442
🚫 Errors 14
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Apr 22, 2026, 6:53 PM

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/src/components/toc/tracked-wrapper.tsx`:
- Around line 11-30: The current getInitialStep implementation returns a
previously stored initial_step from sessionStorage causing stale analytics
across revisits; change getInitialStep (using getInitialStepStorageKey) to
always overwrite sessionStorage.setItem(storageKey, anchor) on invocation and
return the current anchor (do not early-return existingInitialStep), and apply
the same overwrite behavior to the similar logic at the other occurrence (lines
44-48) so each pathname entry resets its stored initial_step.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27b74281-c46e-4f9d-b24b-6b4ea782ccee

📥 Commits

Reviewing files that changed from the base of the PR and between 6989f43 and 9466cbb.

📒 Files selected for processing (83)
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/cockroachdb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mongodb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mysql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/planetscale.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/postgresql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/prisma-postgres.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/sql-server.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/sqlite.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/cockroachdb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/mongodb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/mysql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/planetscale.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/postgresql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/prisma-postgres.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/sql-server.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/sqlite.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/from-the-cli.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/import-from-existing-database-mysql.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/import-from-existing-database-postgresql.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/quickstart/drizzle-orm.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/quickstart/kysely.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/quickstart/prisma-orm.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/quickstart/typeorm.mdx
  • apps/docs/content/docs/guides/authentication/authjs/nextjs.mdx
  • apps/docs/content/docs/guides/authentication/better-auth/astro.mdx
  • apps/docs/content/docs/guides/authentication/better-auth/nextjs.mdx
  • apps/docs/content/docs/guides/authentication/clerk/astro.mdx
  • apps/docs/content/docs/guides/authentication/clerk/nextjs.mdx
  • apps/docs/content/docs/guides/database/data-migration.mdx
  • apps/docs/content/docs/guides/database/multiple-databases.mdx
  • apps/docs/content/docs/guides/database/schema-changes.mdx
  • apps/docs/content/docs/guides/deployment/bun-workspaces.mdx
  • apps/docs/content/docs/guides/deployment/cloudflare-d1.mdx
  • apps/docs/content/docs/guides/deployment/cloudflare-workers.mdx
  • apps/docs/content/docs/guides/deployment/docker.mdx
  • apps/docs/content/docs/guides/deployment/pnpm-workspaces.mdx
  • apps/docs/content/docs/guides/deployment/turborepo.mdx
  • apps/docs/content/docs/guides/frameworks/astro.mdx
  • apps/docs/content/docs/guides/frameworks/elysia.mdx
  • apps/docs/content/docs/guides/frameworks/hono.mdx
  • apps/docs/content/docs/guides/frameworks/nestjs.mdx
  • apps/docs/content/docs/guides/frameworks/nextjs.mdx
  • apps/docs/content/docs/guides/frameworks/nuxt.mdx
  • apps/docs/content/docs/guides/frameworks/react-router-7.mdx
  • apps/docs/content/docs/guides/frameworks/solid-start.mdx
  • apps/docs/content/docs/guides/frameworks/sveltekit.mdx
  • apps/docs/content/docs/guides/frameworks/tanstack-start.mdx
  • apps/docs/content/docs/guides/index.mdx
  • apps/docs/content/docs/guides/integrations/ai-sdk.mdx
  • apps/docs/content/docs/guides/integrations/datadog.mdx
  • apps/docs/content/docs/guides/integrations/deno.mdx
  • apps/docs/content/docs/guides/integrations/embed-studio.mdx
  • apps/docs/content/docs/guides/integrations/github-actions.mdx
  • apps/docs/content/docs/guides/integrations/neon-accelerate.mdx
  • apps/docs/content/docs/guides/integrations/permit-io.mdx
  • apps/docs/content/docs/guides/integrations/pgfence.mdx
  • apps/docs/content/docs/guides/integrations/shopify.mdx
  • apps/docs/content/docs/guides/integrations/supabase-accelerate.mdx
  • apps/docs/content/docs/guides/integrations/vercel-deployment.mdx
  • apps/docs/content/docs/guides/making-guides.mdx
  • apps/docs/content/docs/guides/postgres/flyio.mdx
  • apps/docs/content/docs/guides/postgres/idx.mdx
  • apps/docs/content/docs/guides/postgres/netlify.mdx
  • apps/docs/content/docs/guides/postgres/vercel.mdx
  • apps/docs/content/docs/guides/postgres/viewing-data.mdx
  • apps/docs/content/docs/guides/postgres/vscode.mdx
  • apps/docs/content/docs/guides/runtimes/bun.mdx
  • apps/docs/content/docs/guides/runtimes/deno.mdx
  • apps/docs/content/docs/guides/switch-to-prisma-orm/from-drizzle.mdx
  • apps/docs/content/docs/guides/switch-to-prisma-orm/from-mongoose.mdx
  • apps/docs/content/docs/guides/switch-to-prisma-orm/from-sql-orms.mdx
  • apps/docs/content/docs/guides/switch-to-prisma-postgres/from-neon.mdx
  • apps/docs/content/docs/guides/switch-to-prisma-postgres/from-supabase.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/v1.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/v3.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/v4.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/v5.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/v6.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/v7.mdx
  • apps/docs/source.config.ts
  • apps/docs/src/app/(docs)/(default)/[[...slug]]/page.tsx
  • apps/docs/src/components/layout/notebook/page/index.tsx
  • apps/docs/src/components/toc/tracked-wrapper.tsx

Comment thread apps/docs/src/components/toc/tracked-wrapper.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants