:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(product-empty-states): retire the adoption tracker and keep ProductIntroduction as the inline panel (#95412)
Rafael Audibert16079efaebed
diff --git a/.agents/skills/building-product-empty-states/SKILL.md b/.agents/skills/building-product-empty-states/SKILL.mdindex ba57d3969cba..3f9239867fe4 100644--- a/.agents/skills/building-product-empty-states/SKILL.md+++ b/.agents/skills/building-product-empty-states/SKILL.md@@ -1,13 +1,13 @@---name: building-product-empty-states-description: Guide for adding a product setup empty state — the skippable first-run screen a product scene shows until real data arrives, built on the shared ProductEmptyState component. Use when adding an empty state or first-run/setup screen to a product scene, declaring `emptyState` on a `SceneExport`, writing a product setup-status detection logic, building an animated example-data preview widget, or migrating away from the deprecated `ProductIntroduction` component. Covers the `productSetupStatusLogic` single-layer contract, real-data detection rules, local-only skip semantics, wizard commands, and design tokens.+description: Guide for adding a product setup empty state — the skippable first-run screen a product scene shows until real data arrives, built on the shared ProductEmptyState component. Use when adding an empty state or first-run/setup screen to a product scene, declaring `emptyState` on a `SceneExport`, writing a product setup-status detection logic, building an animated example-data preview widget, or deciding between the scene-level `ProductEmptyState` gate and an inline `ProductIntroduction` panel. Covers the `productSetupStatusLogic` single-layer contract, real-data detection rules, local-only skip semantics, wizard commands, and design tokens.---# Building product empty statesBefore a user has set a product up, its scene should show a setup empty state: the product pitch and install command on the left, an animated preview of the product filled with realistic example data on the right. The shared component lives in `frontend/src/lib/components/ProductEmptyState/`; MCP analytics (`products/mcp_analytics/frontend/emptyState/`) is the reference adoption.-`ProductIntroduction` is **deprecated** — don't add new call sites. Both of its jobs fold into this system: "product not installed" (data-existence detection) and "no entities yet" (entity-count detection with a `primaryAction` create CTA).+This system is for product landing scenes. `ProductIntroduction` stays the inline panel for surfaces the gate cannot cover; see "Scene gate or inline panel?" at the end before choosing.## How it works@@ -115,12 +115,13 @@ Extend the detection logic's existing jest file with a parameterized push-througAdd one story per mode to `lib/components/ProductEmptyState/ProductEmptyState.stories.tsx` with `productEmptyStateStory(myProductEmptyState, mode)` (from `storybookHelpers.ts`) - it renders your real config and gives you visual-regression snapshots for free. Default mocks answer queries and product intents so a bare call renders cleanly; pass `mocks` to drive your status indicator into a specific state (see the MCP stories).-## Migrating a ProductIntroduction call site+## Scene gate or inline panel?-- Full-scene "product not set up" uses → this system, via steps 1-4.-- Entity-list empties ("create your first X") → detection = entity count, `primaryAction` = the create button.-- The SetupPrompt family (error_tracking, logs, tracing, metrics, ai_observability) already has detection logics — step 1 is just the `connect` + push; then replace the wrapper with a scene-level `emptyState` declaration.-- `has_seen_product_intro_for` dismissals are superseded by local skip; don't migrate the flag.+- The whole scene is empty because the product is not set up, or has no entities yet → this system. "Product not installed" is data-existence detection; "no entities yet" is entity-count detection with a `primaryAction` create CTA.+- One part of an otherwise working surface is empty → `ProductIntroduction`, rendered inline where the list would be. Typical cases: a tab or sub-list inside an adopted product (workflow channels, message templates), a dashboard widget tile or notebook node, a section of a settings page, an activity log, a flag-off gate, or a state that is not about setup (no ingestion warnings, an empty chat history).+- Never both on one scene for the same emptiness. When a scene adopts this system, delete the `ProductIntroduction` it rendered for the whole-scene case; keep or add one only for a per-tab or mixed case the gate does not see (alerts keeps a compact table message per kind, pulse keeps a per-focus message).+- The SetupPrompt family (error_tracking, logs, tracing, metrics, ai_observability) already has detection logics; when one of those scenes adopts, step 1 is just the `connect` + push. Their dashboard widget tiles keep `SetupPrompt`, because tiles are not scenes.+- `has_seen_product_intro_for` dismissals belong to neither: this system uses a local skip, and `ProductIntroduction` no longer reads the flag.## QA checklistdiff --git a/.agents/skills/writing-ui-components/SKILL.md b/.agents/skills/writing-ui-components/SKILL.mdindex 6f60f3892dd4..905915921f08 100644--- a/.agents/skills/writing-ui-components/SKILL.md+++ b/.agents/skills/writing-ui-components/SKILL.md@@ -62,8 +62,8 @@ structure, logic wiring, `data-attr` naming — and name the precedent you're fosurface that matches its compliant neighbors is on-brand by construction.But **filter precedent through the conventions**. The codebase carries legacy that predates-these rules — clickable divs, hand-rolled tables, new-style-banned `LemonMenu`s, deprecated-`ProductIntroduction` call sites, re-export shims, slop styling. An existing violation is+these rules — clickable divs, hand-rolled tables, new-style-banned `LemonMenu`s, whole-scene+`ProductIntroduction` panels where the scene gate belongs, re-export shims, slop styling. An existing violation ishistory, not license: this skill and `frontend/src/AGENTS.md` outrank precedent. When thenearest example violates the rules, follow the rules — and if the violation is cheap to fix,convert it while you're there ([references/anti-patterns.md](references/anti-patterns.md)).@@ -75,7 +75,8 @@ Telling good precedent from bad:[scene-menu-bar](../scene-menu-bar/SKILL.md) — and recently-touched code (`git log`) overuntouched corners.- **Prefer current primitives**: quill menus/comboboxes over `LemonMenu`/Radix menus,- `ProductEmptyState` over `ProductIntroduction`, generated `*Api` types over handwritten ones.+ the `ProductEmptyState` gate over a whole-scene `ProductIntroduction`, generated `*Api` types+ over handwritten ones.- When they conflict, the priority order is **conventions > compliant precedent > invention**.Inventing a new pattern when a compliant precedent exists is itself a reuse violation.diff --git a/docs/internal/product-empty-state-adoption.md b/docs/internal/product-empty-state-adoption.mddeleted file mode 100644index d23988db4cf0..000000000000--- a/docs/internal/product-empty-state-adoption.md+++ /dev/null@@ -1,150 +0,0 @@-# Product empty state adoption--Tracks which product scenes show the shared setup empty state and which still show something older.-It is a work queue, not a design document.--- What the platform is and how to adopt it: [`frontend/src/lib/components/ProductEmptyState/README.md`](../../frontend/src/lib/components/ProductEmptyState/README.md)-- Step-by-step for one product: the `building-product-empty-states` skill-- Reference adoption: `products/mcp_analytics/frontend/emptyState/`--A scene has adopted the platform when its `SceneExport` declares `emptyState`.-Everything else is either a hand-rolled empty state, the deprecated `ProductIntroduction`, or nothing at all.--## Regenerating the lists--These lists are a snapshot and go stale. Both queries below reproduce them.--Adopted scenes:--```bash-git grep -nE '^\s+emptyState: ' -- 'frontend/src' 'products/'-```--Scenes still on the deprecated component:--```bash-git grep -ln 'ProductIntroduction' -- 'frontend/src' 'products/'-```--Filter both by hand: `emptyState:` is also an unrelated prop on `LemonTable`, `Playlist`, and-`TaxonomicFilter`, and some `ProductIntroduction` hits are the component itself, dashboard widget-tiles, or `FeaturePreviewSceneGate` rather than scene empty states.--## Adopted--Rows marked "in review" are not on `master` yet. See "Regenerating the lists" for a live count.--| Product | Scene | Status |-| ---------------------- | ------------------------------------------------------------------------------------ | --------------------- |-| MCP analytics | `products/mcp_analytics/frontend/MCPAnalyticsScene.tsx` | on master (reference) |-| LLM analytics | `products/ai_observability/frontend/AIObservabilityScene.tsx` | on master |-| LLM prompts | `products/ai_observability/frontend/prompts/LLMPromptsScene.tsx` | on master |-| Support | `products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx` | on master |-| Early access features | `products/early_access_features/frontend/EarlyAccessFeatures.tsx` | on master |-| Endpoints | `products/endpoints/frontend/EndpointsScene.tsx` | on master |-| Experiments | `products/experiments/frontend/scenes/ExperimentsScene.tsx` | on master |-| Feature flags | `frontend/src/scenes/feature-flags/FeatureFlags.tsx` | on master |-| Links | `products/links/frontend/LinksScene.tsx` | on master |-| Product tours | `frontend/src/scenes/product-tours/ProductTours.tsx` | on master |-| Replay vision | `products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx` | on master |-| Skills | `products/skills/frontend/LLMSkillsScene.tsx` | on master |-| User interviews | `products/user_interviews/frontend/UserInterviews.tsx` | on master |-| Web scripts | `frontend/src/scenes/data-pipelines/WebScriptsScene.tsx` | on master |-| Error tracking | `products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene.tsx` | on master |-| Logs | `products/logs/frontend/LogsScene.tsx` | on master |-| Tracing | `products/tracing/frontend/TracingScene.tsx` | on master |-| Metrics | `products/metrics/frontend/MetricsScene.tsx` | on master |-| Surveys | `frontend/src/scenes/surveys/Surveys.tsx` | on master |-| Session replay | `frontend/src/scenes/session-recordings/SessionRecordings.tsx` | on master |-| Web vitals | `frontend/src/scenes/web-analytics/WebAnalyticsScene.tsx` | on master |-| Data warehouse sources | `products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene.tsx` | on master |-| Workflows | `products/workflows/frontend/WorkflowsScene.tsx` | on master |-| Marketing analytics | `frontend/src/scenes/marketing-analytics/MarketingAnalyticsScene.tsx` | on master |-| Customer analytics | `products/customer_analytics/frontend/CustomerAnalyticsScene.tsx` | on master |-| Actions | `products/actions/frontend/pages/Actions.tsx` | on master |-| Annotations | `frontend/src/scenes/annotations/Annotations.tsx` | on master |-| Cohorts | `frontend/src/scenes/cohorts/Cohorts.tsx` | on master |-| Dashboards | `frontend/src/scenes/dashboard/dashboards/Dashboards.tsx` | on master |-| Product analytics | `frontend/src/scenes/saved-insights/SavedInsights.tsx` | on master |-| Notebooks | `frontend/src/scenes/notebooks/NotebooksScene.tsx` | on master |-| Alerts | `products/alerts/frontend/AlertsScene.tsx` | on master |-| Data catalog | `products/data_catalog/frontend/DataCatalogScene.tsx` | on master |-| Subscriptions | `products/subscriptions/frontend/scenes/SubscriptionsScene.tsx` | on master |-| AI datasets | `products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene.tsx` | on master |-| AI evaluations | `products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene.tsx` | on master |-| AI clusters | `products/ai_observability/frontend/clusters/AIObservabilityClustersScene.tsx` | on master |-| Business knowledge | `products/business_knowledge/frontend/scenes/BusinessKnowledgeScene.tsx` | on master |-| Heatmaps | `products/web_analytics/frontend/heatmaps/scenes/heatmaps/HeatmapsScene.tsx` | on master |--Only four products resolve their status at app boot, via a `setupProbe` in their manifest:-LLM analytics, error tracking, MCP analytics, web analytics.-Every other adopter pays a scene-level spinner on each entry, including each trip back from a-detail page. Event-data products (logs, tracing, metrics, session replay) qualify for a probe and-do not have one yet.--## Not adopted--### Tier 1: highest-traffic first-run surfaces--These are the scenes a new user is most likely to land on before they have data.--| Product | Scene | Shows instead |-| ---------------------- | ----------------------------------------------------------- | --------------------- |-| Single empty dashboard | `frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx` | `ProductIntroduction` |--### Tier 2: cheap, or actively misleading today--| Product | Scene | Shows instead |-| ------------------------ | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| Web analytics (main tab) | `frontend/src/scenes/web-analytics/WebAnalyticsDashboard.tsx` | `ProductIntroduction` behind `WEB_ANALYTICS_EMPTY_ONBOARDING`, with a button that redirects into `urls.onboarding()`. The scene already wires the gate for web vitals, so this needs a second config scoped with `scenes: [...]` |-| Signals inbox | `products/signals/frontend/inbox/InboxScene.tsx` | A hand-built onboarding takeover (`inboxOnboardingLogic`, `InboxOnboarding`) that already implements this pattern by hand |-| Revenue analytics | `products/revenue_analytics/frontend/settings/RevenueAnalyticsSettings.tsx` | `ProductIntroduction`. No standalone scene, so it needs `scenes: [...]` scoping like web vitals |-| AI gateway | `products/ai_gateway/frontend/AIGatewayScene.tsx` | Hand-rolled "No gateway usage yet" panel |--### Tier 3: sub-surfaces of adopted products--These products read as migrated at the scene level but still ship `ProductIntroduction` one click-deeper, so the product is half-migrated.--| Parent product | Sub-surface |-| ------------------ | ----------------------------------------------------------------------------------------------------------- |-| Workflows | `Channels/MessageChannels.tsx`, `OptOuts/OptOutCategories.tsx`, `TemplateLibrary/MessageTemplatesTable.tsx` |-| Replay vision | `replay_scanners/components/VisionActionsTab.tsx` |-| Customer analytics | `components/CustomerJourneys/CustomerJourneysEmptyState.tsx` |--### Tier 4: everything else--Still on `ProductIntroduction`: comments, ingestion warnings (v1 and v2), and Max conversation-history.--Hand-rolled empty states: review hog, streamlit apps, groups (`GroupsIntroduction`), persons, and-the LLM analytics sessions tab.--Bare string or nothing: the data warehouse overview scene, SQL editor, data modeling,-legal documents, MCP gateway, visual review, live debugger, batch-exports, experiments shared metrics, skills community, and several LLM analytics sub-tabs.--## Out of scope--- Per-entity detail and editor scenes. The gate is for product landing surfaces.-- Onboarding (`frontend/src/scenes/onboarding/`), billing, settings, auth, and other platform scenes.-- Staff, instance, and debug scenes.-- Dashboard widget tiles. They are not scenes and cannot use the scene gate, which is why- `products/error_tracking/frontend/components/SetupPrompt/SetupPrompt.tsx` survives its product's- migration.-- `products/desktop/`. It is a separate app and does not use the app shell's scene system.--## Picking up an item--1. Read the `building-product-empty-states` skill and the reference adoption.-2. Check whether the product can answer "is it set up?" from event definitions. If so, add a- `setupProbe` to its manifest so the gate resolves at boot instead of showing a spinner.-3. Delete the old empty state in the same PR. Leaving both means two setup surfaces.-4. Add a story per mode to `frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx`.-5. Check the product's existing scene stories. A story that mocks an empty response now renders the- empty state instead of the scene, which changes what that story covers and can hang the visual- regression runner on the preview's animation.--Adoptions do not need to be stacked on each other. The platform is already on `master`; each-adoption touches its own product folder plus two shared files-(`frontend/src/products.tsx` and `ProductEmptyState.stories.tsx`), which is the only conflict surface.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 55ff7f39fad5..da93176acabc 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -1825,9 +1825,9 @@ snapshots:components-product-empty-state--early-access-features-needs-setup--light:hash: v1.k794b7964.563633a4174e6b82faff11a7d2c874fb50a28882f4b4657fdcab70cdb88b479f.mEBCqNYE4cD9VvOJqQs8Z50S9eRIL1HOnu9MNHbIoPQcomponents-product-empty-state--empty-no-action--dark:- hash: v1.k794b7964.01f56e9e0d751a5c0fd6cd2adee993fd8d3b1edce8c3db666da93336ca655590.zbVyer02lJY_tFXGrLIB2hZO_hwO2JxrCpe-IqphV4U+ hash: v1.k794b7964.6d07321d951e9c7bf3bf7de4b49b599f16a8584340cb77a78e270a5010218db0.bnlqCCe_LJ1XmziLkFnZ9-hsJTDknXFwdqF7_foBC7Acomponents-product-empty-state--empty-no-action--light:- hash: v1.k794b7964.b5d3c521caacfe06bfcfb89d804c837739a3f79939cf0bbcd03816efda6e996e.YAL5mcFzZzzKkSykVs51A2VnsgflSQytExobzaRe-f4+ hash: v1.k794b7964.45c59fd202ecac44444ee767f2a1f83d402a8be9a2efde2524250a523646fe39.B_5Ra_bXUmrcMfNogUoeXxjntTGRMsVzOs1xxIGZb2ccomponents-product-empty-state--empty-with-action--dark:hash: v1.k794b7964.6fb2d5feff1fa62c3ed888268602b4eb017f75d33178538542ee4a6d28072fc3.6uOkXnAq1kHhkU8QtOWmFY2eJik3PqRUQegVam-OCGIcomponents-product-empty-state--empty-with-action--light:@@ -1904,10 +1904,6 @@ snapshots:hash: v1.k794b7964.f871f80c2e0437044742c14a0db2f29109168ec4dcb8ccec7e6fd814248bfc3f.GEM_Stq79cSU_62UY6840MfBQiGz-SJZ1u9dW5JG_pQcomponents-product-empty-state--metrics-needs-setup--light:hash: v1.k794b7964.508b62772da1dcd8700e677010732092b48e105cf837a8b074aa0bf5522abb9e.RySrCBS1xNDjeB8G8w7HObsdeP2ZssrvUNfm-We6Vpc- components-product-empty-state--not-empty-with-action--dark:- hash: v1.k794b7964.e344a03ab4fb6bbef2cf88d2b89c12bccfe1b5307e5e80051e47ad6adec22d93.w4TEddGy6INFXoaPeIr201fD_4xWA6jG0Uugfke9ytM- components-product-empty-state--not-empty-with-action--light:- hash: v1.k794b7964.1500e8a17e5bfb2cdc59cea8794c8499622f0218ea6a7dc2bdde259d044d3235.IqteBA6dHdaJztqTmvDTi_IdMolu_vwld3w7xHahpvocomponents-product-empty-state--notebooks-needs-setup--dark:hash: v1.k794b7964.be9dec9126ce31f33d3c19f4cd94cbc7602c6d102365f841197dbbdc66dd6349.L9TQMe38uFWnpl9gSVpRkebTBH24Gpkxgug29h0eojocomponents-product-empty-state--notebooks-needs-setup--light:diff --git a/frontend/src/layout/scenes/components/FeaturePreviewSceneGate.tsx b/frontend/src/layout/scenes/components/FeaturePreviewSceneGate.tsxindex 44e3968cbdfb..f0ce25bb571c 100644--- a/frontend/src/layout/scenes/components/FeaturePreviewSceneGate.tsx+++ b/frontend/src/layout/scenes/components/FeaturePreviewSceneGate.tsx@@ -67,7 +67,6 @@ function FeaturePreviewGateContent({ config }: { config: FeaturePreviewGateConfi/>)}<ProductIntroduction- productName={config.title}thingName="feature"titleOverride={config.title}description={config.description}@@ -89,7 +88,6 @@ function FeaturePreviewGateContent({ config }: { config: FeaturePreviewGateConfi/>)}<ProductIntroduction- productName={config.title}thingName="feature"titleOverride={config.title}description={config.description}diff --git a/frontend/src/lib/components/ActivityLog/ActivityLog.tsx b/frontend/src/lib/components/ActivityLog/ActivityLog.tsxindex d1b122febcdb..3b8245df09c4 100644--- a/frontend/src/lib/components/ActivityLog/ActivityLog.tsx+++ b/frontend/src/lib/components/ActivityLog/ActivityLog.tsx@@ -27,7 +27,6 @@ import { copyToClipboard } from 'lib/utils/copyToClipboard'import { lazyWithRetry } from 'lib/utils/retryImport'import { userLogic } from 'scenes/userLogic'-import { ProductKey } from '~/queries/schema/schema-general'import { AccessControlLevel, AccessControlResourceType, AvailableFeature } from '~/types'import { AccessDenied } from '../AccessDenied'@@ -49,8 +48,6 @@ const Empty = ({ scope }: { scope: string | string[] }): JSX.Element => {return (<ProductIntroduction- productName={noun.toUpperCase()}- productKey={ProductKey.HISTORY}thingName="history record"description={`History shows any ${noun} changes that have been made. After making changes you'll see them logged here.`}isEmpty={true}diff --git a/frontend/src/lib/components/ProductEmptyState/README.md b/frontend/src/lib/components/ProductEmptyState/README.mdindex f77b13d4ade0..3b21e0652d54 100644--- a/frontend/src/lib/components/ProductEmptyState/README.md+++ b/frontend/src/lib/components/ProductEmptyState/README.md@@ -14,4 +14,13 @@ To review an empty state on a project that already has data, add `?empty_state=1**To adopt this for your product, follow the `building-product-empty-states` skill** (`.agents/skills/building-product-empty-states/SKILL.md`). Reference adoption: `products/mcp_analytics/frontend/emptyState/`.-`ProductIntroduction` is deprecated in favor of this component. Which scenes have adopted this one and which are still on the old path is tracked in [`docs/internal/product-empty-state-adoption.md`](../../../../../docs/internal/product-empty-state-adoption.md).+## ProductEmptyState or ProductIntroduction?++Two components cover empty surfaces, and they are not interchangeable.++- **`ProductEmptyState`** (this component) is the first-run screen for a product landing scene: the whole scene is replaced until detection says the product has data. Use it when the surface is a product's list or overview page, reached from the navigation, and "nothing here yet" means "the product is not set up yet". It is declared on the `SceneExport`, never rendered by hand.+- **`ProductIntroduction`** (`frontend/src/lib/components/ProductIntroduction/`) is an inline panel for a surface that cannot be gated: a tab or sub-list inside an adopted product (workflow channels, message templates), a dashboard widget tile or notebook node, a section of a settings page, an activity log, or a state that is not about setup at all (no ingestion warnings, the empty Max chat history). It renders where the list would be, so the rest of the surface stays usable around it.++If a whole scene is empty because the product is not set up, adopt `ProductEmptyState`. If one part of an otherwise working surface is empty, use `ProductIntroduction`. Do not stack both on one scene: an adopted scene that still renders a `ProductIntroduction` for the same emptiness shows two setup surfaces.++To find remaining `ProductIntroduction` call sites: `git grep -ln 'ProductIntroduction' -- 'frontend/src' 'products/'`.diff --git a/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.stories.tsx b/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.stories.tsxindex e986764d8728..b7c9d37e8084 100644--- a/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.stories.tsx+++ b/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.stories.tsx@@ -4,8 +4,6 @@ import * as chartPng from '@posthog/brand/hoggies/png/chart'import { pngHoggie } from 'lib/brand/hoggies'-import { ProductKey } from '~/queries/schema/schema-general'-import { ProductIntroduction, ProductIntroductionProps } from './ProductIntroduction'const HedgehogChart = pngHoggie(chartPng)@@ -19,8 +17,6 @@ export default metaexport function ProductIntroduction_(): JSX.Element {return (<ProductIntroduction- productName="Cohorts"- productKey={ProductKey.COHORTS}thingName="cohort"description="Use cohorts to group people together, such as users who used your app in the last week, or people who viewed the signup page but didn’t convert."docsURL="https://posthog.com/docs/data/cohorts"@@ -33,8 +29,6 @@ export function ProductIntroduction_(): JSX.Element {export function emptyWithAction(): JSX.Element {return (<ProductIntroduction- productName="Cohorts"- productKey={ProductKey.COHORTS}thingName="cohort"description="Use cohorts to group people together, such as users who used your app in the last week, or people who viewed the signup page but didn’t convert."docsURL="https://posthog.com/docs/data/cohorts"@@ -47,35 +41,18 @@ export function emptyWithAction(): JSX.Element {export function emptyNoAction(): JSX.Element {return (<ProductIntroduction- productName="Feature Flags"- productKey={ProductKey.FEATURE_FLAGS}thingName="history record"description="History shows any feature flag changes that have been made. After making changes you'll see them logged here."/>)}-export function notEmptyWithAction(): JSX.Element {- return (- <ProductIntroduction- productName="Cohorts"- productKey={ProductKey.COHORTS}- thingName="cohort"- description="Use cohorts to group people together, such as users who used your app in the last week, or people who viewed the signup page but didn’t convert."- docsURL="https://posthog.com/docs/data/cohorts"- action={() => alert('You clicked the button!')}- isEmpty={false}- />- )-}-/** Dashboard empty-state-style intro: matches `EmptyDashboardComponent` copy, with `HedgehogChart` + responsive layout. */function DashboardEmptyResponsiveIntro({useMainContentContainerQueries,}: Partial<Pick<ProductIntroductionProps, 'useMainContentContainerQueries'>> = {}): JSX.Element {return (<ProductIntroduction- productName="Dashboard"thingName="insight"titleOverride="So empty. So much potential."description="A simple first step is to add an insight from your library. Over time this becomes the home for the data you care about most."diff --git a/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx b/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsxindex 4d430617dc73..57981b648316 100644--- a/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx+++ b/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx@@ -1,41 +1,36 @@-import { useActions, useValues } from 'kea'-import * as construction2 from '@posthog/brand/hoggies/png/construction-2'import * as magnifyingGlass from '@posthog/brand/hoggies/png/magnifying-glass-1'-import { IconOpenSidebar, IconPlus, IconX } from '@posthog/icons'+import { IconOpenSidebar, IconPlus } from '@posthog/icons'import { pngHoggie } from 'lib/brand/hoggies'import { LemonButton } from 'lib/lemon-ui/LemonButton'import { cn } from 'lib/utils/css-classes'-import { userLogic } from 'scenes/userLogic'--import { ProductKey } from '~/queries/schema/schema-general'--import { MCPUseCaseCard } from '../MCPHint/MCPUseCaseCard'-import type { SurfaceKey } from '../MCPHint/prompts'const HedgehogConstruction2 = pngHoggie(construction2)const HedgehogMagnifyingGlass = pngHoggie(magnifyingGlass)/**- * A component to introduce new users to a product, and to show something- * other than an empty table when there are no items.- * Not to be confused with the `OnboardingProductIntroduction` scene,- * which is shown when a team has yet to go through onboarding for the product.+ * Inline empty panel for one part of a surface: a tab or sub-list, a widget tile, a notebook+ * node, a settings section, an activity log, or a state that is not about setup. It renders+ * where the list would be, so the rest of the surface stays usable around it.+ *+ * A whole product landing scene that is empty because the product is not set up uses the+ * scene-level gate instead: declare {@link SceneExport.emptyState} with a+ * {@link ProductEmptyState} config (see `lib/components/ProductEmptyState/README.md`).+ * Not to be confused with the `OnboardingProductIntroduction` scene, which is shown when a+ * team has yet to go through onboarding for the product.*/export type ProductIntroductionProps = {- /** The name of the product, e.g. "Cohorts" */- productName: string- productKey?: ProductKey/** The name of the thing that they will create, e.g. "cohort" */thingName: stringdescription: string- /** Overrides the default "Your team is already using {productName}..." copy shown when `isEmpty` is false. */- secondaryDescription?: string/** If you want to override the title, defaults to "Create your first *thing*" */titleOverride?: string- /** If we should show the empty state */+ /**+ * Pass `false` to render nothing while the surface has content. Defaults to `true`. Prefer+ * branching at the call site; this exists so callers can pass their emptiness check through.+ */isEmpty?: boolean/** The action to take when the user clicks the CTA */action?: () => void@@ -62,33 +57,13 @@ export type ProductIntroductionProps = {* for wide empty states (e.g. template grids). Passed through `cn` with tailwind-merge so `max-w-*` replaces default.*/contentClassName?: string- /**- * When set, renders an MCP use-case card below the actions, promoting the same product via PostHog MCP from- * the user's IDE. Auto-hides if the user has opted out of MCP hints.- */- mcpSurfaceKey?: SurfaceKey}-/**- * @deprecated Use {@link ProductEmptyState} instead: declare {@link SceneExport.emptyState} on the- * scene's {@link SceneExport} (see {@link ../ProductEmptyState | ProductEmptyState} and the- * `building-product-empty-states` skill).- *- * {@link ProductEmptyState} covers both of this component's jobs -- * "product not installed" via real data detection and "no entities yet" via an- * entity-count status - with a local-only skip instead of {@link UserType.has_seen_product_intro_for}.- * Don't add new call sites; existing ones should migrate product by product.- *- * The Growth team is responsible for migrating all call sites to {@link ProductEmptyState}.- */export const ProductIntroduction = ({- productName,- productKey,thingName,description,- secondaryDescription,titleOverride,- isEmpty,+ isEmpty = true,action,disabledReason,actionElementOverride,@@ -99,17 +74,8 @@ export const ProductIntroduction = ({hogLayout = 'default',useMainContentContainerQueries = false,contentClassName,- mcpSurfaceKey,}: ProductIntroductionProps): JSX.Element | null => {- const { updateHasSeenProductIntroFor } = useActions(userLogic)- const { user } = useValues(userLogic)-- if (!user) {- return null- }-- if (!isEmpty && (!productKey || user.has_seen_product_intro_for?.[productKey])) {- // Hide if its not an empty list but the user has seen it before+ if (!isEmpty) {return null}@@ -127,20 +93,6 @@ export const ProductIntroduction = ({)}data-attr={`product-introduction-${thingName}`}>- {/* Below md the copy starts in the top-right corner (no hog beside it), so only pull it up under the dismiss button from md on. */}- {!isEmpty && (- <div className="flex justify-end md:-mb-6 -mt-2 -mr-2 relative z-10">- <div>- <LemonButton- icon={<IconX />}- size="small"- onClick={() => {- productKey && updateHasSeenProductIntroFor(productKey)- }}- />- </div>- </div>- )}<divclassName={cn('flex w-full justify-center',@@ -189,26 +141,8 @@ export const ProductIntroduction = ({contentClassName)}>- <h2>- {!isEmpty- ? `Welcome to ${productName}!`- : actionable- ? titleOverride- ? titleOverride- : `Create your first ${thingName}`- : `No ${thingName}s yet`}- </h2>+ <h2>{actionable ? (titleOverride ?? `Create your first ${thingName}`) : `No ${thingName}s yet`}</h2><p className="ml-0">{description}</p>- {!isEmpty && (- <p className="ml-0">- {secondaryDescription ?? (- <>- Your team is already using {productName}. You can take a look at what they're doing,- or get started yourself.- </>- )}- </p>- )}<divclassName={cn('flex items-center gap-x-4 gap-y-2 mt-6 flex-wrap',@@ -223,10 +157,7 @@ export const ProductIntroduction = ({<LemonButtontype="primary"icon={<IconPlus />}- onClick={() => {- productKey && updateHasSeenProductIntroFor(productKey)- action?.()- }}+ onClick={action}data-attr={'create-' + thingName.replace(' ', '-').toLowerCase()}disabledReason={disabledReason}>@@ -247,7 +178,6 @@ export const ProductIntroduction = ({</LemonButton>)}</div>- {mcpSurfaceKey && <MCPUseCaseCard surfaceKey={mcpSurfaceKey} className="max-w-140" />}</div></div></div>diff --git a/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx b/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsxindex 9220c671b531..3173d94d3158 100644--- a/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx+++ b/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx@@ -149,7 +149,6 @@ function EmptyDashboardContent({ canEdit }: { canEdit: boolean }): JSX.Element {return (<ProductIntroduction- productName="Dashboard"thingName="insight"titleOverride="Build your dashboard"description={dataProcessingAccepted ? BASE_TEXT : 'Add a chart from your library.'}diff --git a/frontend/src/scenes/data-management/ingestion-warnings-v2/IngestionWarningsV2View.tsx b/frontend/src/scenes/data-management/ingestion-warnings-v2/IngestionWarningsV2View.tsxindex f0f889d120d1..74c070188f0f 100644--- a/frontend/src/scenes/data-management/ingestion-warnings-v2/IngestionWarningsV2View.tsx+++ b/frontend/src/scenes/data-management/ingestion-warnings-v2/IngestionWarningsV2View.tsx@@ -21,7 +21,6 @@ import { urls } from 'scenes/urls'import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneSection } from '~/layout/scenes/components/SceneSection'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'-import { ProductKey } from '~/queries/schema/schema-general'import {WARNING_TYPE_RENDERER,@@ -190,9 +189,7 @@ export function IngestionWarningsV2View(): JSX.Element {/>{showProductIntro ? (<ProductIntroduction- productName="Ingestion warnings"thingName="ingestion warning"- productKey={ProductKey.INGESTION_WARNINGS}isEmpty={true}titleOverride={`Nice! No ingestion warnings in the past ${filters.window}`}description="Your incoming events look clean. If we detect any issues with your data, we'll show them here."diff --git a/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx b/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsxindex b2953899f40b..c6dc0e71d0a5 100644--- a/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx+++ b/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx@@ -18,7 +18,6 @@ import { urls } from 'scenes/urls'import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneSection } from '~/layout/scenes/components/SceneSection'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'-import { ProductKey } from '~/queries/schema/schema-general'import { IngestionWarning, IngestionWarningSummary, ingestionWarningsLogic } from './ingestionWarningsLogic'@@ -397,9 +396,7 @@ export function IngestionWarningsView(): JSX.Element {/>{showProductIntro ? (<ProductIntroduction- productName="Ingestion warnings"thingName="ingestion warning"- productKey={ProductKey.INGESTION_WARNINGS}isEmpty={true}titleOverride="Nice! No ingestion warnings in the past 30 days"description="Your incoming events look clean. If we detect any issues with your data, we'll show them here."diff --git a/frontend/src/scenes/marketing-analytics/Onboarding/Onboarding.tsx b/frontend/src/scenes/marketing-analytics/Onboarding/Onboarding.tsxindex ac31ad720d0a..d720b10695f6 100644--- a/frontend/src/scenes/marketing-analytics/Onboarding/Onboarding.tsx+++ b/frontend/src/scenes/marketing-analytics/Onboarding/Onboarding.tsx@@ -95,8 +95,6 @@ export function Onboarding({ completeOnboarding }: OnboardingProps): JSX.Elementfunction WelcomeStep({ onContinue }: { onContinue: () => void }): JSX.Element {return (<ProductIntroduction- productName="Marketing analytics"- productKey={ProductKey.MARKETING_ANALYTICS}thingName="marketing integration"titleOverride="Welcome to Marketing analytics"description="Track your marketing campaigns performance across all your ad platforms. Connect your data sources to see spend, conversions, and ROI in one place."diff --git a/frontend/src/scenes/max/ConversationHistory.tsx b/frontend/src/scenes/max/ConversationHistory.tsxindex 6dead4c7bc49..8ee22e668f23 100644--- a/frontend/src/scenes/max/ConversationHistory.tsx+++ b/frontend/src/scenes/max/ConversationHistory.tsx@@ -81,8 +81,6 @@ export function ConversationHistory({ sidePanel = false, compact = false }: Conv<div className="flex items-center flex-1"><ProductIntroductionisEmpty- productName="Max"- productKey={ProductKey.MAX}thingName="chat"titleOverride="Start getting things done with PostHog AI"description="PostHog AI is an agent that answers data questions, gets things done in UI, and provides insights from PostHog's documentation."diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeUsageMetrics.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeUsageMetrics.tsxindex 83b1c37d53b5..38410d27a205 100644--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeUsageMetrics.tsx+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeUsageMetrics.tsx@@ -12,7 +12,7 @@ import { UsageMetricsConfig, UsageMetricsModal } from 'scenes/settings/environmeimport { usageMetricsConfigLogic } from 'scenes/settings/environment/usageMetricsConfigLogic'import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'-import { NodeKind, ProductKey, UsageMetric, UsageMetricsQueryResponse } from '~/queries/schema/schema-general'+import { NodeKind, UsageMetric, UsageMetricsQueryResponse } from '~/queries/schema/schema-general'import {UsageMetricCard,@@ -133,11 +133,9 @@ function UsageMetricsEmptyState(): JSX.Element {})return (<ProductIntroduction- productName="Customer analytics"thingName="usage metric"description="Once created, usage metrics will be displayed here."isEmpty={true}- productKey={ProductKey.CUSTOMER_ANALYTICS}className="border-none"action={() => openModal()}disabledReason={restrictedReason ?? undefined}diff --git a/frontend/src/scenes/web-analytics/WebAnalyticsDashboard.tsx b/frontend/src/scenes/web-analytics/WebAnalyticsDashboard.tsxindex a5ad447ded8d..a7fc67a32f1b 100644--- a/frontend/src/scenes/web-analytics/WebAnalyticsDashboard.tsx+++ b/frontend/src/scenes/web-analytics/WebAnalyticsDashboard.tsx@@ -980,8 +980,6 @@ const getEmptyOnboardingContent = (return (<div className="col-span-full w-full"><ProductIntroduction- productName="Web Analytics"- productKey={ProductKey.WEB_ANALYTICS}thingName="event"isEmpty={true}titleOverride="Nothing to investigate yet!"diff --git a/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx b/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsxindex 8f826d49aba2..1a1464ed1c5c 100644--- a/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx+++ b/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx@@ -1248,8 +1248,6 @@ export const WebGoalsTile = ({if (!actions.length) {return (<ProductIntroduction- productName="Actions"- productKey={ProductKey.ACTIONS}thingName="action"isEmpty={true}titleOverride="Track your conversions"diff --git a/products/customer_analytics/frontend/components/CustomerJourneys/CustomerJourneysEmptyState.tsx b/products/customer_analytics/frontend/components/CustomerJourneys/CustomerJourneysEmptyState.tsxindex 66b41adf7e0d..875c9f4bc292 100644--- a/products/customer_analytics/frontend/components/CustomerJourneys/CustomerJourneysEmptyState.tsx+++ b/products/customer_analytics/frontend/components/CustomerJourneys/CustomerJourneysEmptyState.tsx@@ -30,7 +30,6 @@ export function CustomerJourneysEmptyState({ embedded }: { embedded?: boolean })return (<ProductIntroduction- productName="Customer journeys"thingName="journey"description={description}action={() => router.actions.push(urls.customerJourneyTemplates())}diff --git a/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx b/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsxindex c0bdb0b5ccac..7b79c3ed88d0 100644--- a/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx+++ b/products/dashboards/frontend/components/WidgetAvailabilitySetupPrompt/WidgetAvailabilitySetupPrompt.tsx@@ -39,8 +39,6 @@ export function WidgetAvailabilitySetupPrompt({introductionClassName={availability.compactSetupPrompt ? 'border-none mb-0 mt-0 p-2' : undefined}contentClassName={availability.compactSetupPrompt ? 'max-w-2xl' : undefined}className="border-none mb-0 mt-0 p-4"- productName={presentation.productName}- productKey={presentation.productKey}thingName={presentation.thingName}titleOverride={availability.unavailableTitle}description={availability.unavailableReason}diff --git a/products/error_tracking/frontend/components/SetupPrompt/SetupPrompt.tsx b/products/error_tracking/frontend/components/SetupPrompt/SetupPrompt.tsxindex c1ac95e66ebd..78ed2681105d 100644--- a/products/error_tracking/frontend/components/SetupPrompt/SetupPrompt.tsx+++ b/products/error_tracking/frontend/components/SetupPrompt/SetupPrompt.tsx@@ -104,15 +104,12 @@ export function ErrorTrackingIngestionPrompt({return (<IntroductionComponent- productName="Error tracking"thingName="issue"titleOverride="You haven't captured any exceptions"description="PostHog captures exceptions from any of our SDKs. JavaScript apps can flip on exception autocapture; other platforms wire it up in code – the docs have per-SDK instructions."isEmpty={true}- productKey={ProductKey.ERROR_TRACKING}className={cn(introductionClassName, className)}{...(introductionStacked !== undefined ? { stacked: introductionStacked } : {})}- mcpSurfaceKey="error_tracking.assign"customHog={WarningHog}actionElementOverride={<div className={actionElementClassName}>diff --git a/products/revenue_analytics/frontend/settings/RevenueAnalyticsSettings.tsx b/products/revenue_analytics/frontend/settings/RevenueAnalyticsSettings.tsxindex 66ffdf0bd5fd..d0df93249bc7 100644--- a/products/revenue_analytics/frontend/settings/RevenueAnalyticsSettings.tsx+++ b/products/revenue_analytics/frontend/settings/RevenueAnalyticsSettings.tsx@@ -92,7 +92,6 @@ export function RevenueAnalyticsSettings(): JSX.Element {<SceneDivider /><ProductIntroduction- productName="Revenue tracking"thingName="revenue source"description=""isEmpty={hasNoEvents && hasNoDataWarehouseSources}diff --git a/products/workflows/frontend/Channels/MessageChannels.tsx b/products/workflows/frontend/Channels/MessageChannels.tsxindex 7409c64e2cc7..3836e47d18dd 100644--- a/products/workflows/frontend/Channels/MessageChannels.tsx+++ b/products/workflows/frontend/Channels/MessageChannels.tsx@@ -50,7 +50,6 @@ export function MessageChannels(): JSX.Element {)}{showProductIntroduction && (<ProductIntroduction- productName="Workflows channel"thingName="channel integration"description="Set up messaging channels to automatically send emails, SMS, or Slack notifications triggered by user actions and events."docsURL="https://posthog.com/docs/workflows/configure-channels"diff --git a/products/workflows/frontend/OptOuts/OptOutCategories.tsx b/products/workflows/frontend/OptOuts/OptOutCategories.tsxindex d3ad047a9148..eb2adef5fdcd 100644--- a/products/workflows/frontend/OptOuts/OptOutCategories.tsx+++ b/products/workflows/frontend/OptOuts/OptOutCategories.tsx@@ -140,7 +140,6 @@ export function OptOutCategories(): JSX.Element {<LemonCollapse panels={collapseItems} />) : (<ProductIntroduction- productName="Message Categories"thingName="category"description="Configure message categories to manage user opt-out preferences for different types of communications."docsURL="https://posthog.com/docs/workflows/customerio-import"diff --git a/products/workflows/frontend/TemplateLibrary/MessageTemplatesTable.tsx b/products/workflows/frontend/TemplateLibrary/MessageTemplatesTable.tsxindex 97a09c1fce8a..b67f2f836710 100644--- a/products/workflows/frontend/TemplateLibrary/MessageTemplatesTable.tsx+++ b/products/workflows/frontend/TemplateLibrary/MessageTemplatesTable.tsx@@ -33,7 +33,6 @@ export function MessageTemplatesTable(): JSX.Element {<div className="templates-section" data-attr="message-templates-table">{showProductIntroduction && (<ProductIntroduction- productName="Message template"thingName="message template"description="Create and manage reusable message templates for your workflows."docsURL="https://posthog.com/docs/workflows"