: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
feat(onboarding): add a simple onboarding arm with an mcp step (#118246)
Rafael Audibertab86fa5d7cab
diff --git a/.agents/skills/building-product-empty-states/SKILL.md b/.agents/skills/building-product-empty-states/SKILL.mdindex a599c9ec5910..35ab4c1ecba8 100644--- a/.agents/skills/building-product-empty-states/SKILL.md+++ b/.agents/skills/building-product-empty-states/SKILL.md@@ -67,7 +67,7 @@ Statuses: `loading` (not yet known - the gate holds a spinner, never flashes the- **Wizard vs primary action**: SDK-installed products set `wizard: { slug }` (the slug must exist in `@posthog/wizard`); creation-first products (flags, surveys) set `primaryAction` instead. Self-hosted degrades automatically: no cloud → the terminal hides and the manual path is promoted. If the create action needs hooks (e.g. it opens PostHog AI via `useMaxTool`, like user research's "New topic"), provide a `PrimaryAction` component instead of `primaryAction` - it renders in the same slot and takes precedence.- **Permissions and selectors on the primary action**: set `primaryAction.accessControl` to the same resource type and level the gated scene's own create button uses. Without it a viewer gets an enabled button and only learns they can't create when the form fails to save. Set `primaryAction.dataAttr` to the attr that scene button carries, so an end-to-end spec keeps one selector whether it lands on the scene or the empty state. A `PrimaryAction` component wraps its own `AccessControlAction`.- **`featureFlag`**: set it when the scene is already flag-gated (so the scene's own gate keeps handling flag-off) or to roll the empty state out gradually.-- **Scene modules that serve more than one surface**: `scenes` narrows where the gate applies, and omitting it gates everything the module serves. A plain scene id covers that whole scene (web analytics gates only `Scene.WebAnalyticsWebVitals`). When one scene id serves several tabs, pass `{ scene, tabs }` and list every value of the `tab` route param you gate, including `undefined` for the URL with no tab segment - `products/workflows/frontend/emptyState/workflowsEmptyState.tsx` gates its workflow list while channels, opt-outs, suppression, and reputation stay reachable with no workflows yet. Gating the scene instead would take those tabs down with it.+- **Scene modules that serve more than one surface**: `scenes` narrows where the gate applies, and omitting it gates everything the module serves. A plain scene id covers that whole scene. When one scene id serves several tabs, pass `{ scene, tabs }` and list every value of the `tab` route param you gate, including `undefined` for the URL with no tab segment - `products/workflows/frontend/emptyState/workflowsEmptyState.tsx` gates its workflow list while channels, opt-outs, suppression, and reputation stay reachable with no workflows yet. Gating the scene instead would take those tabs down with it.- **Hedgehog**: a `pngHoggie(...)`-wrapped module — import only inside the product chunk (eager-graph guard: `frontend/bin/check-eager-graph.mjs`). Never hardcode image URLs (e.g. Cloudinary) — `@posthog/brand` assets only.- **`text` is keyed by mode**: provide the `needs-setup` base; add a `waiting-for-data` entry only if your product has that middle state (missing fields fall back to the base). Sentence case, benefit-first, no AI tells (see "User-facing copy" in `CLAUDE.md`).- **Key `wizard` by mode when the install command stops applying**: a product whose `waiting-for-data` means "events are flowing, a scheduled job hasn't run yet" has nothing left to install, so pass `wizard: { 'needs-setup': { slug } }` and the terminal, the manual link, and the hint leave the waiting screen (clusters). Leave it flat when re-running setup still makes sense there (MCP analytics: "Instrumenting another server?").diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 767e69e4cb06..05d92c30fd49 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -2456,18 +2456,14 @@ snapshots:hash: v1.k794b7964.48584f21d48763853573991689622b0af35fac432c0cadaef6a6a75d0f0c9212.6EHjBCMPD2ZHVQrc_tGG8hCLGL8HVk-YRmZDXj3GZHEcomponents-product-empty-state--transformations-needs-setup--light:hash: v1.k794b7964.7dc310b2337e6ab0a748d155e418eef0e8cb898b0fd1508da33ca2dfbb9d23f9.jYRYFePNajfiGMNSMsg-iHtcS8Tn0rXmSVvNlPzjH-k+ components-product-empty-state--web-analytics-needs-setup--dark:+ hash: v1.k794b7964.eac1530bf1eef84b718e9930ccda5044f334ab79f46733127e38cbf2b23f4a18.VUw_NLfdAQv9GcJJxj4G26zE42to_GfJi1HMgpHCFX0+ components-product-empty-state--web-analytics-needs-setup--light:+ hash: v1.k794b7964.c4c8da98edcd30ca59a9f081b5dd14f964c67e09b3c6dc0a9a471a0095c54dd0.CQF_tMRDprMkfVH62XBWtgvccXFHVAsrmwiXyvEjMOccomponents-product-empty-state--web-scripts-needs-setup--dark:hash: v1.k794b7964.b8df680b75a655d45a2371155e529b7a46417b8c9bee1c04ee2c9ff2debf7d80.oRFx2ui1Bf2MbcCJ396mUxfFdU4meehkiuB1ZmLb2W4components-product-empty-state--web-scripts-needs-setup--light:hash: v1.k794b7964.53ae8b817b628a5101666f63ba745219c5d831089dcd7e532556e639a3bf2238.Jmt0-_sydTWapTG886EmYwmxolgFCoeDO6fjCQqgl7o- components-product-empty-state--web-vitals-needs-setup--dark:- hash: v1.k794b7964.b784295383b3d02b6816c036a31e20f01161089593b5e61900c745a69a088937.5qpqtCMo70LD8okFHA8c8VSwG_VhGjvQXPp-rWXNv3Q- components-product-empty-state--web-vitals-needs-setup--light:- hash: v1.k794b7964.49a529ec7d92790937b44848d8530112575c9b1f8c560fb40690a7b0cf8d04b6.Fp3h_z0fEkQD0vt29L9i-xxRrCLKp6m9Kzw6Sf1XFs8- components-product-empty-state--web-vitals-waiting-for-data--dark:- hash: v1.k794b7964.9260f32f4917df15eba149ac8740825ac59bc581c8197377cfe916835ed68a6e.l1BAO1rzCVplug_xQNzdkF0ZVHRMtoUZtCeRLgJFTCc- components-product-empty-state--web-vitals-waiting-for-data--light:- hash: v1.k794b7964.68143ec0b4e11838e50d77e1153ace37ea97095a2744c7bb21056fc823ec8c61.k3H3_be9rW05TYUGjusSxRuP3-Hb0skCExHyumjxet0components-product-empty-state--workflows-needs-setup--dark:hash: v1.k794b7964.d8329786e1fc56b0655b07f2f37d494b9a078f28a014972f394d031a01f32def.5F0XKwQ0YoQVh-iZOyO-498LFhBV0R2m5tnr0a04Osscomponents-product-empty-state--workflows-needs-setup--light:@@ -15702,6 +15698,18 @@ snapshots:hash: v1.k794b7964.1f3e47fa2db5dddd25b77b82f4ba2f5cb8a25f42b1677da26052a119d9a0642d.KoDRLsTqDRJ4QgX4Gln_YAgCSICl-zQ016Ij6CZ7jHgscenes-other-onboarding--session-replay-opt-in--light:hash: v1.k794b7964.35fe17fa90492ec9286aa5257b9eebf8b3d62143f2da83a99c61e0194783302a.YJWL_zoBV7PaiEl1QTRa37vNzaKXxB9Lbrq0eFS5UAs+ scenes-other-onboarding--simple-flow-connect-mcp--dark:+ hash: v1.k794b7964.8e288ce78be79e33205ea490894d2b763189bfe4fb77f68fff4a2d3392076848.7Ct-1xzRh3s6v3L0ho8r_QssmLoOTW4Vsm-er22pDN8+ scenes-other-onboarding--simple-flow-connect-mcp--light:+ hash: v1.k794b7964.1631cd37e3dbb6c68278b37fcd1e662c2e02c87a3085e98815065ef1976d693b.BPAxQ8t_XVSIV7dtVq7TId7LAAfU3NK1Y9mivIqawG8+ scenes-other-onboarding--simple-flow-install--dark:+ hash: v1.k794b7964.5ca14ef9d6d866687f8eee05dfa9a6f725ae2c4940cf23dd4e5c2ea3b7271479.oFKS4YcooaTlRJKGDyavk6oa89iMH4Wkf-ZVb2eFmgs+ scenes-other-onboarding--simple-flow-install--light:+ hash: v1.k794b7964.f44c517142d6cf396131094b021372797090e3c3e2a01b1c4b7b23b86f271e00.jxNcq60LfWVYOycFr3L5AJiNcg0ifvknT7BY1sEhwbU+ scenes-other-onboarding--simple-flow-mcp-connected--dark:+ hash: v1.k794b7964.ee2b81f2fad88393efc911152d1b01647cf05b5cb0d40a173912e0a6264014e6.IrWYgJ72pnMYUBWrV4Npx-IkPFUWr_6kHtu7C0aqP7U+ scenes-other-onboarding--simple-flow-mcp-connected--light:+ hash: v1.k794b7964.cdb4b04871c9655c7f46562807366b542e924144f8ba829170b1cf6acf93d57b.KGRKVgDGmry7LSrtG1CjVEHRuso6zwI_Zn9l0ROsi7oscenes-other-onboarding--source-maps--dark:hash: v1.k794b7964.a7881a38d7336d8d874adcea59e42d26de574cc38a3028444b48610a2735f973.-XBFbm_GJwOPSdZfT76gqTdmE1RcNmxOuE1rIHZEQ4Uscenes-other-onboarding--source-maps--light:@@ -15718,6 +15726,14 @@ snapshots:hash: v1.k794b7964.3f953504a96f3d295e23721dbd39a6282ce5f719a7b7a50ca2f083c3c061660c.S12DDcG_kP6-5Y0hlBTZFDKUKAuzTBP9kPXFlqI0umEscenes-other-onboarding-install-step--control-arm--light:hash: v1.k794b7964.03f1893573652b0c32218385c83819272c30e7a87647ea479aa6c17100efa604.Ullr23ou7-8Q_0mO44avKU97VGRSbZGcK96bg8Hlwyk+ scenes-other-onboarding-install-step--simple-flow-cloud-arm--dark:+ hash: v1.k794b7964.df9b92d8c888b475bd93f5ace1352d25fa664bd9ed03c857b021eb890a37333a.FzEQJH0X0v-bL-GrgcgXSOWOQ8yTofhtNvyr7f_87Bo+ scenes-other-onboarding-install-step--simple-flow-cloud-arm--light:+ hash: v1.k794b7964.db6e985814b37a2e586c9fa49eb3d3bb389d54473d068389512c1aab3e4caea5.VNhgsuAfDompEhCACYLMHjUva4JI7Br1V3_bdZuDHhM+ scenes-other-onboarding-install-step--simple-flow-cloud-run-in-progress--dark:+ hash: v1.k794b7964.365c4897a5ca3f25a79820327beb8aff012b08437d44eb4cd1e4de5c44e32371.BgFgX38cWgmPVLemqWUizW8WftkfjwhrDS3PrAIo5ZQ+ scenes-other-onboarding-install-step--simple-flow-cloud-run-in-progress--light:+ hash: v1.k794b7964.c67745495d59c63a1dd66de572842eae2ea5adcf2f841cf1bddabd5390c44b7d.9GgxjXMFJ25HXlIuFQ4nN1waOlvtFD0O1bBjMDze4gcscenes-other-onboarding-install-step--test-arm--dark:hash: v1.k794b7964.02e757ddb1ee8fd40b5b20f4ffa67c2c01adef3aa14454056ef9bff28c73565c.9MnHMgx2YubgCwkEhohWJUbiMaOfaxOKCsHsCGqA9Mkscenes-other-onboarding-install-step--test-arm--light:@@ -15878,6 +15894,18 @@ snapshots:hash: v1.k794b7964.5d437bffa8c9834cf88a783f58dbab3f625c27839ac872f0c2db7fd4b08f4ed8.sOK517AeohAmtL0coLOcSFfAB90HUEtQGr2HwmZLoi8scenes-other-onboarding-shared-wizard-sync-card--stalled--light:hash: v1.k794b7964.b52a107e85cd22687e6bc1dcf23a4067f185915e7aaa4518b39ef1bbfefe87ac.TU0cv3huC_bueumE3zh9JXnBoRGtM6FKvdbtqCcUL4c+ scenes-other-onboarding-welcome--default--dark:+ hash: v1.k794b7964.b2aafd7f923a67f40aa8e6be9fa012079073b1c8143e848b3e9d166c0036b334.FQvjQktw1Z0LAVV97BAiSLrHTRMq341uL9h5e_v61wM+ scenes-other-onboarding-welcome--default--light:+ hash: v1.k794b7964.5863156df815fb90243aa9133698bd5a697268c1a1c03c04e59b3d3c08c94e7e.KJbYhgP0XBnb-dqn7lDWKhvhkrpFxkqNNGh4ioOtgVI+ scenes-other-onboarding-welcome--product-installed--dark:+ hash: v1.k794b7964.69d39c449ea0019cdef5fb6bb55838827c1acf5b681589ae25c0d24b7177ef63.nGvy-yuMn0ZdzesviHylOfAIbOHJ9wB7y65ZG2Ys1_A+ scenes-other-onboarding-welcome--product-installed--light:+ hash: v1.k794b7964.bd124377e2654dc5a60545f0e3951efdb0d71bde018ddc3cd21412057ff303ee.3iGT4By34bGR2yJp-BUgl40bsZPwDiA6GUZzdUVM--Q+ scenes-other-onboarding-welcome--product-needs-setup--dark:+ hash: v1.k794b7964.09d9199a4bf38826fce1472f403c1f5baba234c833bb638829582ad3e481d7b3.PeGiGkoi3V3piPMswVLjHMBwSf7JlHpfr2ttV9fEaXg+ scenes-other-onboarding-welcome--product-needs-setup--light:+ hash: v1.k794b7964.bf819b1764e1984a9a6524819eb4a91f0849e928812fea0bbc709a2d0a554503.T7RXaktaCJTdvW36dpgd8ckZXDl37fbbiktBeT6zt8wscenes-other-org-member-invites--current-user-is-admin--dark:hash: v1.k794b7964.d615a6a86b8ee4b0b6d8a9a53e60c31d160def88fa9d1c9f6f38297fd3db29c9.TpUXfUFjMmXs3_sBuN8Cq1WKXBEre3YcdAyK9xJ_xLkscenes-other-org-member-invites--current-user-is-admin--light:diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.tsindex 1b8487de5f55..96e660b455f7 100644--- a/frontend/src/generated/core/api.schemas.ts+++ b/frontend/src/generated/core/api.schemas.ts@@ -27,6 +27,8 @@ export interface ConnectedAppApi {is_first_party: boolean/** Whether the user must choose to keep or disconnect this application, because it set up one of the user's organizations and PostHog has not verified it */requires_access_confirmation: boolean+ /** Whether the application registered itself, through dynamic client registration or a client ID metadata document. MCP clients connect this way; applications PostHog registers do not. */+ is_self_registered: boolean}/**@@ -6586,6 +6588,18 @@ export const OnboardingSkipRequestReasonEnumApi = {Other: 'other',} as const+/**+ * * `legacy` - Default onboarding+ * * `simple` - Simple onboarding+ */+export type OnboardingFlowVariantEnumApi =+ (typeof OnboardingFlowVariantEnumApi)[keyof typeof OnboardingFlowVariantEnumApi]++export const OnboardingFlowVariantEnumApi = {+ Legacy: 'legacy',+ Simple: 'simple',+} as const+/*** Request body for POST /api/users/{id}/onboarding/skip/.*@@ -6604,6 +6618,11 @@ export interface OnboardingSkipRequestApi {* @maxLength 64*/step_at_skip?: string+ /** Which onboarding flow the user skipped from, for analytics only.+ *+ * * `legacy` - Default onboarding+ * * `simple` - Simple onboarding */+ flow_variant?: OnboardingFlowVariantEnumApi}/**diff --git a/frontend/src/generated/core/api.zod.ts b/frontend/src/generated/core/api.zod.tsindex b93d7c417645..c56ac30a60c6 100644--- a/frontend/src/generated/core/api.zod.ts+++ b/frontend/src/generated/core/api.zod.ts@@ -1701,6 +1701,13 @@ export const UsersOnboardingSkipCreateBody = /* @__PURE__ */ zod.max(usersOnboardingSkipCreateBodyStepAtSkipMax).optional().describe('Onboarding step key the user was on when skipping, for analytics only.'),+ flow_variant: zod+ .enum(['legacy', 'simple'])+ .describe('\* `legacy` - Default onboarding\n\* `simple` - Simple onboarding')+ .optional()+ .describe(+ 'Which onboarding flow the user skipped from, for analytics only.\n\n\* `legacy` - Default onboarding\n\* `simple` - Simple onboarding'+ ),}).describe('Request body for POST \/api\/users\/{id}\/onboarding\/skip\/.\n\nSource of truth for OpenAPI \/ generated TS \/ zod \/ MCP — bind this serializer at\nruntime so the contract clients believe is enforced (length cap, choice validation,\nno extra fields) is actually enforced server-side.'diff --git a/frontend/src/layout/panel-layout/navbar/tabs/navProductItems.ts b/frontend/src/layout/panel-layout/navbar/tabs/navProductItems.tsindex eadfb72fb456..cfc09d69de80 100644--- a/frontend/src/layout/panel-layout/navbar/tabs/navProductItems.ts+++ b/frontend/src/layout/panel-layout/navbar/tabs/navProductItems.ts@@ -15,6 +15,15 @@ const DEFINITIONS_TAB_HREFS = new Set(DEFINITIONS_TABS.filter((tab) => tab.key !// Items in this category sit above Starred and All products, so they are never starred or grouped.export const PINNED_CATEGORY = 'Project'+// Shown first, and only while the project is new on the simple onboarding arm (see `isWelcomeNavItemShown`).+export const WELCOME_NAV_ITEM: FileSystemImport = {+ path: 'Welcome',+ category: PINNED_CATEGORY,+ iconType: 'wizard',+ href: urls.onboardingWelcome(),+ visualOrder: -1,+}+export function getNavProductItems(featureFlags: FeatureFlagsSet): FileSystemImport[] {const items: FileSystemImport[] = [{diff --git a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.tsindex 1298ff26b4c5..bdab37f4cb53 100644--- a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts+++ b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.test.ts@@ -58,6 +58,17 @@ describe('navProductsTabLogic', () => {expect(actual).toHaveLength(expected.size)})+ it('pins the welcome page first for a new project on the simple onboarding arm', () => {+ featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW]: 'test' })+ teamLogic.actions.loadCurrentTeamSuccess({+ ...teamLogic.values.currentTeam!,+ created_at: new Date().toISOString(),+ })+ expect(navProductsTabLogic.values.pinnedItems[0]).toEqual(+ expect.objectContaining({ path: 'Welcome', href: urls.onboardingWelcome() })+ )+ })+it('searches display names and sorts categories in a fixed order and products alphabetically', async () => {featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_AUTONOMY]: true })expect(navProductsTabLogic.values.pinnedItems.map(productsItemName)).toEqual([diff --git a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.tsindex 30c9c4209faa..24df03cec831 100644--- a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts+++ b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts@@ -11,13 +11,14 @@ import { FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLogic'import { getProductAccessDisabledReason } from 'lib/utils/accessControlUtils'import { withTimeout } from 'lib/utils/async'import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'+import { isWelcomeNavItemShown } from 'scenes/onboarding/welcome/welcomeNavItem'import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'import { teamLogic } from 'scenes/teamLogic'import { fileSystemShortcutBulkUpdateCreate } from '~/generated/core/api'import { FileSystemEntry, FileSystemImport } from '~/queries/schema/schema-general'-import type { PreflightStatus } from '~/types'+import type { PreflightStatus, TeamPublicType, TeamType } from '~/types'import * as decisionsApi from 'products/ml_inference/frontend/generated/api'@@ -26,7 +27,7 @@ import { projectTreeDataLogic } from '../../ProjectTree/projectTreeDataLogic'import { projectTreeLogic } from '../../ProjectTree/projectTreeLogic'import { findProductShortcut, shortcutFromEntry } from '../../ProjectTree/utils'import { APP_MATCH_THRESHOLD, AppMatchGroups, buildAppRankingQuestions, readAppRankings } from './appRanking'-import { PINNED_CATEGORY, getNavProductItems } from './navProductItems'+import { PINNED_CATEGORY, WELCOME_NAV_ITEM, getNavProductItems } from './navProductItems'import { ProductsItemGroup, groupProducts, productMatchesSearch, productsItemName } from './productsCatalog'// projectTreeLogic persists state under its logic key, so renaming this value resets it.@@ -42,6 +43,7 @@ export interface navProductsTabLogicValues {shortcutData: FileSystemEntry[] // projectTreeDataLogicshortcutDataHasLoaded: boolean // projectTreeDataLogicshortcutDataLoading: boolean // projectTreeDataLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogiccurrentTeamId: number | null // teamLogicallItems: FileSystemImport[]allProductsCollapsible: boolean@@ -67,6 +69,7 @@ export interface navProductsTabLogicValues {pinnedItems: FileSystemImport[]rankedConfigurableApps: FileSystemImport[]search: string+ showWelcomeNavItem: booleanstarredProductIds: Record<string, string>starredProductsSaving: boolean}@@ -131,10 +134,10 @@ export interface navProductsTabLogicActions {url: string} // routerloadCurrentTeamSuccess: (- currentTeam: null | import('~/types').TeamPublicType,+ currentTeam: TeamPublicType | null,payload?: any) => {- currentTeam: null | import('~/types').TeamPublicType+ currentTeam: TeamPublicType | nullpayload?: any} // teamLogicrankApps: ({ query }: { query: string }) => {@@ -224,7 +227,8 @@ export interface navProductsTabLogicMeta {appRecommendationsEnabled: boolean) => AppMatchGroups | nullallItems: (featureFlags: FeatureFlagsSet) => FileSystemImport[]- pinnedItems: (allItems: FileSystemImport[], search: string) => FileSystemImport[]+ showWelcomeNavItem: (currentTeam: TeamPublicType | TeamType | null, featureFlags: FeatureFlagsSet) => boolean+ pinnedItems: (allItems: FileSystemImport[], search: string, showWelcomeNavItem: boolean) => FileSystemImport[]groupedItems: (allItems: FileSystemImport[], search: string) => ProductsItemGroup[]configurableProducts: (allItems: FileSystemImport[]) => FileSystemImport[]starredProductIds: (allItems: FileSystemImport[], shortcutData: FileSystemEntry[]) => Record<string, string>@@ -267,7 +271,7 @@ export const navProductsTabLogic = kea<navProductsTabLogicType>([connect(() => ({values: [teamLogic,- ['currentTeamId'],+ ['currentTeamId', 'currentTeam'],preflightLogic,['preflight'],featureFlagLogic,@@ -475,10 +479,15 @@ export const navProductsTabLogic = kea<navProductsTabLogicType>([(s) => [s.featureFlags],(featureFlags: FeatureFlagsSet): FileSystemImport[] => getNavProductItems(featureFlags),],+ showWelcomeNavItem: [+ (s) => [s.currentTeam, s.featureFlags],+ (currentTeam: TeamPublicType | TeamType | null, featureFlags: FeatureFlagsSet): boolean =>+ isWelcomeNavItemShown(currentTeam?.created_at, featureFlags),+ ],pinnedItems: [- (s) => [s.allItems, s.search],- (items: FileSystemImport[], search: string): FileSystemImport[] =>- items+ (s) => [s.allItems, s.search, s.showWelcomeNavItem],+ (items: FileSystemImport[], search: string, showWelcomeNavItem: boolean): FileSystemImport[] =>+ [...(showWelcomeNavItem ? [WELCOME_NAV_ITEM] : []), ...items].filter((item) => item.category === PINNED_CATEGORY && productMatchesSearch(item, search)).sort((a, b) => (a.visualOrder ?? Infinity) - (b.visualOrder ?? Infinity)),],diff --git a/frontend/src/lib/api.mock.ts b/frontend/src/lib/api.mock.tsindex bf75ecbd7b04..dcce3fbb0ee3 100644--- a/frontend/src/lib/api.mock.ts+++ b/frontend/src/lib/api.mock.ts@@ -48,7 +48,7 @@ export const MOCK_DEFAULT_TEAM: TeamType = {project_id: MOCK_TEAM_ID,uuid: MOCK_TEAM_UUID,organization: MOCK_ORGANIZATION_ID,- api_token: 'default-team-api-token',+ api_token: 'phc_default-team-api-token',secret_api_token: 'phs_default-team-secret-api-token',secret_api_token_backup: 'phs_default-team-secret-api-token-backup',app_urls: ['https://posthog.com/', 'https://app.posthog.com', 'https://example.com', 'http://127.0.0.1:*'],diff --git a/frontend/src/lib/components/MCPHint/agentConnectionLogic.test.ts b/frontend/src/lib/components/MCPHint/agentConnectionLogic.test.tsnew file mode 100644index 000000000000..81c8db809548--- /dev/null+++ b/frontend/src/lib/components/MCPHint/agentConnectionLogic.test.ts@@ -0,0 +1,106 @@+import { expectLogic } from 'kea-test-utils'++import type { ConnectedAppApi } from '~/generated/core/api.schemas'+import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'++import { agentConnectionLogic, hasAgentConnection } from './agentConnectionLogic'++const AGENT_APP: ConnectedAppApi = {+ id: 'agent',+ name: 'Claude Code',+ logo_uri: null,+ scopes: ['openid'],+ authorized_at: '2026-06-18T00:00:00Z',+ is_verified: false,+ is_first_party: false,+ requires_access_confirmation: false,+ is_self_registered: true,+}+const WIZARD_APP: ConnectedAppApi = {+ ...AGENT_APP,+ id: 'wizard',+ name: 'PostHog Wizard',+ is_first_party: true,+ is_self_registered: false,+}++describe('agentConnectionLogic', () => {+ let logic: ReturnType<typeof agentConnectionLogic.build>++ afterEach(() => {+ logic?.unmount()+ jest.useRealTimers()+ })++ it.each([+ ['no connection', [], false],+ ['only the setup wizard', [WIZARD_APP], false],+ ['the setup wizard and an agent', [WIZARD_APP, AGENT_APP], true],+ ])('hasAgentConnection with %s', (_name, apps, expected) => {+ expect(hasAgentConnection(apps)).toBe(expected)+ })++ it('leaves the connection unknown when the lookup fails', async () => {+ useMocks({ get: { '/api/oauth/connected-apps/': () => [500, { detail: 'boom' }] } })+ initKeaTests()+ logic = agentConnectionLogic()+ logic.mount()++ await expectLogic(logic).toFinishAllListeners()++ expect(logic.values.hasConnectedAgent).toBeNull()+ })++ it('polls until an agent connects, then stops', async () => {+ const responses = [[], [], [AGENT_APP]]+ let calls = 0+ useMocks({+ get: { '/api/oauth/connected-apps/': () => [200, responses[Math.min(calls++, responses.length - 1)]] },+ })+ initKeaTests()+ jest.useFakeTimers()+ logic = agentConnectionLogic()+ logic.mount()+ logic.actions.setPolling(true)+ await jest.advanceTimersByTimeAsync(0)+ expect(logic.values.hasConnectedAgent).toBe(false)++ await jest.advanceTimersByTimeAsync(10_000)+ expect(logic.values.hasConnectedAgent).toBe(true)++ const callsWhenConnected = calls+ await jest.advanceTimersByTimeAsync(30_000)+ expect(calls).toBe(callsWhenConnected)+ })++ it('keeps a newer connected response when an older empty one arrives late', async () => {+ const releases: Array<() => void> = []+ const responses = [[], [AGENT_APP]]+ let call = 0+ useMocks({+ get: {+ '/api/oauth/connected-apps/': async () => {+ const body = responses[Math.min(call++, responses.length - 1)]+ await new Promise<void>((resolve) => releases.push(resolve))+ return [200, body]+ },+ },+ })+ initKeaTests()+ logic = agentConnectionLogic()+ logic.mount()+ logic.actions.loadConnectedApps()+ await expectLogic(logic).toMatchValues({ connectedAppsLoading: true })+ while (releases.length < 2) {+ await new Promise((r) => setTimeout(r, 0))+ }++ releases[1]()+ await expectLogic(logic).toDispatchActions(['loadConnectedAppsSuccess'])+ releases[0]()+ await expectLogic(logic).toFinishAllListeners()++ expect(logic.values.hasConnectedAgent).toBe(true)+ })+})diff --git a/frontend/src/lib/components/MCPHint/agentConnectionLogic.ts b/frontend/src/lib/components/MCPHint/agentConnectionLogic.tsnew file mode 100644index 000000000000..7148277450c8--- /dev/null+++ b/frontend/src/lib/components/MCPHint/agentConnectionLogic.ts@@ -0,0 +1,146 @@+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'+import { loaders } from 'kea-loaders'++import { createPollLoop, isPermanentPollError } from 'lib/wizard-sync/pollLoop'++import { oauthConnectedAppsList } from '~/generated/core/api'+import type { ConnectedAppApi } from '~/generated/core/api.schemas'++const POLL_INTERVAL_MS = 3000++/**+ * Whether the user has an agent connected to PostHog. MCP clients register themselves when they+ * sign in over OAuth, so a self-registered connection stands in for a connected agent.+ *+ * Not foolproof: any OAuth client can register itself, and an MCP client that PostHog registered+ * by hand is missed. Nothing records which connections serve the MCP server, so this is the+ * closest signal available for now.+ */+export function hasAgentConnection(connectedApps: ConnectedAppApi[]): boolean {+ return connectedApps.some((app) => app.is_self_registered)+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface agentConnectionLogicValues {+ connectedApps: ConnectedAppApi[] | null+ connectedAppsLoading: boolean+ hasConnectedAgent: boolean | null+ polling: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface agentConnectionLogicActions {+ loadConnectedApps: (_?: any) => any+ loadConnectedAppsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadConnectedAppsSuccess: (+ connectedApps: ConnectedAppApi[] | null,+ payload?: any+ ) => {+ connectedApps: ConnectedAppApi[] | null+ payload?: any+ }+ setPolling: (polling: boolean) => {+ polling: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface agentConnectionLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasConnectedAgent: (connectedApps: ConnectedAppApi[] | null) => boolean | null+ }+}++export type agentConnectionLogicType = MakeLogicType<+ agentConnectionLogicValues,+ agentConnectionLogicActions,+ Record<string, any>,+ agentConnectionLogicMeta+>++/**+ * Promotional surfaces read this instead of `connectedAppsLogic`: a failed lookup stays silent and+ * leaves the answer unknown, rather than raising the settings page's error toast.+ */+export const agentConnectionLogic = kea<agentConnectionLogicType>([+ path(['lib', 'components', 'MCPHint', 'agentConnectionLogic']),+ actions({+ setPolling: (polling: boolean) => ({ polling }),+ }),+ reducers({+ polling: [+ false,+ {+ setPolling: (_, { polling }) => polling,+ },+ ],+ }),+ loaders(({ values }) => ({+ connectedApps: [+ null as ConnectedAppApi[] | null,+ {+ loadConnectedApps: async (_ = undefined, breakpoint) => {+ let connectedApps: ConnectedAppApi[]+ try {+ connectedApps = await oauthConnectedAppsList()+ } catch {+ return values.connectedApps+ }+ // Drops a slower, older response so it cannot overwrite a newer one.+ breakpoint()+ return connectedApps+ },+ },+ ],+ })),+ selectors({+ // `null` until a lookup succeeds, so callers can tell "not connected" from "unknown".+ hasConnectedAgent: [+ (s) => [s.connectedApps],+ (connectedApps: ConnectedAppApi[] | null): boolean | null =>+ connectedApps === null ? null : hasAgentConnection(connectedApps),+ ],+ }),+ listeners(({ actions, values, cache }) => ({+ setPolling: ({ polling }) => {+ if (!polling) {+ cache.disposables.dispose('poll')+ return+ }+ cache.disposables.add(+ createPollLoop({+ intervalMs: POLL_INTERVAL_MS,+ tick: async () => {+ // A load already in flight (the mount's or a focus refresh) answers this tick.+ if (!values.connectedAppsLoading) {+ actions.loadConnectedAppsSuccess(await oauthConnectedAppsList())+ }+ return values.hasConnectedAgent ? 'terminal' : 'ok'+ },+ onError: (error) => (isPermanentPollError(error) ? 'stop' : 'retry'),+ shouldStop: () => !values.polling || !!values.hasConnectedAgent,+ }),+ 'poll'+ )+ },+ })),+ afterMount(({ actions, values, cache }) => {+ actions.loadConnectedApps()+ // An agent is usually authorized in another tab, so check again when the user comes back.+ cache.disposables.add(() => {+ const onFocus = (): void => {+ if (!values.hasConnectedAgent) {+ actions.loadConnectedApps()+ }+ }+ window.addEventListener('focus', onFocus)+ return () => window.removeEventListener('focus', onFocus)+ }, 'focusRefresh')+ }),+])diff --git a/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx b/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsxindex 38e94c387a03..fdccc2a017bc 100644--- a/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx+++ b/frontend/src/lib/components/ProductEmptyState/ProductEmptyState.stories.tsx@@ -44,7 +44,7 @@ import { llmSkillsEmptyState } from 'products/skills/frontend/emptyState/llmSkilimport { subscriptionsEmptyState } from 'products/subscriptions/frontend/emptyState/subscriptionsEmptyState'import { surveysEmptyState } from 'products/surveys/frontend/emptyState/surveysEmptyState'import { tracingEmptyState } from 'products/tracing/frontend/emptyState/tracingEmptyState'-import { webVitalsEmptyState } from 'products/web_analytics/frontend/emptyState/webVitalsEmptyState'+import { webAnalyticsEmptyState } from 'products/web_analytics/frontend/emptyState/webAnalyticsEmptyState'import { heatmapsEmptyState } from 'products/web_analytics/frontend/heatmaps/emptyState/heatmapsEmptyState'import { workflowsEmptyState } from 'products/workflows/frontend/emptyState/workflowsEmptyState'@@ -389,19 +389,11 @@ export const SessionReplayWaitingForData: ProductEmptyStateStory = productEmptyS{ mocks: sessionReplayMocks })-// Web vitals detection asks event definitions on mount - answer "none yet".-const webVitalsMocks = {- get: { '/api/projects/:team_id/event_definitions/': [200, { results: [] }] },-} as const--export const WebVitalsNeedsSetup: ProductEmptyStateStory = productEmptyStateStory(webVitalsEmptyState, 'needs-setup', {- mocks: webVitalsMocks,-})--export const WebVitalsWaitingForData: ProductEmptyStateStory = productEmptyStateStory(- webVitalsEmptyState,- 'waiting-for-data',- { mocks: webVitalsMocks }+// Web analytics detection asks event definitions on mount - answer "none yet".+export const WebAnalyticsNeedsSetup: ProductEmptyStateStory = productEmptyStateStory(+ webAnalyticsEmptyState,+ 'needs-setup',+ { mocks: { get: { '/api/projects/:team_id/event_definitions/': [200, { results: [] }] } } })// Alerts detection counts both alert kinds on mount - answer "none yet" to each.diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 9b071a97f644..9821ca870cb5 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -434,6 +434,7 @@ export const FEATURE_FLAGS = {NEW_TEAM_CORE_EVENTS: 'new-team-core-events', // owner: @jabahamondes #team-web-analyticsNOTEBOOK_SANDBOX_FREE_COMPUTE: 'notebook-sandbox-free-compute', // owner: #team-data-tools, shows the notebook sandbox rate crossed out at $0.00 / hNOTEBOOK_SHARING: 'notebook-sharing', // owner: @reecejones #team-platform-features+ ONBOARDING_SIMPLE_FLOW: 'onboarding-simple-flow', // owner: @rafaeelaudibert #team-growth multivariate=control,test, test sends new users through a short install, MCP and card flow, then to the welcome pageONBOARDING_WIZARD_CLOUD_RUN: 'onboarding-wizard-cloud-run', // owner: @fercgomes #team-growth multivariate=control,test — gates the "open a PR for me" cloud wizard option on the install stepONBOARDING_WIZARD_SYNC_MODE: 'onboarding-wizard-sync-mode', // owner: @fercgomes #team-growth multivariate=sse,polling — how the wizard sync panel pulls run updates (SSE stream vs REST polling); payload carries polling_interval_secsORGANIZATION_BILLING_API: 'organization-billing-api', // owner: #team-billing, reads the usage and spend pages from the organization billing API; the same flag gates those routesdiff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex 3deffe97df13..4cb74aaf7846 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -2125,7 +2125,7 @@ export const productSetupProbes: ProductSetupProbe[] = [},{ productKey: ProductKey.ERROR_TRACKING, hasDataEvents: ['$exception'] },{ productKey: ProductKey.MCP_ANALYTICS, hasDataEvents: ['$mcp_tool_call'], waitingEvents: ['$mcp_initialize'] },- { productKey: ProductKey.WEB_ANALYTICS, hasDataEvents: ['$web_vitals'] },+ { productKey: ProductKey.WEB_ANALYTICS, hasDataEvents: ['$pageview'] },]/** This const is auto-generated, as is the whole file */diff --git a/frontend/src/scenes/appScenes.ts b/frontend/src/scenes/appScenes.tsindex 41785cd2ebb6..34fb591c37a7 100644--- a/frontend/src/scenes/appScenes.ts+++ b/frontend/src/scenes/appScenes.ts@@ -68,6 +68,7 @@ export const appScenes: Record<Scene | string, () => any> = {[Scene.OAuthAuthorize]: () => import('./oauth/OAuthAuthorize'),[Scene.Onboarding]: () => import('./onboarding/Onboarding'),[Scene.OnboardingCoupon]: () => import('./onboarding/coupon/OnboardingCouponRedemption'),+ [Scene.OnboardingWelcome]: () => import('./onboarding/welcome/OnboardingWelcome'),[Scene.OrganizationCreateFirst]: () => import('./organization/Create'),[Scene.OrganizationCreationConfirm]: () => import('./organization/ConfirmOrganization/ConfirmOrganization'),[Scene.PasswordResetComplete]: () => import('./authentication/password-reset/PasswordResetComplete'),diff --git a/frontend/src/scenes/authentication/account/credential-review/CredentialReview.stories.tsx b/frontend/src/scenes/authentication/account/credential-review/CredentialReview.stories.tsxindex 066ae0bcd1a9..648c76840a00 100644--- a/frontend/src/scenes/authentication/account/credential-review/CredentialReview.stories.tsx+++ b/frontend/src/scenes/authentication/account/credential-review/CredentialReview.stories.tsx@@ -52,6 +52,7 @@ const unverifiedPartnerApp: ConnectedAppApi = {is_verified: false,is_first_party: false,requires_access_confirmation: true,+ is_self_registered: false,}const verifiedPartnerApp: ConnectedAppApi = {@@ -63,6 +64,7 @@ const verifiedPartnerApp: ConnectedAppApi = {is_verified: true,is_first_party: false,requires_access_confirmation: false,+ is_self_registered: false,}const passkey = {diff --git a/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.test.ts b/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.test.tsindex 79bb046af83d..ca2464eab8d1 100644--- a/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.test.ts+++ b/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.test.ts@@ -26,6 +26,7 @@ function connectedApp(id: string, flags: Partial<ConnectedAppApi>): ConnectedAppis_verified: false,is_first_party: false,requires_access_confirmation: false,+ is_self_registered: false,...flags,}}diff --git a/frontend/src/scenes/onboarding/Onboarding.stories.tsx b/frontend/src/scenes/onboarding/Onboarding.stories.tsxindex 51689b08b9a0..785289cd5786 100644--- a/frontend/src/scenes/onboarding/Onboarding.stories.tsx+++ b/frontend/src/scenes/onboarding/Onboarding.stories.tsx@@ -380,3 +380,55 @@ export const InviteTeammates: Story = {return <App />},}++// ==========================================+// Simple flow (experiment arm)+// ==========================================++const CONNECTED_APP = {+ id: '0197c2a2-0000-0000-0000-000000000001',+ name: 'Claude Code',+ logo_uri: null,+ scopes: ['openid'],+ authorized_at: '2023-05-25T00:00:00Z',+ is_verified: true,+ is_first_party: false,+ is_self_registered: true,+}++// A new organization has no subscription yet, so the simple flow ends with the plan step.+function simpleFlowStory(+ stepKey: OnboardingStepKey,+ connectedApps: (typeof CONNECTED_APP)[],+ waitForLoadersToDisappear: boolean+): Story {+ return {+ render: () => {+ useMountedLogic(onboardingLogic)++ useStorybookMocks({+ get: { '/api/oauth/connected-apps/': connectedApps, '/api/billing/': { ...billingUnsubscribedJson } },+ })++ useDelayedOnMountEffect(() => {+ router.actions.push(urls.simpleOnboarding(), {+ step: `${stepKey}:${ProductKey.PRODUCT_ANALYTICS}`,+ })+ })++ return <App />+ },+ parameters: {+ featureFlags: { [FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW]: 'test' },+ testOptions: { waitForSelector: '[data-attr="wizard-command-block"]', waitForLoadersToDisappear },+ },+ }+}++// The install step's realtime check keeps a spinner up until the first event arrives.+export const SimpleFlowInstall: Story = simpleFlowStory(OnboardingStepKey.INSTALL, [], false)++// The MCP step shows a spinner for as long as no agent is connected, which is the state under test.+export const SimpleFlowConnectMcp: Story = simpleFlowStory(OnboardingStepKey.MCP, [], false)++export const SimpleFlowMcpConnected: Story = simpleFlowStory(OnboardingStepKey.MCP, [CONNECTED_APP], true)diff --git a/frontend/src/scenes/onboarding/Onboarding.tsx b/frontend/src/scenes/onboarding/Onboarding.tsxindex 1429c0e14c26..a9ce277e931a 100644--- a/frontend/src/scenes/onboarding/Onboarding.tsx+++ b/frontend/src/scenes/onboarding/Onboarding.tsx@@ -9,6 +9,7 @@ import { SceneExport } from 'scenes/sceneTypes'import { OnboardingFlowHost } from './OnboardingFlowHost'import { onboardingLogic } from './onboardingLogic'import { ProductSelectionShell } from './productSelection/ProductSelectionShell'+import { SimpleOnboarding } from './simple/SimpleOnboarding'export const scene: SceneExport = {component: Onboarding,@@ -19,10 +20,11 @@ const CARD_CLASSES ='relative w-full min-h-0 flex flex-col overflow-visible p-0 sm:max-h-[calc(100dvh-7rem)] sm:overflow-y-auto sm:p-8 md:p-10 sm:bg-surface-primary sm:rounded-2xl sm:shadow-[0_16px_40px_rgb(30_50_10_/_25%)] sm:border sm:border-primary'/**- * Renders product selection until a product is chosen, then hands off to the flow host.+ * Renders product selection until a product is chosen, then hands off to the flow host. The simple+ * flow skips product selection.*/export function Onboarding(): JSX.Element | null {- const { productKey } = useValues(onboardingLogic)+ const { productKey, flowVariant } = useValues(onboardingLogic)return (<div className="OnboardingDottedBg min-h-screen flex flex-col items-center justify-center p-4 sm:p-6">@@ -30,7 +32,13 @@ export function Onboarding(): JSX.Element | null {<Logo size="lg" /></span><div className={clsx(CARD_CLASSES, productKey ? 'max-w-5xl' : 'max-w-6xl')}>- {productKey ? <OnboardingFlowHost /> : <ProductSelectionShell />}+ {flowVariant === 'simple' ? (+ <SimpleOnboarding />+ ) : productKey ? (+ <OnboardingFlowHost />+ ) : (+ <ProductSelectionShell />+ )}</div></div>)diff --git a/frontend/src/scenes/onboarding/OnboardingStep.tsx b/frontend/src/scenes/onboarding/OnboardingStep.tsxindex abf8b5652a8a..f2dea4febf28 100644--- a/frontend/src/scenes/onboarding/OnboardingStep.tsx+++ b/frontend/src/scenes/onboarding/OnboardingStep.tsx@@ -1,6 +1,6 @@import clsx from 'clsx'import { useActions, useValues } from 'kea'-import { useEffect, useState } from 'react'+import { useContext, useEffect, useState } from 'react'import { IconArrowRight } from '@posthog/icons'import { LemonButton } from '@posthog/lemon-ui'@@ -12,6 +12,7 @@ import { OnboardingStepKey } from '~/types'import { stepKeyToTitle } from './onboardingFlowUtils'import { onboardingLogic } from './onboardingLogic'+import { OnboardingStepFooterStartContext } from './OnboardingStepFooterStartContext'export const OnboardingStep = ({stepKey,@@ -47,10 +48,11 @@ export const OnboardingStep = ({fullWidth?: booleanactions?: JSX.Element}): JSX.Element => {- const { hasNextStep, currentStepProductKey } = useValues(onboardingLogic)+ const { hasNextStep, currentStepProductKey, flowVariant } = useValues(onboardingLogic)const { completeOnboarding, goToNextStep } = useActions(onboardingLogic)const { openSupportForm } = useActions(supportLogic)+ const footerStart = useContext(OnboardingStepFooterStartContext)const advance: () => void = !hasNextStep ? completeOnboarding : goToNextStep@@ -70,14 +72,14 @@ export const OnboardingStep = ({const skip = (): void => {setPendingAdvance('skip')- reportOnboardingStepSkipped(stepKey, currentStepProductKey ?? undefined)+ reportOnboardingStepSkipped(stepKey, flowVariant, currentStepProductKey ?? undefined)onSkip?.()advance()}const next = (): void => {setPendingAdvance('continue')- reportOnboardingStepCompleted(stepKey, currentStepProductKey ?? undefined)+ reportOnboardingStepCompleted(stepKey, flowVariant, currentStepProductKey ?? undefined)onContinue?.()advance()}@@ -105,7 +107,8 @@ export const OnboardingStep = ({</div>)}{children}- <div className="mt-8 flex justify-end gap-x-2">+ <div className="mt-8 flex flex-wrap items-center justify-end gap-2">+ {footerStart && <div className="mr-auto">{footerStart}</div>}{showHelpButton && (<LemonButton type="secondary" onClick={() => openSupportForm({ kind: 'support' })}>Need help?diff --git a/frontend/src/scenes/onboarding/OnboardingStepFooterStartContext.ts b/frontend/src/scenes/onboarding/OnboardingStepFooterStartContext.tsnew file mode 100644index 000000000000..b1be9b0222f2--- /dev/null+++ b/frontend/src/scenes/onboarding/OnboardingStepFooterStartContext.ts@@ -0,0 +1,4 @@+import { createContext } from 'react'++/** Content a flow shell places at the start of every step's action row, left of the step's own buttons. */+export const OnboardingStepFooterStartContext = createContext<React.ReactNode>(null)diff --git a/frontend/src/scenes/onboarding/billing/OnboardingUpgradeStep.tsx b/frontend/src/scenes/onboarding/billing/OnboardingUpgradeStep.tsxindex ab284e349408..c04a08415481 100644--- a/frontend/src/scenes/onboarding/billing/OnboardingUpgradeStep.tsx+++ b/frontend/src/scenes/onboarding/billing/OnboardingUpgradeStep.tsx@@ -26,6 +26,7 @@ type OnboardingUpgradeStepProps = {export const OnboardingUpgradeStep: OnboardingStepComponentType<OnboardingUpgradeStepProps> = ({ product }) => {const { billing, billingLoading } = useValues(billingLogic)+ const { flowVariant } = useValues(onboardingLogic)const { goToNextStep } = useActions(onboardingLogic)if (billingLoading) {@@ -44,11 +45,11 @@ export const OnboardingUpgradeStep: OnboardingStepComponentType<OnboardingUpgradconst activeAddon = trialAddon ?? platformProduct?.addons?.find((addon) => addon.subscribed)const skipPlatformPackages = (): void => {- reportOnboardingStepSkipped(OnboardingStepKey.PLANS)+ reportOnboardingStepSkipped(OnboardingStepKey.PLANS, flowVariant)goToNextStep()}const continueFromPlatformPackages = (): void => {- reportOnboardingStepCompleted(OnboardingStepKey.PLANS)+ reportOnboardingStepCompleted(OnboardingStepKey.PLANS, flowVariant)goToNextStep()}diff --git a/frontend/src/scenes/onboarding/billing/PlanCards.tsx b/frontend/src/scenes/onboarding/billing/PlanCards.tsxindex 1de4e8700cff..e6c34a7b670d 100644--- a/frontend/src/scenes/onboarding/billing/PlanCards.tsx+++ b/frontend/src/scenes/onboarding/billing/PlanCards.tsx@@ -69,6 +69,7 @@ export const PlanCard: React.FC<PlanCardProps> = ({ planData, product, highlightconst { billingProductLoading } = useValues(billingProductLogic({ product }))const [isHovering, setIsHovering] = useState<boolean | undefined>(undefined)+ const { flowVariant } = useValues(onboardingLogic)const { goToNextStep } = useActions(onboardingLogic)const { startPaymentEntryFlow } = useActions(paymentEntryLogic)@@ -107,7 +108,7 @@ export const PlanCard: React.FC<PlanCardProps> = ({ planData, product, highlightif (planData.ctaAction === 'billing') {startPaymentEntryFlow(product, window.location.pathname + window.location.search)} else if (planData.ctaAction === 'next') {- reportOnboardingStepCompleted(OnboardingStepKey.PLANS)+ reportOnboardingStepCompleted(OnboardingStepKey.PLANS, flowVariant)goToNextStep()}}@@ -216,7 +217,7 @@ export const PlanCard: React.FC<PlanCardProps> = ({ planData, product, highlightstatus={highlight ? 'alt' : undefined}onClick={(event) => {event.stopPropagation()- reportOnboardingStepCompleted(OnboardingStepKey.PLANS)+ reportOnboardingStepCompleted(OnboardingStepKey.PLANS, flowVariant)goToNextStep()}}tabIndex={-1}diff --git a/frontend/src/scenes/onboarding/data-warehouse/OnboardingDataWarehouseSourcesStep.tsx b/frontend/src/scenes/onboarding/data-warehouse/OnboardingDataWarehouseSourcesStep.tsxindex b4d9ac97d60a..3aee07a1e9c0 100644--- a/frontend/src/scenes/onboarding/data-warehouse/OnboardingDataWarehouseSourcesStep.tsx+++ b/frontend/src/scenes/onboarding/data-warehouse/OnboardingDataWarehouseSourcesStep.tsx@@ -11,6 +11,7 @@ import { OnboardingStepComponentType, onboardingLogic } from '../onboardingLogicimport { OnboardingStep } from '../OnboardingStep'export const OnboardingDataWarehouseSourcesStep: OnboardingStepComponentType = () => {+ const { flowVariant } = useValues(onboardingLogic)const { goToNextStep } = useActions(onboardingLogic)const { availableSourcesLoading } = useValues(availableSourcesLogic)return (@@ -23,7 +24,7 @@ export const OnboardingDataWarehouseSourcesStep: OnboardingStepComponentType = (><InlineSourceSetuponComplete={() => {- reportOnboardingStepCompleted(OnboardingStepKey.LINK_DATA)+ reportOnboardingStepCompleted(OnboardingStepKey.LINK_DATA, flowVariant)goToNextStep()}}featureddiff --git a/frontend/src/scenes/onboarding/onboardingFlowUtils.ts b/frontend/src/scenes/onboarding/onboardingFlowUtils.tsindex 848cc64d3807..2ed42c01a858 100644--- a/frontend/src/scenes/onboarding/onboardingFlowUtils.ts+++ b/frontend/src/scenes/onboarding/onboardingFlowUtils.ts@@ -5,6 +5,7 @@ import { OnboardingStepKey } from '~/types'const STEP_KEY_TITLE_OVERRIDES: Partial<Record<OnboardingStepKey, string>> = {[OnboardingStepKey.LINK_DATA]: 'Import data',+ [OnboardingStepKey.MCP]: 'Connect MCP',}export const stepKeyToTitle = (stepKey?: OnboardingStepKey): undefined | string => {diff --git a/frontend/src/scenes/onboarding/onboardingLogic.test.ts b/frontend/src/scenes/onboarding/onboardingLogic.test.tsindex 35339da35967..cc5dad18630a 100644--- a/frontend/src/scenes/onboarding/onboardingLogic.test.ts+++ b/frontend/src/scenes/onboarding/onboardingLogic.test.ts@@ -1,16 +1,20 @@import { router } from 'kea-router'import { expectLogic } from 'kea-test-utils'+import posthog from 'posthog-js'import { SetupTaskId } from 'lib/components/ProductSetup'import { FEATURE_FLAGS } from 'lib/constants'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'+import { removeProjectIdIfPresent } from 'lib/utils/kea-router'import { urls } from 'scenes/urls'+import { useMocks } from '~/mocks/jest'import { ProductKey } from '~/queries/schema/schema-general'import { initKeaTests } from '~/test/init'import { OnboardingStepKey } from '~/types'import { onboardingLogic } from './onboardingLogic'+import { productSelectionLogic } from './productSelection/productSelectionLogic'import { INSTALL_DEDUP_KEYS } from './types'/**@@ -38,6 +42,7 @@ describe('onboardingLogic — flow composition', () => {afterEach(() => {logic.unmount()+ jest.restoreAllMocks()})/** Convenience: list step ids for the active flow. */@@ -694,6 +699,98 @@ describe('onboardingLogic — flow composition', () => {})})+ describe('flow variants', () => {+ const assignSimpleFlowArm = (variant: string): void => {+ featureFlagLogic.findMounted()?.actions.setFeatureFlags([FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW], {+ [FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW]: variant,+ })+ }++ const currentPath = (): string => removeProjectIdIfPresent(router.values.location.pathname)++ it.each([+ ['test arm', 'test', '/onboarding', false, '/onboarding/simple', 'simple', ['simple']],+ ['test arm with late flags', 'test', '/onboarding', true, '/onboarding/simple', 'simple', ['simple']],+ ['control arm', 'control', '/onboarding', false, '/onboarding', 'default', ['legacy']],+ [+ 'test arm on a product url',+ 'test',+ '/onboarding/product_analytics',+ true,+ '/onboarding/product_analytics',+ 'default',+ [],+ ],+ ])(+ '%s lands on the right flow',+ async (_, variant, entryPath, flagsLandLate, pathname, flowVariant, startedFlowVariants) => {+ const capture = jest.spyOn(posthog, 'capture').mockImplementation()+ if (!flagsLandLate) {+ assignSimpleFlowArm(variant)+ }+ router.actions.push(entryPath)+ // The page renders product selection while it sits on bare `/onboarding`.+ const productSelection = currentPath() === '/onboarding' ? productSelectionLogic() : null+ productSelection?.mount()+ if (flagsLandLate) {+ assignSimpleFlowArm(variant)+ }+ await expectLogic(logic).toFinishAllListeners()+ productSelection?.unmount()+ expect(currentPath()).toBe(pathname)+ expect(logic.values.flowVariant).toBe(flowVariant)+ const startedVariants = capture.mock.calls+ .filter(([event]) => event === 'onboarding started')+ .map(([, properties]) => properties?.flow_variant)+ expect(startedVariants).toEqual(startedFlowVariants)+ }+ )++ it('the simple flow is install, MCP, then invite, and advancing stays on its own URL', async () => {+ router.actions.push(urls.simpleOnboarding())+ await expectLogic(logic).toFinishAllListeners()+ expect(flowIds()).toEqual([+ 'install:product_analytics',+ 'mcp:product_analytics',+ 'invite_teammates:product_analytics',+ ])++ logic.actions.goToNextStep()+ await expectLogic(logic).toFinishAllListeners()+ expect(currentPath()).toBe(urls.simpleOnboarding())+ expect(router.values.searchParams.step).toBe('mcp:product_analytics')+ expect(logic.values.onCompleteOnboardingRedirectUrl).toBe(urls.onboardingWelcome())+ expect(logic.values.installStepReturnUrl).toBe(+ `${urls.simpleOnboarding()}?step=${encodeURIComponent('install:product_analytics')}`+ )+ })++ it.each([+ ['the welcome page', '', urls.onboardingWelcome()],+ ['the page the user signed up to reach', '?next=%2Finsights', '/insights'],+ ])('skipping the simple flow records the skip before landing on %s', async (_, search, landingPath) => {+ const skipRequests: unknown[] = []+ useMocks({+ post: {+ '/api/users/@me/onboarding/skip/': async ({ request }) => {+ skipRequests.push(await request.json())+ return [200, {}]+ },+ },+ })+ router.actions.push(urls.simpleOnboarding() + search)+ await expectLogic(logic, () => {+ logic.actions.skipSimpleOnboarding()+ }).toFinishAllListeners()++ expect(skipRequests).toEqual([+ { reason: 'later', step_at_skip: OnboardingStepKey.INSTALL, flow_variant: 'simple' },+ ])+ expect(currentPath()).toBe(landingPath)+ expect(logic.values.isSkippingOnboarding).toBe(false)+ })+ })+describe('flow stays consistent across product changes', () => {it('switching primary resets the secondary list and rebuilds the flow', () => {logic.actions.setProductKey(ProductKey.PRODUCT_ANALYTICS)diff --git a/frontend/src/scenes/onboarding/onboardingLogic.tsx b/frontend/src/scenes/onboarding/onboardingLogic.tsxindex 6b5c88186776..cf4f9165945d 100644--- a/frontend/src/scenes/onboarding/onboardingLogic.tsx+++ b/frontend/src/scenes/onboarding/onboardingLogic.tsx@@ -1,5 +1,5 @@import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'-import { actionToUrl, router, urlToAction } from 'kea-router'+import { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'import posthog from 'posthog-js'import { lemonToast } from '@posthog/lemon-ui'@@ -10,8 +10,9 @@ import { OrganizationMembershipLevel } from 'lib/constants'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { isKeyOf } from 'lib/utils/guards'import { removeProjectIdIfPresent } from 'lib/utils/kea-router'+import { getRelativeNextPath } from 'lib/utils/url'import { billingLogic } from 'scenes/billing/billingLogic'-import { reportOnboardingCompleted } from 'scenes/onboarding/onboardingUsage'+import { reportOnboardingCompleted, reportOnboardingStarted } from 'scenes/onboarding/onboardingUsage'import { availableOnboardingProducts } from 'scenes/onboarding/shared/utils'import { organizationLogic } from 'scenes/organizationLogic'import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'@@ -20,6 +21,7 @@ import { teamLogic } from 'scenes/teamLogic'import { urls } from 'scenes/urls'import { userLogic } from 'scenes/userLogic'+import { usersOnboardingSkipCreate } from '~/generated/core/api'import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'import { ProductKey } from '~/queries/schema/schema-general'import { Breadcrumb, OnboardingProduct, OnboardingStepKey } from '~/types'@@ -37,8 +39,10 @@ import type {} from '../../types'import { arraysEqual, parseProductsParam, stepKeyToTitle } from './onboardingFlowUtils'import { appendSharedTrailingSteps, mayBeAppendedLater } from './sharedSteps'+import { isOnSimpleOnboardingArm } from './simple/simpleOnboardingArm'+import { buildSimpleOnboardingFlow, SIMPLE_ONBOARDING_PRODUCT_KEY } from './simple/simpleOnboardingFlow'import { onboardingProviderRegistry } from './stepProviderRegistry'-import { type OnboardingFlowContext, type OnboardingStepDescriptor } from './types'+import { type OnboardingFlowContext, type OnboardingFlowVariant, type OnboardingStepDescriptor } from './types'/** Interface kept for step components that import it. */export interface OnboardingStepComponentType<P = object> extends React.FC<P> {@@ -68,9 +72,14 @@ export interface onboardingLogicValues {currentStepProductKey: ProductKey | nullflow: OnboardingStepDescriptor[]flowIndex: number+ flowUrl: string+ flowVariant: OnboardingFlowVarianthasNextStep: booleanhasPreviousStep: boolean+ installStepReturnUrl: stringisCompleting: boolean+ isOnSimpleFlowArm: boolean+ isSkippingOnboarding: booleanonCompleteOnboardingRedirectUrl: stringonCompleteOnboardingRedirectUrlOverride: string | nullonboardingStepKeys: OnboardingStepKey[]@@ -94,6 +103,13 @@ export interface onboardingLogicActions {billing: BillingType | nullpayload?: any} // billingLogic+ setFeatureFlags: (+ flags: string[],+ variants: Record<string, boolean | string>+ ) => {+ flags: string[]+ variants: Record<string, boolean | string>+ } // featureFlagLogicopenGlobalSetup: () => {value: true} // globalSetupLogic@@ -121,6 +137,9 @@ export interface onboardingLogicActions {completeOnboarding: (options?: { redirectUrlOverride?: string }) => {redirectUrlOverride: string | undefined}+ enterSimpleFlowIfOnArm: () => {+ value: true+ }goToNextStep: () => {value: true}@@ -133,9 +152,15 @@ export interface onboardingLogicActions {resetOnboardingFlowState: () => {value: true}+ setFlowVariant: (flowVariant: OnboardingFlowVariant) => {+ flowVariant: OnboardingFlowVariant+ }setIsCompleting: (isCompleting: boolean) => {isCompleting: boolean}+ setIsSkippingOnboarding: (isSkippingOnboarding: boolean) => {+ isSkippingOnboarding: boolean+ }setOnCompleteOnboardingRedirectUrl: (url: string | null) => {url: string | null}@@ -163,11 +188,15 @@ export interface onboardingLogicActions {skipOnboarding: () => {value: true}+ skipSimpleOnboarding: () => {+ value: true+ }}// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface onboardingLogicMeta {__keaTypeGenInternalSelectorTypes: {+ isOnSimpleFlowArm: (featureFlags: FeatureFlagsSet) => booleancanInviteTeammates: (currentOrganization: OrganizationType | null, user: UserType | null) => booleanbillingProduct: (billing: BillingType | null, productKey: ProductKey | null) => BillingProductV2Type | nullshouldShowBillingStep: (@@ -178,6 +207,7 @@ export interface onboardingLogicMeta {stepId: string) => booleanflow: (+ flowVariant: OnboardingFlowVariant,productKey: ProductKey | null,secondaryProductKeys: ProductKey[],currentTeam: TeamPublicType | TeamType | null,@@ -205,7 +235,14 @@ export interface onboardingLogicMeta {currentFlowStep: OnboardingStepDescriptor | null,secondaryProductKeys: ProductKey[]) => Breadcrumb[]+ flowUrl: (flowVariant: OnboardingFlowVariant, productKey: ProductKey | null) => string+ installStepReturnUrl: (+ flowVariant: OnboardingFlowVariant,+ flowUrl: string,+ currentStepProductKey: ProductKey | null+ ) => stringonCompleteOnboardingRedirectUrl: (+ flowVariant: OnboardingFlowVariant,productKey: ProductKey | null,onCompleteOnboardingRedirectUrlOverride: string | null) => string@@ -242,6 +279,8 @@ export const onboardingLogic = kea<onboardingLogicType>([actions: [billingLogic,['loadBillingSuccess'],+ featureFlagLogic,+ ['setFeatureFlags'],teamLogic,['updateCurrentTeam', 'updateCurrentTeamSuccess', 'recordProductIntentOnboardingComplete'],sidePanelStateLogic,@@ -271,6 +310,10 @@ export const onboardingLogic = kea<onboardingLogicType>([// selection page) should not trigger the invalid-key redirect-to-home path.clearProductKey: true,setIsCompleting: (isCompleting: boolean) => ({ isCompleting }),+ setFlowVariant: (flowVariant: OnboardingFlowVariant) => ({ flowVariant }),+ skipSimpleOnboarding: true,+ enterSimpleFlowIfOnArm: true,+ setIsSkippingOnboarding: (isSkippingOnboarding: boolean) => ({ isSkippingOnboarding }),}),reducers(() => ({// True between dispatching `completeOnboarding` and the resulting team PATCH@@ -283,6 +326,18 @@ export const onboardingLogic = kea<onboardingLogicType>([resetOnboardingFlowState: () => false,},],+ flowVariant: [+ 'default' as OnboardingFlowVariant,+ {+ setFlowVariant: (_, { flowVariant }) => flowVariant,+ },+ ],+ isSkippingOnboarding: [+ false,+ {+ setIsSkippingOnboarding: (_, { isSkippingOnboarding }) => isSkippingOnboarding,+ },+ ],productKey: [null as ProductKey | null,{@@ -348,6 +403,10 @@ export const onboardingLogic = kea<onboardingLogicType>([],})),selectors({+ isOnSimpleFlowArm: [+ (s) => [s.featureFlags],+ (featureFlags: FeatureFlagsSet): boolean => isOnSimpleOnboardingArm(featureFlags),+ ],canInviteTeammates: [(s) => [s.currentOrganization, s.user],(@@ -393,6 +452,7 @@ export const onboardingLogic = kea<onboardingLogicType>([// microseconds and React's reconciler keeps the rendered subtree stable as// long as `currentFlowStep.id` is unchanged.(s) => [+ s.flowVariant,s.productKey,s.secondaryProductKeys,s.currentTeam,@@ -405,6 +465,7 @@ export const onboardingLogic = kea<onboardingLogicType>([s.featureFlags,],(+ flowVariant: OnboardingFlowVariant,primary: ProductKey | null,secondaries: ProductKey[],currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,@@ -419,6 +480,9 @@ export const onboardingLogic = kea<onboardingLogicType>([if (!primary) {return []}+ if (flowVariant === 'simple') {+ return buildSimpleOnboardingFlow(billingProduct, shouldShowBilling, canInviteTeammates)+ }const orderedProducts: ProductKey[] = [primary, ...secondaries]const baseCtx: Omit<OnboardingFlowContext, 'role'> = {primary,@@ -613,12 +677,43 @@ export const onboardingLogic = kea<onboardingLogicType>([]},],+ // The flow's path without a query. Step changes and OAuth round trips build on it.+ flowUrl: [+ (s) => [s.flowVariant, s.productKey],+ (flowVariant: OnboardingFlowVariant, productKey: ProductKey | null): string =>+ flowVariant === 'simple'+ ? urls.simpleOnboarding()+ : urls.onboarding({ productKey: productKey ?? undefined }),+ ],+ // Where an OAuth round trip started from the install step returns to, so the user lands back in+ // the same flow instead of the default per-product one.+ installStepReturnUrl: [+ (s) => [s.flowVariant, s.flowUrl, s.currentStepProductKey],+ (flowVariant: OnboardingFlowVariant, flowUrl: string, currentStepProductKey: ProductKey | null): string => {+ if (flowVariant === 'simple') {+ return combineUrl(flowUrl, {+ step: `${OnboardingStepKey.INSTALL}:${SIMPLE_ONBOARDING_PRODUCT_KEY}`,+ }).url+ }+ return urls.onboarding({+ productKey: currentStepProductKey ?? undefined,+ stepKey: OnboardingStepKey.INSTALL,+ })+ },+ ],onCompleteOnboardingRedirectUrl: [- (s) => [s.productKey, s.onCompleteOnboardingRedirectUrlOverride],- (productKey: ProductKey | null, onCompleteOnboardingRedirectUrlOverride: string | null): string => {+ (s) => [s.flowVariant, s.productKey, s.onCompleteOnboardingRedirectUrlOverride],+ (+ flowVariant: OnboardingFlowVariant,+ productKey: ProductKey | null,+ onCompleteOnboardingRedirectUrlOverride: string | null+ ): string => {if (onCompleteOnboardingRedirectUrlOverride) {return onCompleteOnboardingRedirectUrlOverride}+ if (flowVariant === 'simple') {+ return urls.onboardingWelcome()+ }if (!productKey) {return urls.default()}@@ -705,7 +800,7 @@ export const onboardingLogic = kea<onboardingLogicType>([// changing dashboards. Secondary products are still recorded via// `recordProductIntentOnboardingComplete` and `has_completed_onboarding_for`,// but don't fire an additional `onboarding completed` analytics event.- reportOnboardingCompleted(primary)+ reportOnboardingCompleted(primary, values.flowVariant)props.onCompleteOnboarding?.(primary)// Error Tracking has a side-effect tied to onboarding completion (set up in the// legacy view): turn on autocapture_exceptions_opt_in. Preserved here.@@ -785,6 +880,42 @@ export const onboardingLogic = kea<onboardingLogicType>([lemonToast.error("Couldn't save onboarding progress. Please try again.")}},+ skipSimpleOnboarding: async () => {+ if (values.isSkippingOnboarding) {+ return+ }+ actions.setIsSkippingOnboarding(true)+ const stepAtSkip = values.currentStepKey ?? ''+ try {+ await usersOnboardingSkipCreate('@me', {+ reason: 'later',+ step_at_skip: stepAtSkip,+ flow_variant: 'simple',+ })+ // Load the user before navigating: sceneLogic reads the skip from it, and a stale+ // user sends the redirect straight back to onboarding.+ await userLogic.asyncActions.loadUser()+ router.actions.push(values.onCompleteOnboardingRedirectUrl)+ } catch {+ lemonToast.error("Couldn't skip onboarding. Please try again.")+ } finally {+ actions.setIsSkippingOnboarding(false)+ }+ },+ enterSimpleFlowIfOnArm: () => {+ if (!values.isOnSimpleFlowArm) {+ return+ }+ reportOnboardingStarted('simple')+ router.actions.replace(urls.simpleOnboarding(), router.values.searchParams)+ },+ setFeatureFlags: () => {+ // Flags can land after product selection rendered, so the arm is decided again here.+ // Only on bare `/onboarding`: reading the flag elsewhere would log an exposure.+ if (removeProjectIdIfPresent(router.values.location.pathname) === urls.onboarding()) {+ actions.enterSimpleFlowIfOnArm()+ }+ },skipOnboarding: () => {// Quick Start does not auto-open here. The button remains in the scene title// bar so users can open it manually. Auto-opening it conflicted with the welcome@@ -942,7 +1073,7 @@ export const onboardingLogic = kea<onboardingLogicType>([// string concatenation (`path + '?' + search`), so a query embedded here would get a// second `?` appended for `passthrough` — parsed back, the extra params fuse into the// step value (`step=configure:x?integration_id=14`) and the step never resolves.- const url = urls.onboarding({ productKey: values.productKey ?? undefined })+ const url = values.flowUrlconst searchParams: Record<string, any> = {...passthrough,...(stepResolves && stepId ? { step: stepId } : {}),@@ -965,30 +1096,35 @@ export const onboardingLogic = kea<onboardingLogicType>([}},})),- urlToAction(({ actions, values }) => ({- '/onboarding/:productKey': ({ productKey }, params: Record<string, unknown>) => {- if (!productKey || !Object.hasOwn(availableOnboardingProducts, productKey)) {- return- }-+ urlToAction(({ actions, values }) => {+ const applyFlowUrl = (+ flowVariant: OnboardingFlowVariant,+ productKey: ProductKey,+ params: Record<string, unknown>+ ): void => {const success = params.successconst upgraded = params.upgradedconst step = params.stepconst withRaw = params.with+ if (flowVariant !== values.flowVariant) {+ actions.setFlowVariant(flowVariant)+ }+// Order matters: `setProductKey` may dispatch `resetOnboardingFlowState`// (which resets `subscribedDuringOnboarding` to false) when transitioning// between products. Set the product first, THEN apply the post-payment// subscription flag, so the reset doesn't clobber it.if (productKey !== values.productKey) {- actions.setProductKey(productKey as ProductKey)+ actions.setProductKey(productKey)}if (success || upgraded) {actions.setSubscribedDuringOnboarding(true)}- const parsedSecondaries = parseProductsParam(withRaw).filter((k) => k !== productKey)+ const parsedSecondaries =+ flowVariant === 'simple' ? [] : parseProductsParam(withRaw).filter((k) => k !== productKey)// Skip the dispatch when nothing changed — kea reducers compare by reference,// so re-emitting an identical-but-fresh array still triggers downstream// selector recomputes (notably `flow`, which is the most expensive selector@@ -1010,16 +1146,38 @@ export const onboardingLogic = kea<onboardingLogicType>([if (stepValue !== values.stepId) {actions.setStepId(stepValue)}- },- '/onboarding': () => {- // Land on the product-selection page. We can't dispatch `setProductKey(null)`- // because that listener treats null as "invalid product" and hard-redirects- // to the home page — preventing users from returning here from inside an- // existing flow.- if (values.productKey !== null) {- actions.clearProductKey()- }- actions.resetOnboardingFlowState()- },- })),+ }++ return {+ // Declared before `/onboarding/:productKey`: kea-router runs the first route that matches.+ [urls.simpleOnboarding()]: (_, params: Record<string, unknown>) => {+ applyFlowUrl('simple', SIMPLE_ONBOARDING_PRODUCT_KEY, params)+ // Mirrors product selection: the page the user signed up to reach beats the welcome page.+ const nextUrl = getRelativeNextPath(typeof params.next === 'string' ? params.next : null, location)+ if (nextUrl && nextUrl !== '/' && nextUrl !== values.onCompleteOnboardingRedirectUrlOverride) {+ actions.setOnCompleteOnboardingRedirectUrl(nextUrl)+ }+ },+ '/onboarding/:productKey': ({ productKey }, params: Record<string, unknown>) => {+ if (!productKey || !Object.hasOwn(availableOnboardingProducts, productKey)) {+ return+ }+ applyFlowUrl('default', productKey as ProductKey, params)+ },+ '/onboarding': () => {+ // Land on the product-selection page. We can't dispatch `setProductKey(null)`+ // because that listener treats null as "invalid product" and hard-redirects+ // to the home page — preventing users from returning here from inside an+ // existing flow.+ if (values.flowVariant !== 'default') {+ actions.setFlowVariant('default')+ }+ if (values.productKey !== null) {+ actions.clearProductKey()+ }+ actions.resetOnboardingFlowState()+ actions.enterSimpleFlowIfOnArm()+ },+ }+ }),])diff --git a/frontend/src/scenes/onboarding/onboardingUsage.test.ts b/frontend/src/scenes/onboarding/onboardingUsage.test.tsindex a4e74523bbc9..999e92f0ce6a 100644--- a/frontend/src/scenes/onboarding/onboardingUsage.test.ts+++ b/frontend/src/scenes/onboarding/onboardingUsage.test.ts@@ -8,21 +8,24 @@ import {reportOnboardingStepCompleted,reportOnboardingStepSkipped,} from './onboardingUsage'+import type { OnboardingFlowVariant } from './types'describe('onboardingUsage', () => {afterEach(() => {jest.restoreAllMocks()})- it('keeps the funnel event properties', () => {+ it.each<[OnboardingFlowVariant, Record<string, unknown>]>([+ ['default', { entry_point: 'product_selection', flow_variant: 'legacy', version: 1 }],+ ['simple', { entry_point: 'simple_onboarding', flow_variant: 'simple', version: 1 }],+ ])('keeps the %s flow funnel event properties', (flowVariant, sharedProperties) => {const capture = jest.spyOn(posthog, 'capture').mockImplementation()- reportOnboardingStarted()- reportOnboardingStepCompleted(OnboardingStepKey.INSTALL)- reportOnboardingStepSkipped(OnboardingStepKey.INSTALL)- reportOnboardingCompleted('product_analytics')+ reportOnboardingStarted(flowVariant)+ reportOnboardingStepCompleted(OnboardingStepKey.INSTALL, flowVariant)+ reportOnboardingStepSkipped(OnboardingStepKey.INSTALL, flowVariant)+ reportOnboardingCompleted('product_analytics', flowVariant)- const sharedProperties = { entry_point: 'product_selection', flow_variant: 'legacy', version: 1 }expect(capture).toHaveBeenNthCalledWith(1, 'onboarding started', sharedProperties)expect(capture).toHaveBeenNthCalledWith(2, 'onboarding step completed', {step_key: 'install',diff --git a/frontend/src/scenes/onboarding/onboardingUsage.ts b/frontend/src/scenes/onboarding/onboardingUsage.tsindex 302c5c16b10c..a183b48547af 100644--- a/frontend/src/scenes/onboarding/onboardingUsage.ts+++ b/frontend/src/scenes/onboarding/onboardingUsage.ts@@ -2,40 +2,56 @@ import posthog from 'posthog-js'import type { OnboardingStepKey } from '~/types'+import type { OnboardingFlowVariant } from './types'+// pinned: event property values. Onboarding funnel insights filter and break down on these, so-// they keep the values the flow sent while it was one of two experiment arms. `entry_point` rides-// along with every funnel event, not only `started`, so a breakdown by it stays populated.+// the default flow keeps the values it sent while it was one of two experiment arms. `entry_point`+// rides along with every funnel event, not only `started`, so a breakdown by it stays populated.export const ONBOARDING_EVENT_PROPS = {version: 1,flow_variant: 'legacy',entry_point: 'product_selection',} as const-export function reportOnboardingStarted(): void {- posthog.capture('onboarding started', ONBOARDING_EVENT_PROPS)+const EVENT_PROPS: Record<OnboardingFlowVariant, Record<string, string | number>> = {+ default: ONBOARDING_EVENT_PROPS,+ // pinned: event property values, see ONBOARDING_EVENT_PROPS.+ simple: { version: 1, flow_variant: 'simple', entry_point: 'simple_onboarding' },+}++export function reportOnboardingStarted(flowVariant: OnboardingFlowVariant): void {+ posthog.capture('onboarding started', EVENT_PROPS[flowVariant])}-export function reportOnboardingCompleted(productKey: string): void {+export function reportOnboardingCompleted(productKey: string, flowVariant: OnboardingFlowVariant): void {posthog.capture('onboarding completed', {product_key: productKey,- ...ONBOARDING_EVENT_PROPS,+ ...EVENT_PROPS[flowVariant],})}-export function reportOnboardingStepCompleted(stepKey: OnboardingStepKey, productKey?: string): void {+export function reportOnboardingStepCompleted(+ stepKey: OnboardingStepKey,+ flowVariant: OnboardingFlowVariant,+ productKey?: string+): void {posthog.capture('onboarding step completed', {step_key: stepKey,// Optional — only set when the caller knows which product owns the step.// Lets dashboards split step funnels by product without joining elsewhere....(productKey ? { product_key: productKey } : {}),- ...ONBOARDING_EVENT_PROPS,+ ...EVENT_PROPS[flowVariant],})}-export function reportOnboardingStepSkipped(stepKey: OnboardingStepKey, productKey?: string): void {+export function reportOnboardingStepSkipped(+ stepKey: OnboardingStepKey,+ flowVariant: OnboardingFlowVariant,+ productKey?: string+): void {posthog.capture('onboarding step skipped', {step_key: stepKey,...(productKey ? { product_key: productKey } : {}),- ...ONBOARDING_EVENT_PROPS,+ ...EVENT_PROPS[flowVariant],})}diff --git a/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.ts b/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.tsindex 9a439cf22afe..de09a11b4e86 100644--- a/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.ts+++ b/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.ts@@ -2,17 +2,20 @@ import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reduimport { router } from 'kea-router'import posthog from 'posthog-js'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { getRelativeNextPath } from 'lib/utils/url'import { onboardingLogic } from 'scenes/onboarding/onboardingLogic'import { ONBOARDING_EVENT_PROPS, reportOnboardingStarted } from 'scenes/onboarding/onboardingUsage'import { USE_CASE_OPTIONS, UseCaseOption, getRecommendedProducts } from 'scenes/onboarding/productRecommendations'import { availableOnboardingProducts } from 'scenes/onboarding/shared/utils'+import { isOnSimpleOnboardingArm } from 'scenes/onboarding/simple/simpleOnboardingArm'import { teamLogic } from 'scenes/teamLogic'import { urls } from 'scenes/urls'import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'import { OnboardingStepKey } from '~/types'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'import type { ProductIntentProperties } from '../../../lib/utils/product-intents'import type { TeamPublicType, TeamType } from '../../../types'import type { UseCaseDefinition } from '../productRecommendations'@@ -43,6 +46,8 @@ export type RecommendationSource = 'use_case' | 'browsing_history' | 'manual' |// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface productSelectionLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ receivedFeatureFlags: boolean // featureFlagLogiccurrentTeam: TeamPublicType | TeamType | null // teamLogicbrowsingHistory: string[]browsingHistoryLabels: string[]@@ -64,6 +69,13 @@ export interface productSelectionLogicValues {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface productSelectionLogicActions {+ setFeatureFlags: (+ flags: string[],+ variants: Record<string, boolean | string>+ ) => {+ flags: string[]+ variants: Record<string, boolean | string>+ } // featureFlagLogicsetOnCompleteOnboardingRedirectUrl: (url: string | null) => {url: string | null} // onboardingLogic@@ -74,6 +86,9 @@ export interface productSelectionLogicActions {handleStartOnboarding: () => {value: true}+ reportStarted: () => {+ value: true+ }selectPickMyself: () => {value: true}@@ -135,11 +150,19 @@ export const productSelectionLogic = kea<productSelectionLogicType>([path(['scenes', 'onboarding', 'productSelection', 'productSelectionLogic']),connect(() => ({- actions: [teamLogic, ['addProductIntent'], onboardingLogic, ['setOnCompleteOnboardingRedirectUrl']],- values: [teamLogic, ['currentTeam']],+ actions: [+ featureFlagLogic,+ ['setFeatureFlags'],+ teamLogic,+ ['addProductIntent'],+ onboardingLogic,+ ['setOnCompleteOnboardingRedirectUrl'],+ ],+ values: [featureFlagLogic, ['featureFlags', 'receivedFeatureFlags'], teamLogic, ['currentTeam']],})),actions({+ reportStarted: true,// Step navigationsetStep: (step: OnboardingStep) => ({ step }),@@ -299,7 +322,18 @@ export const productSelectionLogic = kea<productSelectionLogicType>([],}),- listeners(({ actions, values }) => ({+ listeners(({ actions, values, cache }) => ({+ // Waits for flags: a late flag can still move the user to the simple arm, which reports its own start.+ reportStarted: () => {+ if (cache.reportedStarted || !values.receivedFeatureFlags || isOnSimpleOnboardingArm(values.featureFlags)) {+ return+ }+ cache.reportedStarted = true+ reportOnboardingStarted('default')+ },+ setFeatureFlags: () => {+ actions.reportStarted()+ },selectPickMyself: () => {const hasBrowsingHistory = values.hasBrowsingHistoryactions.setRecommendationSource(hasBrowsingHistory ? 'browsing_history' : 'manual')@@ -431,6 +465,6 @@ export const productSelectionLogic = kea<productSelectionLogicType>([}}- reportOnboardingStarted()+ actions.reportStarted()}),])diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/NextButton.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/NextButton.tsxindex 61f108bcd62c..cfe44e0594e6 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/NextButton.tsx+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/NextButton.tsx@@ -15,17 +15,17 @@ interface NextButtonProps {}export const NextButton = ({ installationComplete, size = 'medium' }: NextButtonProps): JSX.Element => {- const { hasNextStep, currentStepProductKey } = useValues(onboardingLogic)+ const { hasNextStep, currentStepProductKey, flowVariant } = useValues(onboardingLogic)const { completeOnboarding, goToNextStep } = useActions(onboardingLogic)const advance = !hasNextStep ? completeOnboarding : goToNextStepconst skipInstallation = (): void => {- reportOnboardingStepSkipped(OnboardingStepKey.INSTALL, currentStepProductKey ?? undefined)+ reportOnboardingStepSkipped(OnboardingStepKey.INSTALL, flowVariant, currentStepProductKey ?? undefined)advance()}const continueInstallation = (): void => {- reportOnboardingStepCompleted(OnboardingStepKey.INSTALL, currentStepProductKey ?? undefined)+ reportOnboardingStepCompleted(OnboardingStepKey.INSTALL, flowVariant, currentStepProductKey ?? undefined)advance()}diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallStep.stories.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallStep.stories.tsxindex 78ca65030972..8c51326281ce 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallStep.stories.tsx+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallStep.stories.tsx@@ -126,11 +126,13 @@ function installStepStory({drive,waitForSelector,play,+ simple = false,}: {featureFlags?: Record<string, string | boolean>drive?: () => voidwaitForSelector: stringplay?: () => Promise<void>+ simple?: boolean}): Story {return {render: () => {@@ -143,6 +145,12 @@ function installStepStory({// over from an earlier story in the same browser session before driving this one.activeCloudRunLogic.actions.clearActiveCloudRun()drive?.()+ if (simple) {+ router.actions.push(urls.simpleOnboarding(), {+ step: `${OnboardingStepKey.INSTALL}:${ProductKey.PRODUCT_ANALYTICS}`,+ })+ return+ }setProduct(availableOnboardingProducts[ProductKey.PRODUCT_ANALYTICS])router.actions.push(urls.onboarding({ productKey: ProductKey.PRODUCT_ANALYTICS, stepKey: OnboardingStepKey.INSTALL })@@ -171,26 +179,51 @@ export const TestArm: Story = installStepStory({waitForSelector: '[data-attr="wizard-cloud-run-open-pr"]',})+const startCloudRun = (): void =>+ activeCloudRunLogic.actions.setActiveCloudRun('task-1', 'run-1', new Date().toISOString(), MOCK_TEAM_ID)++// The panel mounts in the 'connecting' phase; hold the snapshot until the mocked stream's pipeline+// steps have rendered so it captures the mid-run timeline, not the placeholder.+const waitForPipelineTimeline = async (): Promise<void> => {+ await waitFor(+ () => {+ const timeline = document.querySelector('[data-attr="installation-progress"]')+ if (!timeline?.textContent?.includes('Running setup wizard')) {+ throw new Error('pipeline timeline not ready')+ }+ },+ { timeout: 8000, interval: 200 }+ )+}+/*** A cloud run underway: the step pins to the run's live pipeline (fed by the mocked task-run* stream), the local tab is blocked, and Continue is unblocked.*/export const CloudRunInProgress: Story = installStepStory({featureFlags: { [FEATURE_FLAGS.ONBOARDING_WIZARD_CLOUD_RUN]: 'test' },- drive: () =>- activeCloudRunLogic.actions.setActiveCloudRun('task-1', 'run-1', new Date().toISOString(), MOCK_TEAM_ID),+ drive: startCloudRun,waitForSelector: '[data-attr="installation-progress"]',- play: async () => {- // The panel mounts in the 'connecting' phase; hold the snapshot until the mocked stream's- // pipeline steps have rendered so it captures the mid-run timeline, not the placeholder.- await waitFor(- () => {- const timeline = document.querySelector('[data-attr="installation-progress"]')- if (!timeline?.textContent?.includes('Running setup wizard')) {- throw new Error('pipeline timeline not ready')- }- },- { timeout: 8000, interval: 200 }- )- },+ play: waitForPipelineTimeline,+})++const SIMPLE_FLOW_CLOUD_FLAGS = {+ [FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW]: 'test',+ [FEATURE_FLAGS.ONBOARDING_WIZARD_CLOUD_RUN]: 'test',+}++/** The simple flow's compact install step on the cloud arm, with GitHub connected. */+export const SimpleFlowCloudArm: Story = installStepStory({+ simple: true,+ featureFlags: SIMPLE_FLOW_CLOUD_FLAGS,+ waitForSelector: '[data-attr="wizard-cloud-run-open-pr"]',+})++/** A cloud run underway in the simple flow: the compact step pins to the run's live pipeline. */+export const SimpleFlowCloudRunInProgress: Story = installStepStory({+ simple: true,+ featureFlags: SIMPLE_FLOW_CLOUD_FLAGS,+ drive: startCloudRun,+ waitForSelector: '[data-attr="installation-progress"]',+ play: waitForPipelineTimeline,})diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/index.tsxindex 95436ae8e0ef..7fbe83e43fc0 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx@@ -1,6 +1,6 @@import { useActions, useValues } from 'kea'-import { LemonButton, LemonModal } from '@posthog/lemon-ui'+import { LemonButton, LemonModal, Link } from '@posthog/lemon-ui'import { OnboardingStepKey, type SDK } from '~/types'@@ -10,8 +10,9 @@ import { activeCloudRunLogic } from '../../../shared/wizard-sync/activeCloudRunLimport { useLocalWizardRunActive } from '../../../shared/wizard-sync/hooks'import { InstallationProgressView } from '../../../shared/wizard-sync/InstallationProgressView'import { WizardCommandBlock } from '../../../shared/wizard-sync/WizardCommandBlock'+import { WizardFrameworkIcons } from '../../../shared/wizard-sync/WizardFrameworkIcons'import { WizardInstallOptions } from '../../../shared/wizard-sync/WizardInstallOptions'-import { WizardFrameworkBadges } from '../../../shared/wizard-sync/WizardModeShell'+import { WizardFrameworkBadges, WizardModeShell } from '../../../shared/wizard-sync/WizardModeShell'import { AdblockWarning, RealtimeCheckIndicator } from '../../RealtimeCheckIndicator'import { SDKGrid } from '../SDKGrid'import { SDKInstructionsModal } from '../SDKInstructionsModal'@@ -22,7 +23,13 @@ import { WizardInstallIntro } from './WizardInstallIntro'// The shared cloud/local switcher wrapped with onboarding's own command block and instrumentation.// An active cloud run renders inside it (WizardCloudRunBlock pins to the run's progress), so the// failed-run "Run it yourself" fallback keeps working — the mode state must not unmount mid-recovery.-function OnboardingInstallOptions({ wizardOverrides }: { wizardOverrides?: WizardOverrides }): JSX.Element {+function OnboardingInstallOptions({+ wizardOverrides,+ compact = false,+}: {+ wizardOverrides?: WizardOverrides+ compact?: boolean+}): JSX.Element {const { reportOnboardingInstallModeSelected } = useActions(onboardingEventUsageLogic)return (<WizardInstallOptions@@ -31,11 +38,22 @@ function OnboardingInstallOptions({ wizardOverrides }: { wizardOverrides?: Wizar// so a dedicated-program step neither offers a run nor lets one queued elsewhere take over.offerCloudRun={!wizardOverrides}ignoreActiveCloudRun={!!wizardOverrides}- badges={wizardOverrides?.supports ? <WizardFrameworkBadges items={wizardOverrides.supports} /> : undefined}+ hog={compact ? null : undefined}+ badges={+ wizardOverrides?.supports ? (+ <WizardFrameworkBadges items={wizardOverrides.supports} />+ ) : compact ? (+ <WizardFrameworkIcons />+ ) : undefined+ }localBlock={<WizardCommandBlocksubcommand={wizardOverrides?.subcommand}- description={wizardOverrides?.description}+ description={+ wizardOverrides?.description ??+ (compact ? 'Run this in your project folder. No API key needed.' : undefined)+ }+ hog={compact ? null : undefined}/>}/>@@ -56,6 +74,7 @@ function OnboardingInstallOptions({ wizardOverrides }: { wizardOverrides?: Wizar*/export function WizardInstallStep(props: VariantProps): JSX.Element {const isLocalRunActive = useLocalWizardRunActive()+ const { setManualModalOpen } = useActions(wizardInstallStepLogic)// Deliberately not gated on the cloud-run flag: a persisted handle is proof the user started a// run while on the test arm, and a mid-experiment flag change must not strand an in-flight run.// A dedicated-program step ignores it, because the run only executes the base program.@@ -65,23 +84,41 @@ export function WizardInstallStep(props: VariantProps): JSX.Element {// to unblock Continue.const continueDisabledReason =isLocalRunActive || activeCloudRun || props.installationComplete ? undefined : 'Installation is not complete'+ // A cloud run wins over the local run view: the cloud wizard posts to the same session stream, so+ // rendering both would show the same run twice. The cloud run's progress renders inside+ // OnboardingInstallOptions (WizardCloudRunBlock pins to it).+ const runView = activeCloudRun ? (+ <OnboardingInstallOptions wizardOverrides={props.wizardOverrides} compact={props.compact} />+ ) : isLocalRunActive ? (+ <InstallationProgressView mode="local" />+ ) : nullreturn (<WizardInstallShellcontinueDisabledReason={continueDisabledReason}showSkip={!props.installationComplete && !isLocalRunActive && !activeCloudRun}props={props}>- {/* A cloud run wins over the local run view: the cloud wizard posts to the same session- stream, so rendering both would show the same run twice. The cloud run's progress- renders inside OnboardingInstallOptions (WizardCloudRunBlock pins to it). */}- {activeCloudRun ? (- <div className="max-w-xl mx-auto">- <OnboardingInstallOptions wizardOverrides={props.wizardOverrides} />- </div>- ) : isLocalRunActive ? (- <div className="max-w-xl mx-auto">- <InstallationProgressView mode="local" />- </div>+ {props.compact ? (+ <WizardModeShell data-attr="wizard-install-compact">+ {runView ?? (+ <>+ <p className="text-muted mb-0">+ {props.wizardOverrides?.intro ??+ 'Wizard is a setup agent. It detects your framework, installs the SDK, and adds your project token to your environment variables.'}+ </p>+ <OnboardingInstallOptions wizardOverrides={props.wizardOverrides} compact />+ </>+ )}+ <Link+ className="self-start text-sm"+ data-attr="sdk-continue"+ onClick={() => setManualModalOpen(true)}+ >+ Want to set up manually?+ </Link>+ </WizardModeShell>+ ) : runView ? (+ <div className="max-w-xl mx-auto">{runView}</div>) : (<><WizardInstallIntro description={props.wizardOverrides?.intro} />@@ -144,16 +181,19 @@ function WizardInstallShell({{!installationComplete && <AdblockWarning adblockResult={adblockResult} />}<div className="mt-6 space-y-8">{children}- <div className="text-center">- <LemonButton- type="tertiary"- size="small"- data-attr="sdk-continue"- onClick={() => setManualModalOpen(true)}- >- Need to set up manually?- </LemonButton>- </div>+ {/* The compact layout puts this link in the Wizard column instead. */}+ {!props.compact && (+ <div className="flex justify-center">+ <LemonButton+ type="tertiary"+ size="small"+ data-attr="sdk-continue"+ onClick={() => setManualModalOpen(true)}+ >+ Need to set up manually?+ </LemonButton>+ </div>+ )}</div><LemonModaldiff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsxindex af8a5581f336..c105081fdce3 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsx+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsx@@ -33,6 +33,7 @@ interface OnboardingInstallStepProps {hideInstallationCheck?: booleanheader?: React.ReactNodewizardOverrides?: WizardOverrides+ compact?: boolean}/**@@ -48,6 +49,7 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstalhideInstallationCheck = false,header,wizardOverrides,+ compact = false,}) => {const {setAvailableSDKInstructionsMap,@@ -161,6 +163,7 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstalwizardOverrides,installTitle,installSubtitle,+ compact,}const instructionsModal = selectedSDK && (diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/types.ts b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/types.tsindex 6053d89f1784..9c42b173f336 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/types.ts+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/types.ts@@ -42,4 +42,5 @@ export interface VariantProps {/** Step heading, e.g. "Install AI observability"; a lone install step stays a generic "Install". */installTitle: stringinstallSubtitle?: string+ compact?: boolean}diff --git a/frontend/src/scenes/onboarding/shared/ProjectTokenSnippet.tsx b/frontend/src/scenes/onboarding/shared/ProjectTokenSnippet.tsxnew file mode 100644index 000000000000..53da8a264603--- /dev/null+++ b/frontend/src/scenes/onboarding/shared/ProjectTokenSnippet.tsx@@ -0,0 +1,26 @@+import { useValues } from 'kea'++import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'+import { teamLogic } from 'scenes/teamLogic'++export function ProjectTokenSnippet(): JSX.Element | null {+ const { currentTeam } = useValues(teamLogic)++ if (!currentTeam?.api_token) {+ return null+ }++ return (+ <div className="flex items-center gap-1.5 min-w-0 text-xs" data-attr="onboarding-project-token">+ <span className="text-secondary shrink-0">Project token</span>+ <CopyToClipboardInline+ description="project token"+ iconSize="xsmall"+ tooltipMessage="Your SDKs send events to this project with it. It's safe to use in public apps. Click to copy."+ className="font-mono text-secondary min-w-0 bg-surface-secondary border border-primary rounded px-1.5 py-0.5"+ >+ {currentTeam.api_token}+ </CopyToClipboardInline>+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsxindex 703c91925f78..2e2f197ff898 100644--- a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsx+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsx@@ -11,7 +11,7 @@ import { useWizardCommand } from 'scenes/onboarding/shared/useWizardCommand'import { activeCloudRunLogic } from './activeCloudRunLogic'import { InstallationProgressView } from './InstallationProgressView'import { wizardCloudRunLogic } from './wizardCloudRunLogic'-import { WizardModeShell } from './WizardModeShell'+import { WizardModeShell, type WizardShellHog } from './WizardModeShell'/*** The primary, "we'll do it for you" way to run the wizard: connect GitHub, pick a@@ -25,11 +25,11 @@ import { WizardModeShell } from './WizardModeShell'*/export function WizardCloudRunBlock({onQueued,- hideHog = false,+ hog,onRetryLocally,}: {onQueued?: () => void- hideHog?: boolean+ hog?: WizardShellHog/** Forwarded to the install progress view so a failed run can offer "Run it yourself". */onRetryLocally?: () => void}): JSX.Element {@@ -94,7 +94,7 @@ export function WizardCloudRunBlock({}return (- <WizardModeShell hideHog={hideHog} data-attr="wizard-cloud-run-block">+ <WizardModeShell hog={hog} data-attr="wizard-cloud-run-block"><p className="text-sm text-muted mb-0">We'll run the wizard against your repo and open a pull request with the SDK installed and eventsflowing. Review it and merge whenever you're ready.@@ -107,7 +107,7 @@ export function WizardCloudRunBlock({to={connectGitHubUrl}disableClientSideRoutingdata-attr="wizard-cloud-run-connect-github"- className={hideHog ? 'self-center' : 'self-start'}+ className="self-start"onClick={() => reportIntegrationConnectClicked('github', 'github', 'onboarding_wizard')}>Connect GitHubdiff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCommandBlock.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCommandBlock.tsxindex 8e2ae4ed2325..76c2ca576944 100644--- a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCommandBlock.tsx+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCommandBlock.tsx@@ -3,14 +3,14 @@ import { type ReactNode, useState } from 'react'import { CommandBlock } from 'lib/components/CommandBlock/CommandBlock'import { useWizardCommand } from 'scenes/onboarding/shared/useWizardCommand'-import { WizardModeShell } from './WizardModeShell'+import { WizardModeShell, type WizardShellHog } from './WizardModeShell'export function WizardCommandBlock({- hideHog = false,+ hog,subcommand,description,}: {- hideHog?: boolean+ hog?: WizardShellHog/** Wizard subcommand to run, e.g. `self-driving`. Omit for the plain SDK install. */subcommand?: string/** Replaces the default "what this does" line when the subcommand does something else. */@@ -27,7 +27,7 @@ export function WizardCommandBlock({}return (- <WizardModeShell hogCastKey={castKey} hideHog={hideHog} data-attr="wizard-command-block">+ <WizardModeShell hogCastKey={castKey} hog={hog} data-attr="wizard-command-block"><CommandBlockcommand={wizardCommand}copyLabel="Wizard command"diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardFrameworkIcons.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardFrameworkIcons.tsxnew file mode 100644index 000000000000..bcb1c10656ce--- /dev/null+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardFrameworkIcons.tsx@@ -0,0 +1,39 @@+import { Tooltip } from '@posthog/lemon-ui'++import { WIZARD_FRAMEWORKS, type WizardBadgeItem, WizardFrameworkIcon } from './WizardModeShell'++// A spread across web, backend and mobile reads as "works with my stack" better than the list's+// JS-heavy head.+const FEATURED_FRAMEWORKS = ['Next.js', 'React', 'Vue', 'Django', 'Laravel', 'Ruby on Rails', 'iOS', 'Android']++function FrameworkIcon({ item }: { item: WizardBadgeItem }): JSX.Element | null {+ if (!item.icon) {+ return null+ }+ return (+ <Tooltip title={item.name}>+ <span className="inline-flex" aria-label={item.name}>+ <WizardFrameworkIcon icon={item.icon} size="md" />+ </span>+ </Tooltip>+ )+}++export function WizardFrameworkIcons(): JSX.Element {+ const featured = WIZARD_FRAMEWORKS.filter((item) => FEATURED_FRAMEWORKS.includes(item.name))+ const rest = WIZARD_FRAMEWORKS.filter((item) => !FEATURED_FRAMEWORKS.includes(item.name))++ return (+ <div className="flex flex-wrap items-center gap-2 text-xs text-muted">+ <span>Works with</span>+ {featured.map((item) => (+ <FrameworkIcon key={item.name} item={item} />+ ))}+ {rest.length > 0 && (+ <Tooltip title={rest.map((item) => item.name).join(', ')}>+ <span className="underline decoration-dotted cursor-default">+{rest.length} more</span>+ </Tooltip>+ )}+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsxindex 30882238d93b..c9394840333c 100644--- a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsx+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsx@@ -9,15 +9,15 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { useWizardCommand } from '../useWizardCommand'import { activeCloudRunLogic } from './activeCloudRunLogic'import { WizardCloudRunBlock } from './WizardCloudRunBlock'-import { WizardFrameworkBadges } from './WizardModeShell'+import { WizardFrameworkBadges, type WizardShellHog } from './WizardModeShell'export type WizardInstallMode = 'cloud' | 'local'export interface WizardInstallOptionsProps {/** The local "run it yourself" arm. Callers supply their own command block. */localBlock: React.ReactNode- /** Keeps the compact onboarding card free of the wizard hedgehog. */- hideHog?: boolean+ /** Passed to the cloud run block; `null` keeps the compact onboarding card free of the hedgehog. */+ hog?: WizardShellHog/** Called when a cloud run is queued (e.g. advance or unblock the step). */onQueued?: () => void/** Instrumentation hook, fired when the user switches between cloud and local. */@@ -46,7 +46,7 @@ export interface WizardInstallOptionsProps {*/export function WizardInstallOptions({localBlock,- hideHog = false,+ hog,onQueued,onModeSelected,offerCloudRun = true,@@ -85,7 +85,7 @@ export function WizardInstallOptions({<div className="flex flex-col gap-4">{badges}{activeCloudRun ? (- <WizardCloudRunBlock hideHog={hideHog} onRetryLocally={runItYourself} onQueued={onQueued} />+ <WizardCloudRunBlock hog={hog} onRetryLocally={runItYourself} onQueued={onQueued} />) : (localBlock)}@@ -124,7 +124,7 @@ export function WizardInstallOptions({]}/>{effectiveMode === 'cloud' ? (- <WizardCloudRunBlock hideHog={hideHog} onRetryLocally={runItYourself} onQueued={onQueued} />+ <WizardCloudRunBlock hog={hog} onRetryLocally={runItYourself} onQueued={onQueued} />) : (localBlock)}diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsxindex d99a68ba62b2..cf846f6ad913 100644--- a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsx+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsx@@ -21,6 +21,9 @@ import { ReactRouterLogo } from '../logos/ReactRouterLogo'import svelteImage from '../logos/svelte.svg'import vueImage from '../logos/vue.svg'+/** The hedgehog beside the wizard's content; `null` drops it, e.g. when an outer shell already shows one. */+export type WizardShellHog = ComponentType<{ className?: string }> | null+/** One "Supports:" chip; icon-less items (e.g. "+ 30 more") render as text only. */export interface WizardBadgeItem {name: string@@ -28,7 +31,7 @@ export interface WizardBadgeItem {}// Frameworks the wizard can set up — the same whichever way it runs, so both modes show them.-const WIZARD_FRAMEWORKS: WizardBadgeItem[] = [+export const WIZARD_FRAMEWORKS: WizardBadgeItem[] = [{ name: 'Next.js', icon: nextjsImage },{ name: 'React', icon: reactImage },{ name: 'Angular', icon: angularImage },@@ -47,6 +50,25 @@ const WIZARD_FRAMEWORKS: WizardBadgeItem[] = [{ name: 'Python', icon: pythonImage },]+const ICON_SIZE_CLASSES = {+ sm: 'w-3 h-3 [&_svg]:!w-3 [&_svg]:!h-3',+ md: 'w-4 h-4 [&_svg]:!w-4 [&_svg]:!h-4',+}++export function WizardFrameworkIcon({+ icon: Icon,+ size,+}: {+ icon: NonNullable<WizardBadgeItem['icon']>+ size: keyof typeof ICON_SIZE_CLASSES+}): JSX.Element {+ return (+ <span className={cn('inline-flex shrink-0', ICON_SIZE_CLASSES[size])}>+ {typeof Icon === 'string' ? <img src={Icon} alt="" className="w-full h-full" /> : <Icon />}+ </span>+ )+}+export function WizardFrameworkBadges({ items = WIZARD_FRAMEWORKS }: { items?: WizardBadgeItem[] } = {}): JSX.Element {return (<div className="flex flex-wrap gap-1.5 items-center justify-center">@@ -56,13 +78,7 @@ export function WizardFrameworkBadges({ items = WIZARD_FRAMEWORKS }: { items?: Wkey={fw.name}className="inline-flex items-center gap-1 text-xs text-muted bg-bg-light border border-border rounded px-1.5 py-0.5">- {typeof fw.icon === 'string' ? (- <img src={fw.icon} alt="" className="w-3 h-3 shrink-0" />- ) : fw.icon ? (- <span className="inline-flex w-3 h-3 shrink-0 [&_svg]:!w-3 [&_svg]:!h-3">- <fw.icon />- </span>- ) : null}+ {fw.icon ? <WizardFrameworkIcon icon={fw.icon} size="sm" /> : null}{fw.name}</span>))}@@ -81,19 +97,18 @@ export function WizardFrameworkBadges({ items = WIZARD_FRAMEWORKS }: { items?: Wexport function WizardModeShell({children,hogCastKey = 0,- hideHog = false,+ hog: Hog = WizardHog,'data-attr': dataAttr,}: {children: ReactNodehogCastKey?: number- /** Drop the hedgehog for compact placements that have no room for it. */- hideHog?: boolean+ hog?: WizardShellHog'data-attr'?: string}): JSX.Element {return (<div className="flex gap-6" data-attr={dataAttr}>- {!hideHog && (- <WizardHog+ {Hog && (+ <Hogkey={`hog-${hogCastKey}`}className={cn('w-28 h-28 hidden sm:block shrink-0 self-center',@@ -101,12 +116,7 @@ export function WizardModeShell({)}/>)}- {/* With the hog hidden (compact placement), center the content at its natural- width instead of stretching it full-bleed — so the command block and the GitHub-connect- block sit centered without expanding. With the hog shown, keep the left-aligned column. */}- <div className={cn('flex-1 flex flex-col justify-center gap-3', hideHog && 'items-center text-center')}>- {children}- </div>+ <div className="flex-1 flex flex-col justify-center gap-3 min-w-0">{children}</div></div>)}diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/hooks.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/hooks.tsindex f2ab983d3c7e..f812dd466212 100644--- a/frontend/src/scenes/onboarding/shared/wizard-sync/hooks.ts+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/hooks.ts@@ -82,6 +82,10 @@ export function useLocalWizardRunActive(workflowId?: string): boolean {return installationProgress.isCurrent}+export function canCelebrate(): boolean {+ return !inStorybookTestRunner() && !window.matchMedia('(prefers-reduced-motion: reduce)').matches+}+/*** Hogfetti for a PR merged while the user is watching, exactly once per mount. Gated on the live* false → true transition: starts null so the first hydrated state (SSE replay / poll snapshot@@ -98,7 +102,7 @@ export function useMergeCelebration(prMerged: boolean): { CelebrationComponent:if (prev === null || prev || !prMerged || mergeCelebratedRef.current) {return}- if (inStorybookTestRunner() || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {+ if (!canCelebrate()) {return}mergeCelebratedRef.current = truediff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.tsindex d246f4439b5f..68a06627689f 100644--- a/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts@@ -5,14 +5,14 @@ import { lemonToast } from '@posthog/lemon-ui'import api, { ApiError } from 'lib/api'import { integrationsLogic } from 'lib/integrations/integrationsLogic'import { teamLogic } from 'scenes/teamLogic'-import { urls } from 'scenes/urls'-import { IntegrationType, OnboardingStepKey } from '~/types'+import { IntegrationType } from '~/types'++import { getIntegrationsAuthorizeRetrieveUrl } from 'products/integrations/frontend/generated/api'-import type { ProductKey } from '../../../../queries/schema/schema-general'import type { SDK } from '../../../../types'import { onboardingEventUsageLogic } from '../../onboardingEventUsageLogic'-// onboardingLogic gives the step key for the GitHub-connect return URL, and sdksLogic carries the+// onboardingLogic gives the GitHub-connect return URL for the active flow, and sdksLogic carries the// user's manual SDK pick (the cloud wizard's skill hint). Both no-op gracefully outside onboarding.import { onboardingLogic } from '../../onboardingLogic'import { sdksLogic } from '../../sdks/sdksLogic'@@ -33,7 +33,7 @@ export const WIZARD_CLOUD_RUN_WORKFLOW_ID = 'posthog-integration'// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface wizardCloudRunLogicValues {integrations: IntegrationType[] | null // integrationsLogic- currentStepProductKey: ProductKey | null // onboardingLogic+ installStepReturnUrl: string // onboardingLogicselectedSDK: SDK | null // sdksLogiccurrentProjectId: number | string // teamLogiccloudRunRunId: string | null@@ -94,7 +94,7 @@ export interface wizardCloudRunLogicMeta {__keaTypeGenInternalSelectorTypes: {githubIntegration: (integrations: IntegrationType[] | null) => IntegrationType | nullisGithubConnected: (githubIntegration: IntegrationType | null) => boolean- connectGitHubUrl: (currentStepProductKey: ProductKey | null) => string+ connectGitHubUrl: (currentProjectId: number | string, installStepReturnUrl: string) => stringskillId: (selectedSDK: SDK | null) => string | undefined}}@@ -127,7 +127,7 @@ export const wizardCloudRunLogic = kea<wizardCloudRunLogicType>([teamLogic,['currentProjectId'],onboardingLogic,- ['currentStepProductKey'],+ ['installStepReturnUrl'],sdksLogic,['selectedSDK'],],@@ -193,18 +193,16 @@ export const wizardCloudRunLogic = kea<wizardCloudRunLogicType>([(githubIntegration: IntegrationType | null): boolean => !!githubIntegration,],connectGitHubUrl: [- (s) => [s.currentStepProductKey],- (currentStepProductKey: null | import('../../../../queries/schema').ProductKey): string => {+ (s) => [s.currentProjectId, s.installStepReturnUrl],+ (currentProjectId: number | string, installStepReturnUrl: string): string =>// Full-page redirect to install/authorize the GitHub App, then back to// the install step. integrationsLogic's callback appends the new// integration id, and loadIntegrations() repopulates githubIntegration,// so the block advances from "connect" to "pick a repo" on return.- const next = urls.onboarding({- productKey: currentStepProductKey ?? undefined,- stepKey: OnboardingStepKey.INSTALL,- })- return api.integrations.authorizeUrl({ kind: 'github', next })- },+ `${getIntegrationsAuthorizeRetrieveUrl(String(currentProjectId))}?${new URLSearchParams({+ kind: 'github',+ next: installStepReturnUrl,+ })}`,],// The cloud wizard auto-detects the framework, so this is a hint rather than a// requirement — only set when the user happens to have picked an SDK manually.diff --git a/frontend/src/scenes/onboarding/shared/wizardHog.tsx b/frontend/src/scenes/onboarding/shared/wizardHog.tsxindex 8a27311b31f6..adf01af760c2 100644--- a/frontend/src/scenes/onboarding/shared/wizardHog.tsx+++ b/frontend/src/scenes/onboarding/shared/wizardHog.tsx@@ -1,6 +1,9 @@import * as wizardPng from '@posthog/brand/hoggies/png/wizard-1'+import * as purpleWizardPng from '@posthog/brand/hoggies/png/wizard-2'import { pngHoggie } from 'lib/brand/hoggies'/** The wizard hedgehog, shared across onboarding and wizard-flavored surfaces. */export const WizardHog = pngHoggie(wizardPng)++export const PurpleWizardHog = pngHoggie(purpleWizardPng)diff --git a/frontend/src/scenes/onboarding/simple/OnboardingMcpStep.tsx b/frontend/src/scenes/onboarding/simple/OnboardingMcpStep.tsxnew file mode 100644index 000000000000..52296e53a721--- /dev/null+++ b/frontend/src/scenes/onboarding/simple/OnboardingMcpStep.tsx@@ -0,0 +1,48 @@+import { useValues } from 'kea'++import { IconCheckCircle } from '@posthog/icons'+import { Spinner } from '@posthog/lemon-ui'++import { OnboardingStepKey } from '~/types'++import { OnboardingStep } from '../OnboardingStep'+import { WizardCommandBlock } from '../shared/wizard-sync/WizardCommandBlock'+import { PurpleWizardHog } from '../shared/wizardHog'+import { onboardingMcpStepLogic } from './onboardingMcpStepLogic'++export function OnboardingMcpStep(): JSX.Element {+ const { hasConnectedAgent } = useValues(onboardingMcpStepLogic)++ return (+ <OnboardingStep+ title="Connect your AI agent"+ subtitle="The PostHog MCP server lets agents like Claude Code, Cursor, and Codex read your PostHog data and set up features for you."+ stepKey={OnboardingStepKey.MCP}+ continueDisabledReason={+ hasConnectedAgent === false ? 'Connect your agent to PostHog to continue' : undefined+ }+ showSkip+ >+ <div className="max-w-xl mx-auto mt-6 space-y-6">+ <WizardCommandBlock+ hog={PurpleWizardHog}+ subcommand="mcp add"+ description="Run this in your terminal. It asks which agents to connect, then signs your agent in to PostHog."+ />+ <div className="flex items-center justify-center gap-2" aria-live="polite">+ {hasConnectedAgent ? (+ <>+ <IconCheckCircle className="text-success text-lg" />+ <span className="font-semibold">Your agent is connected</span>+ </>+ ) : (+ <>+ <Spinner className="text-lg" />+ <span className="text-secondary">Waiting for your agent to connect</span>+ </>+ )}+ </div>+ </div>+ </OnboardingStep>+ )+}diff --git a/frontend/src/scenes/onboarding/simple/SimpleOnboarding.tsx b/frontend/src/scenes/onboarding/simple/SimpleOnboarding.tsxnew file mode 100644index 000000000000..7b49aab2964c--- /dev/null+++ b/frontend/src/scenes/onboarding/simple/SimpleOnboarding.tsx@@ -0,0 +1,55 @@+import { useActions, useValues } from 'kea'++import { LemonButton } from '@posthog/lemon-ui'++import { GuidedWizardStepper } from 'lib/components/GuidedWizard/GuidedWizardStepper'++import { OnboardingFlowHost } from '../OnboardingFlowHost'+import { stepKeyToTitle } from '../onboardingFlowUtils'+import { onboardingLogic } from '../onboardingLogic'+import { OnboardingStepFooterStartContext } from '../OnboardingStepFooterStartContext'+import { ProjectTokenSnippet } from '../shared/ProjectTokenSnippet'++export function SimpleOnboarding(): JSX.Element {+ const { flow, currentFlowStep, isSkippingOnboarding } = useValues(onboardingLogic)+ const { skipSimpleOnboarding } = useActions(onboardingLogic)++ return (+ <div className="flex flex-col gap-4">+ <div className="flex flex-wrap items-center justify-between gap-x-4 gap-y-2 pb-4 border-b border-primary">+ {currentFlowStep ? (+ <GuidedWizardStepper+ steps={flow.map((step) => ({+ step: step.id,+ label: step.label ?? stepKeyToTitle(step.stepKey) ?? '',+ }))}+ currentStep={currentFlowStep.id}+ className="flex-wrap -ml-2"+ aria-label="Setup progress"+ />+ ) : (+ <div />+ )}+ <ProjectTokenSnippet />+ </div>+ <OnboardingStepFooterStartContext.Provider+ value={+ <LemonButton+ type="tertiary"+ size="small"+ onClick={skipSimpleOnboarding}+ loading={isSkippingOnboarding}+ data-attr="simple-onboarding-skip"+ >+ Skip setup+ </LemonButton>+ }+ >+ {/* A block wrapper: the step's `mx-auto` content would shrink to fit as a flex child. */}+ <div>+ <OnboardingFlowHost />+ </div>+ </OnboardingStepFooterStartContext.Provider>+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/simple/onboardingMcpStepLogic.ts b/frontend/src/scenes/onboarding/simple/onboardingMcpStepLogic.tsnew file mode 100644index 000000000000..6118477be16a--- /dev/null+++ b/frontend/src/scenes/onboarding/simple/onboardingMcpStepLogic.ts@@ -0,0 +1,49 @@+import { MakeLogicType, afterMount, beforeUnmount, connect, kea, listeners, path } from 'kea'+import posthog from 'posthog-js'++import { agentConnectionLogic } from 'lib/components/MCPHint/agentConnectionLogic'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface onboardingMcpStepLogicValues {+ hasConnectedAgent: boolean | null // agentConnectionLogic+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface onboardingMcpStepLogicActions {+ loadConnectedAppsSuccess: (+ connectedApps: import('~/generated/core/api.schemas').ConnectedAppApi[] | null,+ payload?: any+ ) => {+ connectedApps: import('~/generated/core/api.schemas').ConnectedAppApi[] | null+ payload?: any+ } // agentConnectionLogic+ setPolling: (polling: boolean) => {+ polling: boolean+ } // agentConnectionLogic+}++export type onboardingMcpStepLogicType = MakeLogicType<onboardingMcpStepLogicValues, onboardingMcpStepLogicActions>++export const onboardingMcpStepLogic = kea<onboardingMcpStepLogicType>([+ path(['scenes', 'onboarding', 'simple', 'onboardingMcpStepLogic']),+ connect(() => ({+ values: [agentConnectionLogic, ['hasConnectedAgent']],+ actions: [agentConnectionLogic, ['setPolling', 'loadConnectedAppsSuccess']],+ })),+ listeners(({ cache, values }) => ({+ loadConnectedAppsSuccess: () => {+ if (!values.hasConnectedAgent || cache.reportedConnected) {+ return+ }+ cache.reportedConnected = true+ // pinned: analytics event name, dashboards read it+ posthog.capture('onboarding mcp connected')+ },+ })),+ afterMount(({ actions }) => {+ actions.setPolling(true)+ }),+ beforeUnmount(({ actions }) => {+ actions.setPolling(false)+ }),+])diff --git a/frontend/src/scenes/onboarding/simple/simpleOnboardingArm.ts b/frontend/src/scenes/onboarding/simple/simpleOnboardingArm.tsnew file mode 100644index 000000000000..aa43a54f636c--- /dev/null+++ b/frontend/src/scenes/onboarding/simple/simpleOnboardingArm.ts@@ -0,0 +1,7 @@+import { FEATURE_FLAGS } from 'lib/constants'+import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'++/** Reading the flag reports an experiment exposure, so call this only where the arm decides something. */+export function isOnSimpleOnboardingArm(featureFlags: FeatureFlagsSet): boolean {+ return featureFlags[FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW] === 'test'+}diff --git a/frontend/src/scenes/onboarding/simple/simpleOnboardingFlow.tsx b/frontend/src/scenes/onboarding/simple/simpleOnboardingFlow.tsxnew file mode 100644index 000000000000..d363ea9e4e7a--- /dev/null+++ b/frontend/src/scenes/onboarding/simple/simpleOnboardingFlow.tsx@@ -0,0 +1,69 @@+import { SetupTaskId } from 'lib/components/ProductSetup'++import { ProductKey } from '~/queries/schema/schema-general'+import { type BillingProductV2Type, OnboardingStepKey } from '~/types'++import { OnboardingUpgradeStep } from '../billing/OnboardingUpgradeStep'+import { OnboardingInviteTeammates } from '../OnboardingInviteTeammates'+import { OnboardingInstallStep } from '../sdks/OnboardingInstallStep'+import {+ ProductAnalyticsSDKInstructions,+ ProductAnalyticsSDKTagOverrides,+} from '../sdks/product-analytics/ProductAnalyticsSDKInstructions'+import { INSTALL_DEDUP_KEYS, type OnboardingStepDescriptor } from '../types'+import { OnboardingMcpStep } from './OnboardingMcpStep'++/**+ * The simple onboarding is product-agnostic. Its steps are booked under product analytics, because+ * completing that product is what stops the app from sending the user back into onboarding.+ */+export const SIMPLE_ONBOARDING_PRODUCT_KEY = ProductKey.PRODUCT_ANALYTICS++function simpleStep(+ stepKey: OnboardingStepKey,+ label: string,+ render: () => React.ReactElement,+ extra: Partial<OnboardingStepDescriptor> = {}+): OnboardingStepDescriptor {+ return {+ id: `${stepKey}:${SIMPLE_ONBOARDING_PRODUCT_KEY}`,+ productKey: SIMPLE_ONBOARDING_PRODUCT_KEY,+ stepKey,+ label,+ role: 'primary',+ render,+ ...extra,+ }+}++export function buildSimpleOnboardingFlow(+ billingProduct: BillingProductV2Type | null,+ shouldShowBilling: boolean,+ canInviteTeammates: boolean+): OnboardingStepDescriptor[] {+ return [+ simpleStep(+ OnboardingStepKey.INSTALL,+ 'Install PostHog',+ () => (+ <OnboardingInstallStep+ sdkInstructionMap={ProductAnalyticsSDKInstructions}+ sdkTagOverrides={ProductAnalyticsSDKTagOverrides}+ compact+ />+ ),+ { setupTaskId: SetupTaskId.IngestFirstEvent, dedupKey: INSTALL_DEDUP_KEYS.POSTHOG_JS }+ ),+ simpleStep(OnboardingStepKey.MCP, 'Connect your AI agent', () => <OnboardingMcpStep />),+ ...(shouldShowBilling && billingProduct+ ? [+ simpleStep(OnboardingStepKey.PLANS, 'Select a plan', () => (+ <OnboardingUpgradeStep product={billingProduct} />+ )),+ ]+ : []),+ ...(canInviteTeammates+ ? [simpleStep(OnboardingStepKey.INVITE_TEAMMATES, 'Invite your team', () => <OnboardingInviteTeammates />)]+ : []),+ ]+}diff --git a/frontend/src/scenes/onboarding/types.ts b/frontend/src/scenes/onboarding/types.tsindex 94b430eae595..546cab38e43a 100644--- a/frontend/src/scenes/onboarding/types.ts+++ b/frontend/src/scenes/onboarding/types.ts@@ -4,6 +4,12 @@ import { type FeatureFlagsSet } from 'lib/logic/featureFlagLogic'import { ProductKey } from '~/queries/schema/schema-general'import { type BillingType, OnboardingStepKey, type TeamPublicType, type TeamType } from '~/types'+/**+ * - `default`: product selection, then the chosen products' steps (`/onboarding/<product>`).+ * - `simple`: the experiment arm's short install, MCP, plan and invite flow (`/onboarding/simple`).+ */+export type OnboardingFlowVariant = 'default' | 'simple'+/*** A unit of work in an onboarding flow. Pure data — composes deterministically from* (selectedProducts, currentTeam, billing, ...) into a flat list rendered one at adiff --git a/frontend/src/scenes/onboarding/welcome/OnboardingWelcome.stories.tsx b/frontend/src/scenes/onboarding/welcome/OnboardingWelcome.stories.tsxnew file mode 100644index 000000000000..4b3c25d0545f--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/OnboardingWelcome.stories.tsx@@ -0,0 +1,75 @@+import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'++import { Meta, StoryObj } from '@storybook/react'+import { useActions } from 'kea'+import { router } from 'kea-router'++import { FEATURE_FLAGS } from 'lib/constants'+import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'+import { App } from 'scenes/App'+import { teamLogic } from 'scenes/teamLogic'+import { urls } from 'scenes/urls'++import { mswDecorator } from '~/mocks/browser'+import preflightJson from '~/mocks/fixtures/_preflight.json'+import { ProductKey } from '~/queries/schema/schema-general'++const meta: Meta = {+ title: 'Scenes-Other/Onboarding/Welcome',+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ mockDate: '2023-05-25',+ // Setup screens show a "listening for data" spinner and an animated preview by design.+ testOptions: { waitForLoadersToDisappear: false },+ },+ decorators: [+ mswDecorator({+ get: {+ '/_preflight': { ...preflightJson, cloud: true, realm: 'cloud' },+ '/stats': {},+ '/events': {},+ '/api/projects/:team_id/insights/': { count: 0, results: [] },+ '/api/projects/:team_id/event_definitions/': { count: 0, results: [] },+ '/api/environments/:team_id/session_recordings': {+ results: [{ id: 'example-recording' }],+ has_next: false,+ },+ },+ patch: {+ '/api/environments/:team_id/add_product_intent/': {},+ },+ }),+ ],+}+export default meta++type Story = StoryObj<{}>++function welcomeStory(productKey: ProductKey | undefined, waitForSelector: string): Story {+ return {+ render: () => {+ const { loadCurrentTeamSuccess } = useActions(teamLogic)+ useDelayedOnMountEffect(() => {+ loadCurrentTeamSuccess({ ...MOCK_DEFAULT_TEAM, created_at: '2023-05-23T00:00:00Z' })+ router.actions.push(urls.onboardingWelcome(), productKey ? { product: productKey } : undefined)+ })+ return <App />+ },+ parameters: {+ featureFlags: { [FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW]: 'test' },+ testOptions: { waitForSelector },+ },+ }+}++export const Default: Story = welcomeStory(undefined, '[data-attr="onboarding-welcome-ai-prompt"]')++/** No saved insights yet, so product analytics shows its own setup screen under the Wizard callout. */+export const ProductNeedsSetup: Story = welcomeStory(ProductKey.PRODUCT_ANALYTICS, '[data-attr="product-empty-state"]')++/** Recordings exist, so session replay reads as set up, with what to try first and a link in. */+export const ProductInstalled: Story = welcomeStory(+ ProductKey.SESSION_REPLAY,+ '[data-attr="onboarding-welcome-product-ready"]'+)diff --git a/frontend/src/scenes/onboarding/welcome/OnboardingWelcome.tsx b/frontend/src/scenes/onboarding/welcome/OnboardingWelcome.tsxnew file mode 100644index 000000000000..2757958bc76c--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/OnboardingWelcome.tsx@@ -0,0 +1,70 @@+import { useActions, useValues } from 'kea'++import { IconSparkles } from '@posthog/icons'+import { LemonButton, LemonCard } from '@posthog/lemon-ui'++import { SceneExport } from 'scenes/sceneTypes'++import { SceneContent } from '~/layout/scenes/components/SceneContent'++import { ProjectTokenSnippet } from '../shared/ProjectTokenSnippet'+import { onboardingWelcomeLogic, WELCOME_PRODUCTS } from './onboardingWelcomeLogic'+import { WelcomeAiPanel } from './WelcomeAiPanel'+import { WelcomeProductNavItem } from './WelcomeProductNavItem'+import { WelcomeProductPanel } from './WelcomeProductPanel'++export const scene: SceneExport = {+ component: OnboardingWelcome,+ logic: onboardingWelcomeLogic,+}++export function OnboardingWelcome(): JSX.Element {+ const { selection } = useValues(onboardingWelcomeLogic)+ const { selectAi, selectProduct } = useActions(onboardingWelcomeLogic)++ return (+ <SceneContent>+ <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-2">+ <div>+ <h1 className="m-0 text-2xl font-semibold">Welcome to PostHog</h1>+ <p className="m-0 mt-1 text-secondary">+ Tell PostHog AI what you want to do, or set up a product yourself.+ </p>+ </div>+ <ProjectTokenSnippet />+ </div>+ <div className="grid grid-cols-1 gap-4 @min-[56rem]/main-content:grid-cols-[18rem_minmax(0,1fr)]">+ {/* A wrapping row when the columns stack, so the panel stays near the top. */}+ <nav+ className="flex min-w-0 flex-wrap gap-1 @min-[56rem]/main-content:flex-col @min-[56rem]/main-content:flex-nowrap @min-[56rem]/main-content:gap-px"+ aria-label="Get started"+ >+ <LemonButton+ className="@min-[56rem]/main-content:w-full"+ active={selection === 'ai'}+ icon={<IconSparkles />}+ onClick={() => selectAi()}+ data-attr="onboarding-welcome-ai"+ >+ Ask PostHog AI+ </LemonButton>+ <div className="w-full px-2 pb-1 pt-3 text-xxs font-semibold uppercase tracking-wide text-tertiary">+ Or install a specific product+ </div>+ {WELCOME_PRODUCTS.map(({ key, product }) => (+ <WelcomeProductNavItem+ key={key}+ productKey={key}+ product={product}+ active={selection === key}+ onSelect={() => selectProduct(key)}+ />+ ))}+ </nav>+ <LemonCard hoverEffect={false} className="min-w-0 p-4">+ {selection === 'ai' ? <WelcomeAiPanel /> : <WelcomeProductPanel />}+ </LemonCard>+ </div>+ </SceneContent>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeAiPanel.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeAiPanel.tsxnew file mode 100644index 000000000000..7963809ea8b0--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeAiPanel.tsx@@ -0,0 +1,69 @@+import { useActions, useValues } from 'kea'++import * as robotPng from '@posthog/brand/hoggies/png/robot'+import { IconSparkles } from '@posthog/icons'+import { LemonButton, LemonTextArea } from '@posthog/lemon-ui'++import { pngHoggie } from 'lib/brand/hoggies'++import { onboardingWelcomeLogic } from './onboardingWelcomeLogic'++const HedgehogRobot = pngHoggie(robotPng)++const SUGGESTIONS = [+ 'Find where people drop off in my signup flow',+ 'See how people use a feature I just shipped',+ 'Learn which pages bring in the most signups',+]++export function WelcomeAiPanel(): JSX.Element {+ const { aiPrompt } = useValues(onboardingWelcomeLogic)+ const { setAiPrompt, submitAiPrompt } = useActions(onboardingWelcomeLogic)++ return (+ <div className="mx-auto flex max-w-xl flex-col items-center gap-4 py-8 text-center">+ <HedgehogRobot className="w-28" />+ <div className="flex flex-col gap-1">+ <h2 className="m-0 text-xl font-semibold">Tell PostHog AI what you want to do</h2>+ <p className="m-0 text-secondary">+ Describe what you're building or what you want to learn. PostHog AI picks the right tools and gets+ you started.+ </p>+ </div>+ <LemonTextArea+ className="w-full text-left"+ value={aiPrompt}+ onChange={setAiPrompt}+ onPressCmdEnter={(value) => submitAiPrompt(value)}+ placeholder="For example: I want to know why people cancel their subscription"+ minRows={3}+ data-attr="onboarding-welcome-ai-prompt"+ />+ <LemonButton+ type="primary"+ icon={<IconSparkles />}+ onClick={() => submitAiPrompt(aiPrompt)}+ disabledReason={aiPrompt.trim() ? undefined : 'Describe what you want to do first'}+ data-attr="onboarding-welcome-ai-submit"+ >+ Start a conversation+ </LemonButton>+ <div className="flex flex-col items-center gap-2">+ <span className="text-xs text-secondary">Or start from an example</span>+ <div className="flex flex-wrap justify-center gap-2">+ {SUGGESTIONS.map((suggestion) => (+ <LemonButton+ key={suggestion}+ type="secondary"+ size="small"+ onClick={() => submitAiPrompt(suggestion, true)}+ data-attr="onboarding-welcome-ai-suggestion"+ >+ {suggestion}+ </LemonButton>+ ))}+ </div>+ </div>+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeCelebration.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeCelebration.tsxnew file mode 100644index 000000000000..83c57ffdf7a2--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeCelebration.tsx@@ -0,0 +1,29 @@+import { useActions, useValues } from 'kea'+import { useEffect } from 'react'++import { useHogfetti } from 'lib/components/Hogfetti/Hogfetti'++import { ProductKey } from '~/queries/schema/schema-general'++import { canCelebrate } from '../shared/wizard-sync/hooks'+import { onboardingWelcomeLogic } from './onboardingWelcomeLogic'++export function WelcomeCelebration({ productKey }: { productKey: ProductKey }): JSX.Element {+ const { celebratedProductKeys } = useValues(onboardingWelcomeLogic)+ const { markCelebrated } = useActions(onboardingWelcomeLogic)+ const { trigger, HogfettiComponent } = useHogfetti({ count: 60 })++ useEffect(() => {+ if (celebratedProductKeys.includes(productKey)) {+ return+ }+ markCelebrated(productKey)+ if (canCelebrate()) {+ trigger()+ }+ // Mount-only per product: the parent remounts this for each product it shows.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [])++ return <HogfettiComponent />+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeLoading.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeLoading.tsxnew file mode 100644index 000000000000..cc33e4f819c8--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeLoading.tsx@@ -0,0 +1,9 @@+import { Spinner } from 'lib/lemon-ui/Spinner'++export function WelcomeLoading(): JSX.Element {+ return (+ <div className="flex min-h-60 items-center justify-center" role="status" aria-label="Loading">+ <Spinner className="text-2xl" />+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeProductDetection.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeProductDetection.tsxnew file mode 100644index 000000000000..69955bedcb6a--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeProductDetection.tsx@@ -0,0 +1,6 @@+import { type LogicWrapper, useMountedLogic } from 'kea'++export function WelcomeProductDetection({ statusLogic }: { statusLogic: LogicWrapper }): null {+ useMountedLogic(statusLogic)+ return null+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeProductNavItem.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeProductNavItem.tsxnew file mode 100644index 000000000000..658d970c539f--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeProductNavItem.tsx@@ -0,0 +1,45 @@+import { useValues } from 'kea'++import { LemonButton, LemonTag } from '@posthog/lemon-ui'++import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'++import { ProductKey } from '~/queries/schema/schema-general'+import type { OnboardingProduct } from '~/types'++import { getProductIcon, toSentenceCase } from '../shared/utils'++export function WelcomeProductNavItem({+ productKey,+ product,+ active,+ onSelect,+}: {+ productKey: ProductKey+ product: OnboardingProduct+ active: boolean+ onSelect: () => void+}): JSX.Element {+ const { status } = useValues(productSetupStatusLogic({ productKey }))++ return (+ <LemonButton+ className="@min-[56rem]/main-content:w-full"+ active={active}+ icon={getProductIcon(product.icon, { iconColor: product.iconColor })}+ sideIcon={+ status === 'has-data' ? (+ <LemonTag type="success" size="small">+ Installed+ </LemonTag>+ ) : undefined+ }+ tooltip={product.description}+ tooltipPlacement="right"+ onClick={onSelect}+ data-attr={`onboarding-welcome-product-${productKey}`}+ >+ {toSentenceCase(product.name)}+ </LemonButton>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeProductPanel.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeProductPanel.tsxnew file mode 100644index 000000000000..a4d4d12dc0f2--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeProductPanel.tsx@@ -0,0 +1,28 @@+import { useValues } from 'kea'++import { onboardingWelcomeLogic } from './onboardingWelcomeLogic'+import { WelcomeLoading } from './WelcomeLoading'+import { WelcomeProductReady } from './WelcomeProductReady'+import { WelcomeProductStatus } from './WelcomeProductStatus'+import { WelcomeWizardCallout } from './WelcomeWizardCallout'++export function WelcomeProductPanel(): JSX.Element {+ const { selectedProduct, selectedEmptyState } = useValues(onboardingWelcomeLogic)++ if (!selectedProduct || selectedEmptyState === undefined) {+ return <WelcomeLoading />+ }++ const { key, product } = selectedProduct+ return (+ <div className="flex flex-col gap-4">+ <WelcomeWizardCallout />+ {/* Keyed so switching products remounts the next product's detection and celebration. */}+ {selectedEmptyState ? (+ <WelcomeProductStatus key={key} emptyState={selectedEmptyState} product={product} />+ ) : (+ <WelcomeProductReady key={key} product={product} />+ )}+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeProductReady.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeProductReady.tsxnew file mode 100644index 000000000000..5695010e34c7--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeProductReady.tsx@@ -0,0 +1,53 @@+import { IconArrowRight } from '@posthog/icons'+import { LemonButton } from '@posthog/lemon-ui'++import type { OnboardingProduct } from '~/types'++import { toSentenceCase } from '../shared/utils'++export function WelcomeProductReady({+ product,+ title,+ description,+}: {+ product: OnboardingProduct+ title?: string+ description?: string+}): JSX.Element {+ const Hedgehog = product.hedgehog+ const name = toSentenceCase(product.name)++ return (+ <div+ className="mx-auto flex max-w-xl flex-col items-center gap-4 py-8 text-center"+ data-attr="onboarding-welcome-product-ready"+ >+ {Hedgehog ? <Hedgehog className="w-40" /> : null}+ <div className="flex flex-col gap-1">+ <h2 className="m-0 text-xl font-semibold">{title ?? name}</h2>+ <p className="m-0 text-secondary">+ {description ?? product.userCentricDescription ?? product.description}+ </p>+ </div>+ {product.valueProps?.length ? (+ <div className="flex w-full flex-col gap-2 text-left">+ <span className="text-xs font-semibold text-secondary">What to try first</span>+ <ul className="m-0 flex list-none flex-col gap-2 p-0">+ {product.valueProps.map(({ title: valueTitle, problem }) => (+ <li key={valueTitle} className="flex gap-2 rounded border border-primary p-3">+ <IconArrowRight className="mt-0.5 shrink-0 text-lg text-secondary" />+ <div className="flex min-w-0 flex-col">+ <span className="font-semibold">{valueTitle}</span>+ <span className="text-xs text-secondary">{problem}</span>+ </div>+ </li>+ ))}+ </ul>+ </div>+ ) : null}+ <LemonButton type="primary" to={product.url} data-attr="onboarding-welcome-open-product">+ {`Open ${name}`}+ </LemonButton>+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeProductStatus.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeProductStatus.tsxnew file mode 100644index 000000000000..7018d7aed74d--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeProductStatus.tsx@@ -0,0 +1,51 @@+import { useValues } from 'kea'++import { ProductEmptyState } from 'lib/components/ProductEmptyState/ProductEmptyState'+import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'+import type { SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'++import type { OnboardingProduct } from '~/types'++import { toSentenceCase } from '../shared/utils'+import { WelcomeCelebration } from './WelcomeCelebration'+import { WelcomeLoading } from './WelcomeLoading'+import { WelcomeProductDetection } from './WelcomeProductDetection'+import { WelcomeProductReady } from './WelcomeProductReady'++/**+ * The product's own setup screen until it has data, then a way into it. Reads the same status as the+ * product's scene gate, so both surfaces agree on whether the product is set up.+ */+export function WelcomeProductStatus({+ emptyState,+ product,+}: {+ emptyState: SceneProductEmptyState+ product: OnboardingProduct+}): JSX.Element {+ const productKey = emptyState.config.productKey+ const { status } = useValues(productSetupStatusLogic({ productKey }))++ return (+ <>+ <WelcomeProductDetection statusLogic={emptyState.statusLogic} />+ {status === 'loading' ? (+ <WelcomeLoading />+ ) : status === 'has-data' ? (+ <>+ <WelcomeCelebration productKey={productKey} />+ <WelcomeProductReady+ product={product}+ title={`${toSentenceCase(product.name)} is set up`}+ description="This project is already using it."+ />+ </>+ ) : status === 'unknown' ? (+ <WelcomeProductReady product={product} />+ ) : (+ // Skipping would only hide the setup screen in the product's own scene, so this page drops it.+ <ProductEmptyState config={{ ...emptyState.config, skippable: false }} mode={status} />+ )}+ </>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/WelcomeWizardCallout.tsx b/frontend/src/scenes/onboarding/welcome/WelcomeWizardCallout.tsxnew file mode 100644index 000000000000..7d002c2a9429--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/WelcomeWizardCallout.tsx@@ -0,0 +1,35 @@+import { CommandBlock } from 'lib/components/CommandBlock/CommandBlock'++import { useWizardCommand } from '../shared/useWizardCommand'+import { WizardHog } from '../shared/wizardHog'++export function WelcomeWizardCallout(): JSX.Element | null {+ const { wizardCommand, isCloudOrDev } = useWizardCommand()++ // The wizard only targets cloud and dev instances.+ if (!isCloudOrDev) {+ return null+ }++ return (+ <div+ className="flex flex-wrap items-center gap-x-4 gap-y-2 rounded border border-primary bg-surface-primary px-3 py-2"+ data-attr="onboarding-welcome-wizard"+ >+ <WizardHog className="size-10 shrink-0" />+ <div className="min-w-60 flex-1">+ <div className="font-semibold">Install PostHog with Wizard</div>+ <div className="text-xs text-secondary">+ Run this in your app's folder to set up every product below. The setup agent adds the SDK and your+ project token.+ </div>+ </div>+ <CommandBlock+ command={wizardCommand}+ copyLabel="Wizard command"+ ariaLabel="Copy wizard command"+ decoration="rainbow"+ />+ </div>+ )+}diff --git a/frontend/src/scenes/onboarding/welcome/onboardingWelcomeLogic.ts b/frontend/src/scenes/onboarding/welcome/onboardingWelcomeLogic.tsnew file mode 100644index 000000000000..6fc89927db64--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/onboardingWelcomeLogic.ts@@ -0,0 +1,223 @@+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'+import { actionToUrl, router, urlToAction } from 'kea-router'+import posthog from 'posthog-js'++import type { SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'+import { availableOnboardingProducts } from 'scenes/onboarding/shared/utils'+import { urls } from 'scenes/urls'++import { ProductKey } from '~/queries/schema/schema-general'+import type { AvailableOnboardingProducts, OnboardingProduct } from '~/types'++import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'+import { loadWelcomeEmptyState } from './welcomeEmptyState'++export interface WelcomeProduct {+ key: ProductKey+ product: OnboardingProduct+}++export type WelcomeSelection = 'ai' | ProductKey++const isWelcomeProductKey = (key: unknown): key is keyof AvailableOnboardingProducts =>+ typeof key === 'string' && Object.hasOwn(availableOnboardingProducts, key)++export const WELCOME_PRODUCTS: WelcomeProduct[] = Object.entries(availableOnboardingProducts).map(([key, product]) => ({+ key: key as ProductKey,+ product,+}))++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface onboardingWelcomeLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ aiPrompt: string+ celebratedProductKeys: ProductKey[]+ emptyStates: Partial<Record<ProductKey, SceneProductEmptyState | null>>+ selectedEmptyState: SceneProductEmptyState | null | undefined+ selectedProduct: WelcomeProduct | null+ selectedProductKey: ProductKey | null+ selection: WelcomeSelection+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface onboardingWelcomeLogicActions {+ loadEmptyState: (productKey: ProductKey) => {+ productKey: ProductKey+ }+ markCelebrated: (productKey: ProductKey) => {+ productKey: ProductKey+ }+ selectAi: () => {+ value: true+ }+ selectProduct: (+ productKey: ProductKey,+ fromUrl?: boolean+ ) => {+ fromUrl: boolean+ productKey: ProductKey+ }+ setAiPrompt: (aiPrompt: string) => {+ aiPrompt: string+ }+ setEmptyState: (+ productKey: ProductKey,+ emptyState: SceneProductEmptyState | null+ ) => {+ emptyState: SceneProductEmptyState | null+ productKey: ProductKey+ }+ submitAiPrompt: (+ prompt: string,+ fromSuggestion?: boolean+ ) => {+ fromSuggestion: boolean+ prompt: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface onboardingWelcomeLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ selectedProductKey: (selection: WelcomeSelection) => ProductKey | null+ selectedProduct: (selectedProductKey: ProductKey | null) => WelcomeProduct | null+ selectedEmptyState: (+ emptyStates: Partial<Record<ProductKey, SceneProductEmptyState | null>>,+ selectedProductKey: ProductKey | null+ ) => SceneProductEmptyState | null | undefined+ }+}++export type onboardingWelcomeLogicType = MakeLogicType<+ onboardingWelcomeLogicValues,+ onboardingWelcomeLogicActions,+ Record<string, any>,+ onboardingWelcomeLogicMeta+>++export const onboardingWelcomeLogic = kea<onboardingWelcomeLogicType>([+ path(['scenes', 'onboarding', 'welcome', 'onboardingWelcomeLogic']),+ connect(() => ({+ values: [featureFlagLogic, ['featureFlags']],+ })),+ actions({+ selectAi: true,+ selectProduct: (productKey: ProductKey, fromUrl: boolean = false) => ({ productKey, fromUrl }),+ loadEmptyState: (productKey: ProductKey) => ({ productKey }),+ setEmptyState: (productKey: ProductKey, emptyState: SceneProductEmptyState | null) => ({+ productKey,+ emptyState,+ }),+ setAiPrompt: (aiPrompt: string) => ({ aiPrompt }),+ submitAiPrompt: (prompt: string, fromSuggestion: boolean = false) => ({ prompt, fromSuggestion }),+ markCelebrated: (productKey: ProductKey) => ({ productKey }),+ }),+ reducers({+ selection: [+ 'ai' as WelcomeSelection,+ {+ selectAi: () => 'ai',+ selectProduct: (_, { productKey }) => productKey,+ },+ ],+ emptyStates: [+ {} as Partial<Record<ProductKey, SceneProductEmptyState | null>>,+ {+ setEmptyState: (state, { productKey, emptyState }) => ({ ...state, [productKey]: emptyState }),+ },+ ],+ aiPrompt: [+ '',+ {+ setAiPrompt: (_, { aiPrompt }) => aiPrompt,+ },+ ],+ celebratedProductKeys: [+ [] as ProductKey[],+ {+ markCelebrated: (state, { productKey }) =>+ state.includes(productKey) ? state : [...state, productKey],+ },+ ],+ }),+ selectors({+ selectedProductKey: [+ (s) => [s.selection],+ (selection: WelcomeSelection): ProductKey | null => (selection === 'ai' ? null : selection),+ ],+ selectedProduct: [+ (s) => [s.selectedProductKey],+ (selectedProductKey: ProductKey | null): WelcomeProduct | null =>+ WELCOME_PRODUCTS.find(({ key }) => key === selectedProductKey) ?? null,+ ],+ // `undefined` while the product's setup screen loads, `null` when it has none.+ selectedEmptyState: [+ (s) => [s.emptyStates, s.selectedProductKey],+ (+ emptyStates: Partial<Record<ProductKey, SceneProductEmptyState | null>>,+ selectedProductKey: ProductKey | null+ ): SceneProductEmptyState | null | undefined =>+ selectedProductKey ? emptyStates[selectedProductKey] : undefined,+ ],+ }),+ listeners(({ actions, values }) => ({+ loadEmptyState: async ({ productKey }) => {+ // `null` can be a failed download, so only a loaded setup screen skips the next attempt.+ if (values.emptyStates[productKey]) {+ return+ }+ const emptyState = isWelcomeProductKey(productKey)+ ? await loadWelcomeEmptyState(+ productKey,+ availableOnboardingProducts[productKey].scene,+ values.featureFlags+ )+ : null+ actions.setEmptyState(productKey, emptyState)+ },+ selectProduct: ({ productKey, fromUrl }) => {+ actions.loadEmptyState(productKey)+ if (fromUrl) {+ return+ }+ // pinned: analytics event name and properties, dashboards read them+ posthog.capture('onboarding welcome product selected', { product_key: productKey })+ },+ submitAiPrompt: ({ prompt, fromSuggestion }) => {+ const trimmed = prompt.trim()+ if (!trimmed) {+ return+ }+ // pinned: analytics event name and properties, dashboards read them. The prompt itself+ // stays out of the event.+ posthog.capture('onboarding welcome ai prompt submitted', {+ from_suggestion: fromSuggestion,+ prompt_length: trimmed.length,+ })+ router.actions.push(urls.ai(undefined, trimmed))+ },+ })),+ actionToUrl(() => ({+ selectProduct: ({ productKey }) => [+ urls.onboardingWelcome(),+ { product: productKey },+ undefined,+ { replace: true },+ ],+ selectAi: () => [urls.onboardingWelcome(), {}, undefined, { replace: true }],+ })),+ urlToAction(({ actions, values }) => ({+ [urls.onboardingWelcome()]: (_, { product }) => {+ if (isWelcomeProductKey(product)) {+ if (product !== values.selection) {+ actions.selectProduct(product, true)+ }+ return+ }+ if (values.selection !== 'ai') {+ actions.selectAi()+ }+ },+ })),+])diff --git a/frontend/src/scenes/onboarding/welcome/welcomeEmptyState.test.ts b/frontend/src/scenes/onboarding/welcome/welcomeEmptyState.test.tsnew file mode 100644index 000000000000..b85aafeecee3--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/welcomeEmptyState.test.ts@@ -0,0 +1,40 @@+import type { ProductEmptyStateConfig, SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'+import { Scene } from 'scenes/sceneTypes'++import { ProductKey } from '~/queries/schema/schema-general'++import { pickWelcomeEmptyState } from './welcomeEmptyState'++function emptyStateWith(+ emptyState: Partial<SceneProductEmptyState> & { productKey: ProductKey }+): SceneProductEmptyState {+ const { productKey, ...rest } = emptyState+ return {+ config: { productKey } as ProductEmptyStateConfig,+ statusLogic: {} as SceneProductEmptyState['statusLogic'],+ ...rest,+ }+}++describe('pickWelcomeEmptyState', () => {+ test.each([+ {+ name: "the scene's own product",+ emptyState: emptyStateWith({ productKey: ProductKey.SESSION_REPLAY }),+ expected: true,+ },+ {+ name: 'an empty state for another product',+ emptyState: emptyStateWith({ productKey: ProductKey.ERROR_TRACKING }),+ expected: false,+ },+ {+ name: 'an empty state scoped to another scene',+ emptyState: emptyStateWith({ productKey: ProductKey.SESSION_REPLAY, scenes: [Scene.Heatmaps] }),+ expected: false,+ },+ ])('$name', ({ emptyState, expected }) => {+ const picked = pickWelcomeEmptyState(emptyState, ProductKey.SESSION_REPLAY, Scene.Replay, {})+ expect(picked !== null).toBe(expected)+ })+})diff --git a/frontend/src/scenes/onboarding/welcome/welcomeEmptyState.ts b/frontend/src/scenes/onboarding/welcome/welcomeEmptyState.tsnew file mode 100644index 000000000000..542b4756b28f--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/welcomeEmptyState.ts@@ -0,0 +1,78 @@+import { productEmptyStateGateActivation } from 'lib/components/ProductEmptyState/gateRender'+import type { SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'+import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'+import { retryImport } from 'lib/utils/retryImport'+import type { Scene } from 'scenes/sceneTypes'++import { ProductKey } from '~/queries/schema/schema-general'+import type { AvailableOnboardingProducts } from '~/types'++// Each product's setup screen on its own, so picking a product does not download its whole scene.+const EMPTY_STATE_IMPORTS: Record<keyof AvailableOnboardingProducts, () => Promise<SceneProductEmptyState>> = {+ [ProductKey.PRODUCT_ANALYTICS]: async () =>+ (await import('products/product_analytics/frontend/emptyState/productAnalyticsEmptyState'))+ .productAnalyticsEmptyState,+ [ProductKey.WEB_ANALYTICS]: async () =>+ (await import('products/web_analytics/frontend/emptyState/webAnalyticsEmptyState')).webAnalyticsEmptyState,+ [ProductKey.SESSION_REPLAY]: async () =>+ (await import('products/replay/frontend/emptyState/sessionReplayEmptyState')).sessionReplayEmptyState,+ [ProductKey.AI_OBSERVABILITY]: async () =>+ (await import('products/ai_observability/frontend/emptyState/aiObservabilityEmptyState'))+ .aiObservabilityEmptyState,+ [ProductKey.DATA_WAREHOUSE]: async () =>+ (await import('products/data_warehouse/frontend/emptyState/dataWarehouseEmptyState')).dataWarehouseEmptyState,+ [ProductKey.FEATURE_FLAGS]: async () =>+ (await import('products/feature_flags/frontend/emptyState/featureFlagsEmptyState')).featureFlagsEmptyState,+ [ProductKey.EXPERIMENTS]: async () =>+ (await import('products/experiments/frontend/emptyState/experimentsEmptyState')).experimentsEmptyState,+ [ProductKey.ERROR_TRACKING]: async () =>+ (await import('products/error_tracking/frontend/emptyState/errorTrackingEmptyState')).errorTrackingEmptyState,+ [ProductKey.SURVEYS]: async () =>+ (await import('products/surveys/frontend/emptyState/surveysEmptyState')).surveysEmptyState,+ [ProductKey.WORKFLOWS]: async () =>+ (await import('products/workflows/frontend/emptyState/workflowsEmptyState')).workflowsEmptyState,+ [ProductKey.LOGS]: async () => (await import('products/logs/frontend/emptyState/logsEmptyState')).logsEmptyState,+ [ProductKey.METRICS]: async () =>+ (await import('products/metrics/frontend/emptyState/metricsEmptyState')).metricsEmptyState,+ [ProductKey.MCP_ANALYTICS]: async () =>+ (await import('products/mcp_analytics/frontend/emptyState/mcpAnalyticsEmptyState')).mcpAnalyticsEmptyState,+ [ProductKey.CONVERSATIONS]: async () =>+ (await import('products/conversations/frontend/emptyState/supportEmptyState')).supportEmptyState,+}++/**+ * The setup screen the product's landing scene would show, or null when that scene would not show it+ * (a feature flag or a scene restriction turns it off).+ */+export function pickWelcomeEmptyState(+ emptyState: SceneProductEmptyState,+ productKey: ProductKey,+ sceneId: Scene,+ featureFlags: FeatureFlagsSet+): SceneProductEmptyState | null {+ if (emptyState.config.productKey !== productKey) {+ return null+ }+ const activation = productEmptyStateGateActivation({+ emptyState,+ activeSceneId: sceneId,+ params: {},+ featureFlags,+ receivedFeatureFlags: true,+ forcedMode: null,+ })+ return activation === 'on' ? emptyState : null+}++export async function loadWelcomeEmptyState(+ productKey: keyof AvailableOnboardingProducts,+ sceneId: Scene,+ featureFlags: FeatureFlagsSet+): Promise<SceneProductEmptyState | null> {+ try {+ const emptyState = await retryImport(EMPTY_STATE_IMPORTS[productKey])+ return pickWelcomeEmptyState(emptyState, productKey, sceneId, featureFlags)+ } catch {+ return null+ }+}diff --git a/frontend/src/scenes/onboarding/welcome/welcomeNavItem.test.ts b/frontend/src/scenes/onboarding/welcome/welcomeNavItem.test.tsnew file mode 100644index 000000000000..7fb67890d2d7--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/welcomeNavItem.test.ts@@ -0,0 +1,33 @@+import { FEATURE_FLAGS } from 'lib/constants'+import { dayjs } from 'lib/dayjs'++import { isWelcomeNavItemShown } from './welcomeNavItem'++describe('isWelcomeNavItemShown', () => {+ const now = dayjs('2026-10-15T12:00:00Z')+ const flagsReading = (variant: string): { flags: Record<string, string>; reads: string[] } => {+ const reads: string[] = []+ const flags = new Proxy({ [FEATURE_FLAGS.ONBOARDING_SIMPLE_FLOW]: variant } as Record<string, string>, {+ get: (target, key: string) => {+ reads.push(key)+ return target[key]+ },+ })+ return { flags, reads }+ }++ it.each([+ ['a 6 day old project on the test arm', '2026-10-09T13:00:00Z', 'test', true],+ ['a 7 day old project on the test arm', '2026-10-08T12:00:00Z', 'test', false],+ ['a new project on the control arm', '2026-10-14T12:00:00Z', 'control', false],+ ['a team with no creation date', undefined, 'test', false],+ ])('%s', (_name, createdAt, variant, expected) => {+ expect(isWelcomeNavItemShown(createdAt, flagsReading(variant).flags, now)).toBe(expected)+ })++ it('does not read the experiment flag for an old project, so it records no exposure', () => {+ const { flags, reads } = flagsReading('test')+ isWelcomeNavItemShown('2026-01-01T00:00:00Z', flags, now)+ expect(reads).toEqual([])+ })+})diff --git a/frontend/src/scenes/onboarding/welcome/welcomeNavItem.ts b/frontend/src/scenes/onboarding/welcome/welcomeNavItem.tsnew file mode 100644index 000000000000..800be968547e--- /dev/null+++ b/frontend/src/scenes/onboarding/welcome/welcomeNavItem.ts@@ -0,0 +1,19 @@+import { dayjs } from 'lib/dayjs'+import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'++import { isOnSimpleOnboardingArm } from '../simple/simpleOnboardingArm'++export const WELCOME_NAV_ITEM_MAX_PROJECT_AGE_DAYS = 7++/** Whether the sidebar links to the welcome page: only on the simple onboarding arm, and only for a new project. */+export function isWelcomeNavItemShown(+ projectCreatedAt: string | undefined,+ featureFlags: FeatureFlagsSet,+ now: dayjs.Dayjs = dayjs()+): boolean {+ if (!projectCreatedAt || now.diff(dayjs(projectCreatedAt), 'day', true) >= WELCOME_NAV_ITEM_MAX_PROJECT_AGE_DAYS) {+ return false+ }+ // Read the flag only after the age check, because the sidebar renders for every user.+ return isOnSimpleOnboardingArm(featureFlags)+}diff --git a/frontend/src/scenes/sceneTypes.ts b/frontend/src/scenes/sceneTypes.tsindex 9bf3d0ef30a0..15e333fb1897 100644--- a/frontend/src/scenes/sceneTypes.ts+++ b/frontend/src/scenes/sceneTypes.ts@@ -130,6 +130,7 @@ export enum Scene {OAuthAuthorize = 'OAuthAuthorize',Onboarding = 'Onboarding',OnboardingCoupon = 'OnboardingCoupon',+ OnboardingWelcome = 'OnboardingWelcome',OrganizationCreateFirst = 'OrganizationCreate',OrganizationCreationConfirm = 'OrganizationCreationConfirm',PasswordReset = 'PasswordReset',diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.tsindex 1c0457f9957c..fc3da3703e40 100644--- a/frontend/src/scenes/scenes.ts+++ b/frontend/src/scenes/scenes.ts@@ -301,6 +301,7 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {},[Scene.Onboarding]: { projectBased: true, name: 'Onboarding', layout: 'plain' },[Scene.OnboardingCoupon]: { projectBased: true, name: 'Claim coupon', layout: 'plain' },+ [Scene.OnboardingWelcome]: { projectBased: true, name: 'Welcome' },[Scene.OrganizationCreateFirst]: {name: 'Organization creation',},@@ -907,6 +908,7 @@ export const routes: Record<string, [Scene | string, string]> = {[urls.onboarding({ productKey: ':productKey' })]: [Scene.Onboarding, 'onboarding'],[urls.onboarding({ campaign: ':campaign' })]: [Scene.OnboardingCoupon, 'onboardingCoupon'],[urls.onboarding()]: [Scene.Onboarding, 'onboarding'],+ [urls.onboardingWelcome()]: [Scene.OnboardingWelcome, 'onboardingWelcome'],[urls.verifyEmail()]: [Scene.VerifyEmail, 'verifyEmail'],[urls.verifyEmail(':uuid')]: [Scene.VerifyEmail, 'verifyEmailWithUuid'],// Links from emails sent before the switch to verification codes.diff --git a/frontend/src/scenes/settings/user/connectedAppsLogic.test.ts b/frontend/src/scenes/settings/user/connectedAppsLogic.test.tsindex 1143fc979e53..93df1bc96e1e 100644--- a/frontend/src/scenes/settings/user/connectedAppsLogic.test.ts+++ b/frontend/src/scenes/settings/user/connectedAppsLogic.test.ts@@ -17,6 +17,7 @@ const APP_A: ConnectedAppApi = {is_verified: true,is_first_party: false,requires_access_confirmation: false,+ is_self_registered: false,}const APP_B: ConnectedAppApi = {@@ -28,6 +29,7 @@ const APP_B: ConnectedAppApi = {is_verified: false,is_first_party: false,requires_access_confirmation: false,+ is_self_registered: false,}async function waitForInFlightRevoke(getResolve: () => (() => void) | undefined): Promise<() => void> {diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.tsindex 67ad9378ee24..2047e1ead7b3 100644--- a/frontend/src/scenes/urls.ts+++ b/frontend/src/scenes/urls.ts@@ -269,6 +269,8 @@ export const urls = {const queryString = params.toString()return `${base}${queryString ? `?${queryString}` : ''}`},+ simpleOnboarding: (): string => '/onboarding/simple',+ onboardingWelcome: (): string => '/welcome',// Cloud onlyorganizationBilling: (products?: ProductKey[]): string =>`/organization/billing${products && products.length ? `?products=${products.join(',')}` : ''}`,diff --git a/frontend/src/scenes/web-analytics/WebAnalyticsScene.tsx b/frontend/src/scenes/web-analytics/WebAnalyticsScene.tsxindex 3af55eb2e950..b2420304b4c5 100644--- a/frontend/src/scenes/web-analytics/WebAnalyticsScene.tsx+++ b/frontend/src/scenes/web-analytics/WebAnalyticsScene.tsx@@ -14,8 +14,6 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { ProductKey } from '~/queries/schema/schema-general'-import { webVitalsEmptyState } from 'products/web_analytics/frontend/emptyState/webVitalsEmptyState'-export function WebAnalyticsScene(): JSX.Element {useMaxTool({identifier: 'web_analytics_doctor',@@ -77,5 +75,4 @@ export const scene: SceneExport = {component: WebAnalyticsScene,logic: webAnalyticsLogic,productKey: ProductKey.WEB_ANALYTICS,- emptyState: webVitalsEmptyState,}diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex 1bd472d4d67e..b941fe466d52 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -8140,6 +8140,7 @@ export enum OnboardingStepKey {SOURCE_MAPS = 'source_maps',ALERTS = 'alerts',PATH_CLEANING = 'path_cleaning',+ MCP = 'mcp',}// Managed viewsetdiff --git a/posthog/api/oauth/connected_apps.py b/posthog/api/oauth/connected_apps.pyindex 271c73b9aad5..f76f534163f6 100644--- a/posthog/api/oauth/connected_apps.py+++ b/posthog/api/oauth/connected_apps.py@@ -8,6 +8,7 @@ from rest_framework.permissions import IsAuthenticatedfrom rest_framework.request import Requestfrom rest_framework.response import Response+from posthog.api.oauth.cimd import is_cimd_client_idfrom posthog.auth import SessionAuthenticationfrom posthog.models.oauth import (OAuthApplication,@@ -34,6 +35,12 @@ class ConnectedAppSerializer(serializers.Serializer):"the user's organizations and PostHog has not verified it"))+ is_self_registered = serializers.BooleanField(+ help_text=(+ "Whether the application registered itself, through dynamic client registration or a client ID "+ "metadata document. MCP clients connect this way; applications PostHog registers do not."+ )+ )@extend_schema(tags=["oauth"], extensions={"x-product": "core"})@@ -99,6 +106,7 @@ class ConnectedAppsViewSet(viewsets.ViewSet):"requires_access_confirmation": (app.id in provisioner_ids and not app.is_verified and not app.is_first_party),+ "is_self_registered": app.is_dcr_client or is_cimd_client_id(app.client_id),})diff --git a/posthog/api/oauth/test_connected_apps.py b/posthog/api/oauth/test_connected_apps.pyindex 013efcd27134..07d393e669d9 100644--- a/posthog/api/oauth/test_connected_apps.py+++ b/posthog/api/oauth/test_connected_apps.py@@ -202,6 +202,26 @@ class TestConnectedAppsViewSet(APIBaseTest):data = response.json()[0]assert {flag: data[flag] for flag in expected_flags} == expected_flags+ @parameterized.expand(+ [+ ("dynamic_client_registration", {"is_dcr_client": True}, True),+ ("client_id_metadata_document", {"client_id": "https://agent.example.com/oauth/client.json"}, True),+ ("registered_by_posthog", {}, False),+ ]+ )+ def test_list_shows_verified_first_party_and_self_registered_flags(+ self, _name: str, app_kwargs: dict, is_self_registered: bool+ ):+ app = self._create_app(is_verified=True, is_first_party=True, **app_kwargs)+ self._create_token(app)++ response = self.client.get("/api/oauth/connected-apps/")++ data = response.json()[0]+ assert data["is_verified"] is True+ assert data["is_first_party"] is True+ assert data["is_self_registered"] is is_self_registered+def test_revoke_deletes_all_tokens_for_app(self):app = self._create_app()self._create_token(app)diff --git a/posthog/api/test/test_organization_invites.py b/posthog/api/test/test_organization_invites.pyindex 96c5be6da349..705bfd65bfd7 100644--- a/posthog/api/test/test_organization_invites.py+++ b/posthog/api/test/test_organization_invites.py@@ -1,3 +1,4 @@+import timeimport randomfrom datetime import timedelta@@ -5,6 +6,7 @@ import time_machinefrom posthog.test.base import APIBaseTestfrom unittest.mock import ANY, patch+from django.conf import settingsfrom django.core import mailfrom django.core.cache import cachefrom django.db import connection@@ -1761,7 +1763,15 @@ class TestOnboardingSkipAPI(APIBaseTest):def _skip_url(self) -> str:return "/api/users/@me/onboarding/skip/"- def test_skip_sets_timestamp_and_reason(self):+ @parameterized.expand(+ [("fresh_session", 0), ("session_older_than_sensitive_window", settings.SESSION_SENSITIVE_ACTIONS_AGE + 60)]+ )+ def test_skip_sets_timestamp_and_reason(self, _name: str, session_age_seconds: int):+ session = self.client.session+ session[settings.SESSION_COOKIE_CREATED_AT_KEY] = time.time() - session_age_seconds+ session[settings.SESSION_LAST_REAUTH_AT_KEY] = time.time() - session_age_seconds+ session.save()+response = self.client.post(self._skip_url(), {"reason": "later", "step_at_skip": "install"})self.assertEqual(response.status_code, status.HTTP_200_OK, response.content)self.user.refresh_from_db()@@ -1779,6 +1789,21 @@ class TestOnboardingSkipAPI(APIBaseTest):self.user.refresh_from_db()self.assertEqual(self.user.onboarding_skipped_at, first_ts)+ @patch("posthog.api.user.posthoganalytics.capture")+ def test_skip_captures_one_event_with_flow_variant(self, mock_capture):+ for _ in range(2):+ with self.captureOnCommitCallbacks(execute=True):+ response = self.client.post(+ self._skip_url(), {"reason": "later", "step_at_skip": "mcp", "flow_variant": "simple"}+ )+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.content)++ skip_calls = [c for c in mock_capture.call_args_list if c.kwargs.get("event") == "onboarding skipped"]+ self.assertEqual(+ [c.kwargs["properties"] for c in skip_calls],+ [{"step_at_skip": "mcp", "reason": "later", "flow_variant": "simple"}],+ )+def test_skip_rejects_invalid_reason(self):response = self.client.post(self._skip_url(), {"reason": "nope"})self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)diff --git a/posthog/api/user.py b/posthog/api/user.pyindex 445cee23bfe6..00732ff96092 100644--- a/posthog/api/user.py+++ b/posthog/api/user.py@@ -117,7 +117,13 @@ from posthog.models.organization import Organization, OrganizationMembershipfrom posthog.models.organization_domain import OrganizationDomainfrom posthog.models.organization_notification_lock import notification_locks_for_usersfrom posthog.models.personal_api_key import PersonalAPIKey-from posthog.models.user import ROLE_CHOICES, Notifications, OnboardingSkippedReason, ShortcutPosition+from posthog.models.user import (+ ROLE_CHOICES,+ Notifications,+ OnboardingFlowVariant,+ OnboardingSkippedReason,+ ShortcutPosition,+)from posthog.models.webauthn_credential import WebauthnCredentialfrom posthog.permissions import APIScopePermission, TimeSensitiveActionPermission, UserNoOrgMembershipDeletePermissionfrom posthog.rate_limit import (@@ -233,6 +239,11 @@ class OnboardingSkipRequestSerializer(serializers.Serializer):max_length=64,help_text="Onboarding step key the user was on when skipping, for analytics only.",)+ flow_variant = serializers.ChoiceField(+ choices=OnboardingFlowVariant.choices,+ required=False,+ help_text="Which onboarding flow the user skipped from, for analytics only.",+ )def _person_properties_refresh_due(user: User) -> bool:@@ -1067,7 +1078,8 @@ class UserViewSet("scene_personalisation","product_intro_seen",]- time_sensitive_allow_actions = ["hedgehog_config"]+ # Skipping onboarding only hides the onboarding redirect, so an older session may do it.+ time_sensitive_allow_actions = ["hedgehog_config", "onboarding_skip"]filter_backends = [DjangoFilterBackend]filterset_fields = ["is_staff", "email"]queryset = User.objects.filter(is_active=True).order_by("id")@@ -1396,6 +1408,7 @@ class UserViewSet(non_delegated_reasons = {OnboardingSkippedReason.LATER, OnboardingSkippedReason.OTHER}reason = validated["reason"]step_at_skip = validated.get("step_at_skip") or ""+ flow_variant = validated.get("flow_variant")with transaction.atomic():locked = User.objects.select_for_update().get(pk=instance.pk)@@ -1468,7 +1481,11 @@ class UserViewSet(posthoganalytics.capture(distinct_id=distinct_id,event="onboarding skipped",- properties={"step_at_skip": step_at_skip or None, "reason": reason},+ properties={+ "step_at_skip": step_at_skip or None,+ "reason": reason,+ "flow_variant": flow_variant,+ },)except Exception as exc:capture_exception(exc)diff --git a/posthog/models/user.py b/posthog/models/user.pyindex 4658830b0270..1e37be916292 100644--- a/posthog/models/user.py+++ b/posthog/models/user.py@@ -235,6 +235,13 @@ class OnboardingSkippedReason(models.TextChoices):PROVISIONED = "provisioned", "Account provisioned by a partner"+class OnboardingFlowVariant(models.TextChoices):+ # pinned: analytics property values. "legacy" names the default flow, because funnel+ # insights filter on it.+ LEGACY = "legacy", "Default onboarding"+ SIMPLE = "simple", "Simple onboarding"++class User(AbstractUser, UUIDTClassicModel, ModelActivityMixin): # type: ignore[django-manager-missing]USERNAME_FIELD = "email"REQUIRED_FIELDS = []diff --git a/products/web_analytics/frontend/emptyState/WebAnalyticsPreview.scss b/products/web_analytics/frontend/emptyState/WebAnalyticsPreview.scssnew file mode 100644index 000000000000..483da7a1590e--- /dev/null+++ b/products/web_analytics/frontend/emptyState/WebAnalyticsPreview.scss@@ -0,0 +1,257 @@+@import '../../../../frontend/src/lib/components/ProductEmptyState/previewMixins';++.WebPreview {+ --web-preview-accent: var(--empty-state-accent, var(--color-primary-500));++ display: flex;+ flex-direction: column;+ gap: 0.75rem;++ // Hidden filter state. A direct child of .WebPreview so `:checked ~` reaches every card.+ &__checkbox {+ position: absolute;+ width: 0;+ height: 0;+ pointer-events: none;+ opacity: 0;+ }++ &__card {+ min-width: 0;+ overflow: hidden;+ background: var(--color-bg-surface-primary);+ border: 1px solid var(--color-border-primary);+ border-radius: var(--radius);+ }++ // Filtered/idle pairs share one grid cell and crossfade, so filtering never shifts layout.+ &__swap {+ display: grid;+ }++ &__swap > * {+ grid-area: 1 / 1;+ min-width: 0;+ }++ &__when-filtered {+ @include preview-swap-hidden;+ }++ &__when-idle {+ @include preview-swap-visible;+ }++ &__head {+ display: flex;+ gap: 0.5rem;+ align-items: center;+ justify-content: space-between;+ padding: 0.5rem 0.75rem;+ border-bottom: 1px solid var(--color-border-primary);+ }++ &__title {+ display: flex;+ gap: 0.375rem;+ align-items: center;+ min-width: 0;+ font-size: 0.75rem;+ font-weight: 600;+ }++ &__live-dot {+ flex-shrink: 0;+ width: 7px;+ height: 7px;+ background: var(--web-preview-accent);+ border-radius: 50%;+ animation: WebPreview__pulse 2s ease-in-out infinite;+ }++ &__stat {+ display: flex;+ flex-wrap: wrap;+ gap: 0.5rem;+ align-items: baseline;+ padding: 0.625rem 0.75rem 0;+ }++ &__stat-value {+ font-size: 1.25rem;+ font-weight: 700;+ font-variant-numeric: tabular-nums;+ }++ &__stat-change {+ font-size: 0.625rem;+ font-weight: 600;++ @include preview-accent-text(var(--web-preview-accent));+ }++ &__chart {+ padding: 0.25rem 0.75rem 0.625rem;+ }++ // A fixed height: a percentage does not resolve inside the swap grid's auto-height row.+ &__chart svg {+ display: block;+ width: 100%;+ height: 2.75rem;+ overflow: visible;+ }++ &__line {+ fill: none;+ stroke: var(--web-preview-accent);+ stroke-width: 1.5;+ vector-effect: non-scaling-stroke;+ }++ &__area {+ fill: color-mix(in oklab, var(--web-preview-accent) 18%, transparent);+ }++ &__columns {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));+ gap: 0.75rem;+ }++ &__rows {+ display: flex;+ flex-direction: column;+ padding: 0.25rem 0.375rem 0.375rem;+ }++ &__row {+ position: relative;+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.5rem;+ align-items: center;+ padding: 0.3125rem 0.5rem;+ border-radius: var(--radius);+ transition:+ background-color 250ms ease,+ opacity 250ms ease;+ }++ &__row--hero {+ cursor: pointer;+ user-select: none;+ }++ &__row--hero:hover {+ background: var(--color-bg-fill-highlight-50);+ }++ &__bar {+ position: absolute;+ inset: 0.1875rem auto 0.1875rem 0;+ background: color-mix(in oklab, var(--web-preview-accent) 14%, transparent);+ border-radius: var(--radius);+ }++ &__bar--direct {+ width: 100%;+ }++ &__bar--google {+ width: 73%;+ }++ &__bar--newsletter {+ width: 29%;+ }++ &__bar--linkedin {+ width: 22%;+ }++ &__name {+ position: relative;+ overflow: hidden;+ font-size: 0.6875rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ &__name--mono {+ font-family: var(--font-mono);+ }++ &__count {+ position: relative;+ font-size: 0.625rem;+ font-variant-numeric: tabular-nums;+ color: var(--color-text-secondary);+ }++ &__hint {+ font-size: 0.625rem;+ color: var(--color-text-tertiary);+ }+}++.WebPreview__checkbox:checked ~ * .WebPreview__when-filtered {+ @include preview-swap-visible;+}++.WebPreview__checkbox:checked ~ * .WebPreview__when-idle {+ @include preview-swap-hidden;+}++.WebPreview__checkbox:checked ~ .WebPreview__columns .WebPreview__row--hero {+ background: color-mix(in oklab, var(--web-preview-accent) 12%, transparent);+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--web-preview-accent) 45%, transparent);+}++// Filtering by the newsletter surfaces the page it sent people to and dims the rest.+.WebPreview__checkbox:checked+ ~ .WebPreview__columns+ .WebPreview__row:not(.WebPreview__row--hero, .WebPreview__row--match) {+ opacity: 0.35;+}++.WebPreview__checkbox:checked ~ .WebPreview__columns .WebPreview__row--match {+ background: color-mix(in oklab, var(--web-preview-accent) 12%, transparent);+}++// The checkbox stays keyboard-focusable while visually hidden, so the row it labels needs a+// visible focus indicator (WCAG 2.4.7).+.WebPreview__checkbox:focus-visible ~ .WebPreview__columns .WebPreview__row--hero {+ outline: 2px solid var(--web-preview-accent);+ outline-offset: 1px;+}++.WebPreview:not(.WebPreview--static) .WebPreview__checkbox:not(:checked) ~ .WebPreview__columns .WebPreview__row--hero {+ animation: WebPreview__nudge 2.4s ease-in-out infinite;+}++@keyframes WebPreview__nudge {+ 0%,+ 100% {+ box-shadow: 0 0 0 0 color-mix(in oklab, var(--web-preview-accent) 40%, transparent);+ }++ 50% {+ box-shadow: 0 0 0 4px color-mix(in oklab, var(--web-preview-accent) 15%, transparent);+ }+}++@keyframes WebPreview__pulse {+ 0%,+ 100% {+ opacity: 1;+ }++ 50% {+ opacity: 0.35;+ }+}++// Storybook snapshots and reduced motion drop all ambient motion; clicking the row still flips+// the state (transitions only).+@include preview-motion-guards('WebPreview');diff --git a/products/web_analytics/frontend/emptyState/WebAnalyticsPreview.tsx b/products/web_analytics/frontend/emptyState/WebAnalyticsPreview.tsxnew file mode 100644index 000000000000..b2b8510d570e--- /dev/null+++ b/products/web_analytics/frontend/emptyState/WebAnalyticsPreview.tsx@@ -0,0 +1,131 @@+import './WebAnalyticsPreview.scss'++import { sparkPaths } from 'lib/components/ProductEmptyState/previewSparkline'+import { LemonTag } from 'lib/lemon-ui/LemonTag'+import { cn } from 'lib/utils/css-classes'+import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'++const ALL_TRAFFIC = sparkPaths([1480, 1720, 2310, 1890, 2040, 1650, 2180])+const NEWSLETTER_TRAFFIC = sparkPaths([40, 30, 820, 260, 120, 70, 50])++interface ChannelRow {+ name: string+ visitors: string+ barClassName: string+}++const CHANNELS: ChannelRow[] = [+ { name: 'Direct', visitors: '4.9k', barClassName: 'WebPreview__bar--direct' },+ { name: 'Google', visitors: '3.6k', barClassName: 'WebPreview__bar--google' },+ { name: 'LinkedIn', visitors: '1.1k', barClassName: 'WebPreview__bar--linkedin' },+]++const PAGES = [+ { path: '/', visitors: '6.8k' },+ { path: '/pricing', visitors: '2.4k' },+ { path: '/docs', visitors: '1.9k' },+]++/**+ * Example-data preview for the web analytics empty state: visitors over the week, the channels they+ * came from, and the pages they landed on. Clicking the newsletter channel filters the chart and+ * points at the page it sent people to. One hidden checkbox drives it via `:checked ~` styles - no+ * timers or state, per the preview rules in the `building-product-empty-states` skill.+ */+export function WebAnalyticsPreview(): JSX.Element {+ const isStatic = inStorybook() || inStorybookTestRunner()++ return (+ <div className={cn('WebPreview', isStatic && 'WebPreview--static')}>+ {/* Filter state, before every card so `:checked ~` can style them. */}+ <input type="checkbox" id="web-preview-filter" className="WebPreview__checkbox" />++ <div className="WebPreview__card">+ <div className="WebPreview__head">+ <span className="WebPreview__title">+ <span className="WebPreview__live-dot" aria-hidden="true" />+ <span className="WebPreview__swap">+ <span className="WebPreview__when-idle">Visitors · last 7 days</span>+ <span className="WebPreview__when-filtered">Visitors from Newsletter</span>+ </span>+ </span>+ <LemonTag size="small">example data</LemonTag>+ </div>+ <div className="WebPreview__stat">+ <span className="WebPreview__swap">+ <span className="WebPreview__when-idle WebPreview__stat-value">12.2k</span>+ <span className="WebPreview__when-filtered WebPreview__stat-value">1.4k</span>+ </span>+ <span className="WebPreview__swap">+ <span className="WebPreview__when-idle WebPreview__stat-change">+18% vs last week</span>+ <span className="WebPreview__when-filtered WebPreview__stat-change">peaked on Wednesday</span>+ </span>+ </div>+ <div className="WebPreview__swap WebPreview__chart">+ <svg viewBox="0 0 100 40" preserveAspectRatio="none" className="WebPreview__when-idle">+ <path d={ALL_TRAFFIC.area} className="WebPreview__area" />+ <path d={ALL_TRAFFIC.line} className="WebPreview__line" />+ </svg>+ <svg viewBox="0 0 100 40" preserveAspectRatio="none" className="WebPreview__when-filtered">+ <path d={NEWSLETTER_TRAFFIC.area} className="WebPreview__area" />+ <path d={NEWSLETTER_TRAFFIC.line} className="WebPreview__line" />+ </svg>+ </div>+ </div>++ <div className="WebPreview__columns">+ <div className="WebPreview__card">+ <div className="WebPreview__head">+ <span className="WebPreview__title">Channels</span>+ </div>+ <div className="WebPreview__rows">+ {CHANNELS.slice(0, 2).map((channel) => (+ <WebPreviewRow key={channel.name} {...channel} />+ ))}+ <label htmlFor="web-preview-filter" className="WebPreview__row WebPreview__row--hero">+ <span className="WebPreview__bar WebPreview__bar--newsletter" />+ <span className="WebPreview__name">Newsletter</span>+ <span className="WebPreview__count">1.4k</span>+ </label>+ <WebPreviewRow {...CHANNELS[2]} />+ </div>+ </div>++ <div className="WebPreview__card">+ <div className="WebPreview__head">+ <span className="WebPreview__title">Top pages</span>+ </div>+ <div className="WebPreview__rows">+ {PAGES.map((page) => (+ <div key={page.path} className="WebPreview__row">+ <span className="WebPreview__name WebPreview__name--mono">{page.path}</span>+ <span className="WebPreview__count">{page.visitors}</span>+ </div>+ ))}+ <div className="WebPreview__row WebPreview__row--match">+ <span className="WebPreview__name WebPreview__name--mono">/blog/example-post</span>+ <span className="WebPreview__count">1.2k</span>+ </div>+ </div>+ </div>+ </div>++ <div className="WebPreview__hint WebPreview__swap">+ <span className="WebPreview__when-idle">Click a channel to see the traffic it brought.</span>+ <span className="WebPreview__when-filtered">+ The newsletter sent people to one post. Click again to clear the filter.+ </span>+ </div>+ </div>+ )+}++function WebPreviewRow({ name, visitors, barClassName }: ChannelRow): JSX.Element {+ return (+ <div className="WebPreview__row">+ <span className={cn('WebPreview__bar', barClassName)} />+ <span className="WebPreview__name">{name}</span>+ <span className="WebPreview__count">{visitors}</span>+ </div>+ )+}diff --git a/products/web_analytics/frontend/emptyState/WebVitalsPreview.scss b/products/web_analytics/frontend/emptyState/WebVitalsPreview.scssdeleted file mode 100644index 733b0896a378..000000000000--- a/products/web_analytics/frontend/emptyState/WebVitalsPreview.scss+++ /dev/null@@ -1,252 +0,0 @@-@import '../../../../frontend/src/lib/components/ProductEmptyState/previewMixins';--.VitalsPreview {- --vitals-preview-accent: var(--empty-state-accent, var(--color-primary-500));-- display: flex;- flex-direction: column;- gap: 0.75rem;-- // Hidden focus state. A direct child of .VitalsPreview so `:checked ~` reaches both cards.- &__checkbox {- position: absolute;- width: 0;- height: 0;- pointer-events: none;- opacity: 0;- }-- &__tiles-card,- &__pages {- overflow: hidden;- background: var(--color-bg-surface-primary);- border: 1px solid var(--color-border-primary);- border-radius: var(--radius);- }-- // Focused/idle pairs are stacked on one grid cell and crossfaded, so focusing- // never changes any element's size (no layout shift). Fitting, for a CLS demo.- &__swap {- display: grid;- }-- &__swap > * {- grid-area: 1 / 1;- min-width: 0;- }-- &__when-focused {- @include preview-swap-hidden;- }-- &__when-idle {- @include preview-swap-visible;- }-- &__head {- display: flex;- align-items: center;- justify-content: space-between;- padding: 0.5rem 0.75rem;- border-bottom: 1px solid var(--color-border-primary);- }-- &__title {- display: flex;- gap: 0.375rem;- align-items: center;- font-size: 0.75rem;- font-weight: 600;- }-- &__live-dot {- width: 7px;- height: 7px;- background: var(--vitals-preview-accent);- border-radius: 50%;- animation: VitalsPreview__pulse 2s ease-in-out infinite;- }-- // Vitals tiles-- &__tiles {- display: grid;- grid-template-columns: repeat(4, 1fr);- gap: 0.5rem;- padding: 0.625rem 0.75rem 0.375rem;- }-- &__tile {- display: flex;- flex-direction: column;- gap: 0.125rem;- padding: 0.4375rem 0.5rem;- border: 1px solid var(--color-border-primary);- border-radius: var(--radius);- transition:- background-color 250ms ease,- box-shadow 250ms ease;- }-- &__tile--hero {- cursor: pointer;- user-select: none;- }-- &__tile--hero:hover {- background: var(--color-bg-fill-highlight-50);- }-- &__tile-name {- font-size: 0.625rem;- font-weight: 600;- color: var(--color-text-secondary);- }-- &__tile-value {- font-size: 0.875rem;- font-weight: 700;- font-variant-numeric: tabular-nums;- }-- &__tile-value--poor {- color: var(--color-text-error);- }-- &__tile-band {- font-size: 0.5625rem;- font-weight: 600;- text-transform: uppercase;- }-- &__tile-band--good {- color: var(--color-text-secondary);- }-- &__tile-band--poor {- color: var(--color-text-error);- }-- &__hint {- padding: 0.25rem 0.75rem 0.5rem;- font-size: 0.625rem;- color: var(--color-text-tertiary);- }-- // Pages list-- &__rows {- display: flex;- flex-direction: column;- padding: 0.25rem 0.5rem 0.375rem;- }-- &__row {- display: grid;- grid-template-columns: minmax(0, 1fr) auto 4.5rem;- gap: 0.5rem;- align-items: center;- padding: 0.3125rem 0.5rem;- border-radius: var(--radius);- transition: background-color 250ms ease;- }-- &__path {- overflow: hidden;- font-family: var(--font-mono);- font-size: 0.6875rem;- text-overflow: ellipsis;- white-space: nowrap;- }-- &__visits {- font-size: 0.625rem;- font-variant-numeric: tabular-nums;- color: var(--color-text-tertiary);- }-- &__score {- font-family: var(--font-mono);- font-size: 0.625rem;- font-variant-numeric: tabular-nums;- color: var(--color-text-secondary);- text-align: right;- }-- &__score--poor {- font-weight: 600;- color: var(--color-text-error);- }-- &__fresh {- font-size: 0.5625rem;- font-weight: 600;-- @include preview-accent-text(var(--vitals-preview-accent));- }-}--// Focused state (user clicked the CLS tile)--.VitalsPreview__checkbox:checked ~ * .VitalsPreview__when-focused {- @include preview-swap-visible;-}--.VitalsPreview__checkbox:checked ~ * .VitalsPreview__when-idle {- @include preview-swap-hidden;-}--.VitalsPreview__checkbox:checked ~ .VitalsPreview__tiles-card .VitalsPreview__tile--hero {- background: color-mix(in oklab, var(--danger) 7%, transparent);- box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger) 35%, transparent);-}--// Focusing CLS surfaces its offenders and dims the healthy pages.-.VitalsPreview__checkbox:checked ~ .VitalsPreview__pages .VitalsPreview__row:not(.VitalsPreview__row--offender) {- opacity: 0.35;-}--.VitalsPreview__checkbox:checked ~ .VitalsPreview__pages .VitalsPreview__row--offender {- background: color-mix(in oklab, var(--danger) 7%, transparent);-}--// The checkbox stays keyboard-focusable while visually hidden, so the tile it labels-// needs a visible focus indicator (WCAG 2.4.7).-.VitalsPreview__checkbox:focus-visible ~ .VitalsPreview__tiles-card .VitalsPreview__tile--hero {- outline: 2px solid var(--vitals-preview-accent);- outline-offset: 1px;-}--// Nudge attention at the failing tile until it's inspected.-.VitalsPreview:not(.VitalsPreview--static)- .VitalsPreview__checkbox:not(:checked)- ~ .VitalsPreview__tiles-card- .VitalsPreview__tile--hero {- animation: VitalsPreview__nudge 2.4s ease-in-out infinite;-}--@keyframes VitalsPreview__nudge {- 0%,- 100% {- box-shadow: 0 0 0 0 color-mix(in oklab, var(--danger) 40%, transparent);- }-- 50% {- box-shadow: 0 0 0 4px color-mix(in oklab, var(--danger) 15%, transparent);- }-}--@keyframes VitalsPreview__pulse {- 0%,- 100% {- opacity: 1;- }-- 50% {- opacity: 0.35;- }-}--// Storybook snapshots and reduced motion drop all ambient motion; clicking the-// tile still flips the state (transitions only).-@include preview-motion-guards('VitalsPreview');diff --git a/products/web_analytics/frontend/emptyState/WebVitalsPreview.tsx b/products/web_analytics/frontend/emptyState/WebVitalsPreview.tsxdeleted file mode 100644index 2a8b17d62dbb..000000000000--- a/products/web_analytics/frontend/emptyState/WebVitalsPreview.tsx+++ /dev/null@@ -1,95 +0,0 @@-import './WebVitalsPreview.scss'--import { LemonTag } from 'lib/lemon-ui/LemonTag'-import { cn } from 'lib/utils/css-classes'-import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'--/**- * Example-data preview for the web vitals empty state: the four vitals tiles and- * the pages behind them. Clicking the failing CLS tile highlights the pages that- * drag it down. One hidden checkbox drives it via `:checked ~` styles - no timers- * or state, per the preview rules in the `building-product-empty-states` skill.- * Focused/unfocused pairs are stacked in `__swap` grids, so nothing shifts.- */-export function WebVitalsPreview(): JSX.Element {- const isStatic = inStorybook() || inStorybookTestRunner()-- return (- <div className={cn('VitalsPreview', isStatic && 'VitalsPreview--static')}>- {/* Focus state, before both cards so `:checked ~` can style them. */}- <input type="checkbox" id="vitals-preview-focus" className="VitalsPreview__checkbox" />-- <div className="VitalsPreview__tiles-card">- <div className="VitalsPreview__head">- <span className="VitalsPreview__title">- <span className="VitalsPreview__live-dot" aria-hidden="true" />- Core Web Vitals · last 7 days- </span>- <LemonTag size="small">example data</LemonTag>- </div>- <div className="VitalsPreview__tiles">- <div className="VitalsPreview__tile">- <span className="VitalsPreview__tile-name">LCP</span>- <span className="VitalsPreview__tile-value">2.1 s</span>- <span className="VitalsPreview__tile-band VitalsPreview__tile-band--good">good</span>- </div>- <div className="VitalsPreview__tile">- <span className="VitalsPreview__tile-name">INP</span>- <span className="VitalsPreview__tile-value">180 ms</span>- <span className="VitalsPreview__tile-band VitalsPreview__tile-band--good">good</span>- </div>- <label htmlFor="vitals-preview-focus" className="VitalsPreview__tile VitalsPreview__tile--hero">- <span className="VitalsPreview__tile-name">CLS</span>- <span className="VitalsPreview__tile-value VitalsPreview__tile-value--poor">0.24</span>- <span className="VitalsPreview__tile-band VitalsPreview__tile-band--poor">poor</span>- </label>- <div className="VitalsPreview__tile">- <span className="VitalsPreview__tile-name">FCP</span>- <span className="VitalsPreview__tile-value">1.2 s</span>- <span className="VitalsPreview__tile-band VitalsPreview__tile-band--good">good</span>- </div>- </div>- <div className="VitalsPreview__hint VitalsPreview__swap">- <span className="VitalsPreview__when-idle">- Click the failing metric to find the pages behind it.- </span>- <span className="VitalsPreview__when-focused">- Two pages shift their layout on load. Click again to unfocus.- </span>- </div>- </div>-- <div className="VitalsPreview__pages">- <div className="VitalsPreview__head">- <span className="VitalsPreview__title VitalsPreview__swap">- <span className="VitalsPreview__when-idle">Pages by traffic</span>- <span className="VitalsPreview__when-focused">Pages by CLS</span>- </span>- <span className="VitalsPreview__fresh VitalsPreview__when-focused">worst first</span>- </div>- <div className="VitalsPreview__rows">- <div className="VitalsPreview__row VitalsPreview__row--offender">- <span className="VitalsPreview__path">/pricing</span>- <span className="VitalsPreview__visits">8.1k visits</span>- <span className="VitalsPreview__score VitalsPreview__score--poor">CLS 0.41</span>- </div>- <div className="VitalsPreview__row VitalsPreview__row--offender">- <span className="VitalsPreview__path">/blog</span>- <span className="VitalsPreview__visits">5.4k visits</span>- <span className="VitalsPreview__score VitalsPreview__score--poor">CLS 0.29</span>- </div>- <div className="VitalsPreview__row">- <span className="VitalsPreview__path">/</span>- <span className="VitalsPreview__visits">21.9k visits</span>- <span className="VitalsPreview__score">CLS 0.05</span>- </div>- <div className="VitalsPreview__row">- <span className="VitalsPreview__path">/docs</span>- <span className="VitalsPreview__visits">12.2k visits</span>- <span className="VitalsPreview__score">CLS 0.02</span>- </div>- </div>- </div>- </div>- )-}diff --git a/products/web_analytics/frontend/emptyState/webAnalyticsEmptyState.tsx b/products/web_analytics/frontend/emptyState/webAnalyticsEmptyState.tsxnew file mode 100644index 000000000000..ed2e57800ee4--- /dev/null+++ b/products/web_analytics/frontend/emptyState/webAnalyticsEmptyState.tsx@@ -0,0 +1,45 @@+import * as explorerPng from '@posthog/brand/hoggies/png/explorer'+import { IconPieChart } from '@posthog/icons'++import { pngHoggie } from 'lib/brand/hoggies'+import type { SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'+import { urls } from 'scenes/urls'++import { ProductKey } from '~/queries/schema/schema-general'++import { WebAnalyticsPreview } from './WebAnalyticsPreview'+import { webAnalyticsSetupLogic } from './webAnalyticsSetupLogic'++const HedgehogExplorer = pngHoggie(explorerPng)++/**+ * The web analytics setup screen. The web analytics scene shows its own dashboard from the first+ * pageview, so no scene gate uses this: the onboarding welcome page renders it for projects that+ * have not sent a pageview yet.+ */+export const webAnalyticsEmptyState: SceneProductEmptyState = {+ statusLogic: webAnalyticsSetupLogic,+ config: {+ productKey: ProductKey.WEB_ANALYTICS,+ productName: 'Web analytics',+ icon: <IconPieChart />,+ accentColor: 'var(--color-product-web-analytics-light)',+ accentColorDark: 'var(--color-product-web-analytics-dark)',+ hedgehog: HedgehogExplorer,+ text: {+ 'needs-setup': {+ headline: 'See where your visitors come from',+ lead: 'Visitors, top pages, channels, and bounce rate on one dashboard. It fills in from the pageviews posthog-js captures, so once PostHog is installed there is nothing else to configure.',+ },+ },+ primaryAction: {+ label: 'Open web analytics',+ to: urls.webAnalytics(),+ dataAttr: 'web-analytics-empty-state-open',+ },+ docsUrl: 'https://posthog.com/docs/web-analytics/getting-started',+ previewLabel: 'Example: your traffic, once pageviews arrive',+ Preview: WebAnalyticsPreview,+ skippable: false,+ },+}diff --git a/products/web_analytics/frontend/emptyState/webAnalyticsSetupLogic.test.ts b/products/web_analytics/frontend/emptyState/webAnalyticsSetupLogic.test.tsnew file mode 100644index 000000000000..7fd5ba0ce704--- /dev/null+++ b/products/web_analytics/frontend/emptyState/webAnalyticsSetupLogic.test.ts@@ -0,0 +1,26 @@+import { expectLogic } from 'kea-test-utils'++import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'++import { ProductKey } from '~/queries/schema/schema-general'+import { initKeaTests } from '~/test/init'++import { eventDefinitionsList } from 'products/event_definitions/frontend/generated/api'++import { webAnalyticsSetupLogic } from './webAnalyticsSetupLogic'++jest.mock('products/event_definitions/frontend/generated/api', () => ({ eventDefinitionsList: jest.fn() }))++describe('webAnalyticsSetupLogic', () => {+ it.each([+ [['$pageview'], 'has-data'],+ [['$web_vitals'], 'needs-setup'],+ [[], 'needs-setup'],+ ])('event definitions %j map to %s', async (definitions, expected) => {+ initKeaTests()+ ;(eventDefinitionsList as jest.Mock).mockResolvedValue({ results: definitions.map((name) => ({ name })) })+ webAnalyticsSetupLogic.mount()+ await expectLogic(webAnalyticsSetupLogic).toFinishAllListeners()+ expect(productSetupStatusLogic({ productKey: ProductKey.WEB_ANALYTICS }).values.status).toBe(expected)+ })+})diff --git a/products/web_analytics/frontend/emptyState/webAnalyticsSetupLogic.ts b/products/web_analytics/frontend/emptyState/webAnalyticsSetupLogic.tsnew file mode 100644index 000000000000..3ae341af9de9--- /dev/null+++ b/products/web_analytics/frontend/emptyState/webAnalyticsSetupLogic.ts@@ -0,0 +1,24 @@+import { createSetupDetectionLogic } from 'lib/components/ProductEmptyState/setupDetectionLogic'+import { teamLogic } from 'scenes/teamLogic'++import { ProductKey } from '~/queries/schema/schema-general'++import { eventDefinitionsList } from 'products/event_definitions/frontend/generated/api'++/** Web analytics needs nothing beyond posthog-js, so a `$pageview` event definition means it is set up. */+export const webAnalyticsSetupLogic = createSetupDetectionLogic({+ productKey: ProductKey.WEB_ANALYTICS,+ path: ['products', 'web_analytics', 'frontend', 'emptyState', 'webAnalyticsSetupLogic'],+ cacheHasData: true,+ // Users can delete the `$pageview` definition, so a cached answer is checked again.+ revalidateCachedHasData: true,+ detect: async () => {+ const teamId = teamLogic.findMounted()?.values.currentTeamId+ if (!teamId) {+ return 'unknown'+ }+ const response = await eventDefinitionsList(String(teamId), { names: ['$pageview'], limit: 1 })+ return response.results.some((definition) => definition.name === '$pageview') ? 'has-data' : 'needs-setup'+ },+ pollIntervalMs: 20000,+})diff --git a/products/web_analytics/frontend/emptyState/webVitalsEmptyState.tsx b/products/web_analytics/frontend/emptyState/webVitalsEmptyState.tsxdeleted file mode 100644index 74a7d3c1de22..000000000000--- a/products/web_analytics/frontend/emptyState/webVitalsEmptyState.tsx+++ /dev/null@@ -1,61 +0,0 @@-import * as drivingHogzillaPng from '@posthog/brand/hoggies/png/driving-hogzilla'-import { IconPieChart } from '@posthog/icons'--import { pngHoggie } from 'lib/brand/hoggies'-import type { SceneProductEmptyState } from 'lib/components/ProductEmptyState/types'-import { RestrictionScope } from 'lib/components/RestrictedArea'-import { TeamMembershipLevel } from 'lib/constants'-import { Scene } from 'scenes/sceneTypes'-import { teamLogic } from 'scenes/teamLogic'--import { ProductKey } from '~/queries/schema/schema-general'--import { WebVitalsPreview } from './WebVitalsPreview'-import { webVitalsSetupLogic } from './webVitalsSetupLogic'--const HedgehogDriving = pngHoggie(drivingHogzillaPng)--export const webVitalsEmptyState: SceneProductEmptyState = {- statusLogic: webVitalsSetupLogic,- // Only the web vitals tab has a setup state; the analytics tabs the same- // scene module serves are never gated.- scenes: [Scene.WebAnalyticsWebVitals],- config: {- productKey: ProductKey.WEB_ANALYTICS,- productName: 'Web vitals',- icon: <IconPieChart />,- accentColor: 'var(--color-product-web-analytics-light)',- accentColorDark: 'var(--color-product-web-analytics-dark)',- hedgehog: HedgehogDriving,- text: {- 'needs-setup': {- headline: 'Know how fast your site feels',- lead: 'Capture Core Web Vitals (LCP, CLS, INP, and FCP) from real visits and see which pages drag them down. Captured events count toward your event quota, and you can turn this off any time in settings.',- hint: 'Already sending pageviews with posthog-js? One click and vitals start flowing:',- },- 'waiting-for-data': {- headline: 'Autocapture is on. Waiting for the first vitals',- lead: 'Web vitals arrive with your next page visits. Open your site in another tab and the first samples show up here on their own.',- },- },- // Autocapture is already on in `waiting-for-data`, so the opt-in only belongs on the setup screen.- primaryAction: {- 'needs-setup': {- label: 'Enable web vitals autocapture',- onClick: () => {- teamLogic.findMounted()?.actions.updateCurrentTeam({ autocapture_web_vitals_opt_in: true })- },- // Same gate as the settings toggle that writes this field.- restriction: {- scope: RestrictionScope.Project,- minimumAccessLevel: TeamMembershipLevel.Admin,- },- // pinned: Playwright and autocapture dashboards select the old enable button by this attr- dataAttr: 'web-vitals-enable',- },- },- docsUrl: 'https://posthog.com/docs/web-analytics/web-vitals',- previewLabel: 'Your vitals, once samples arrive',- Preview: WebVitalsPreview,- },-}diff --git a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.ts b/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.tsdeleted file mode 100644index ee8a5e4b0414..000000000000--- a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.ts+++ /dev/null@@ -1,49 +0,0 @@-import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'--import { expectLogic } from 'kea-test-utils'--import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'--import { ProductKey } from '~/queries/schema/schema-general'-import { initKeaTests } from '~/test/init'-import type { TeamType } from '~/types'--import { eventDefinitionsList } from 'products/event_definitions/frontend/generated/api'--import { webVitalsSetupLogic } from './webVitalsSetupLogic'--jest.mock('products/event_definitions/frontend/generated/api', () => ({ eventDefinitionsList: jest.fn() }))--describe('webVitalsSetupLogic', () => {- // Guards the three-state mapping the web vitals gate hangs off: dropping the- // opt-in branch would show "enable autocapture" to already-enabled projects,- // and existing vitals must outrank the toggle.- it.each([- [true, false, 'has-data'],- [true, true, 'has-data'],- [false, true, 'waiting-for-data'],- [false, false, 'needs-setup'],- ])('definition=%s, optIn=%s maps to %s', async (hasDefinition, optIn, expected) => {- initKeaTests(true, { ...MOCK_DEFAULT_TEAM, autocapture_web_vitals_opt_in: optIn } as TeamType)- ;(eventDefinitionsList as jest.Mock).mockResolvedValue({- results: hasDefinition ? [{ name: '$web_vitals' }] : [],- })- webVitalsSetupLogic.mount()- await expectLogic(webVitalsSetupLogic).toFinishAllListeners()- expect(productSetupStatusLogic({ productKey: ProductKey.WEB_ANALYTICS }).values.status).toBe(expected)- })-- it('revalidates a cached has-data answer, since users can delete the $web_vitals definition', async () => {- initKeaTests(true, { ...MOCK_DEFAULT_TEAM, autocapture_web_vitals_opt_in: false } as TeamType)- ;(eventDefinitionsList as jest.Mock).mockResolvedValue({ results: [{ name: '$web_vitals' }] })- webVitalsSetupLogic.mount()- await expectLogic(webVitalsSetupLogic).toFinishAllListeners()- webVitalsSetupLogic.unmount()-- ;(eventDefinitionsList as jest.Mock).mockClear()- webVitalsSetupLogic.mount()- expect(productSetupStatusLogic({ productKey: ProductKey.WEB_ANALYTICS }).values.status).toBe('has-data')- await expectLogic(webVitalsSetupLogic).toFinishAllListeners()- expect(eventDefinitionsList).toHaveBeenCalled()- })-})diff --git a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.ts b/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.tsdeleted file mode 100644index 0eb3e36ba9f3..000000000000--- a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.ts+++ /dev/null@@ -1,36 +0,0 @@-import { createSetupDetectionLogic } from 'lib/components/ProductEmptyState/setupDetectionLogic'-import { teamLogic } from 'scenes/teamLogic'--import { ProductKey } from '~/queries/schema/schema-general'--import { eventDefinitionsList } from 'products/event_definitions/frontend/generated/api'--/**- * Setup detection for the web vitals empty state (the web vitals tab of web- * analytics - the analytics tabs are not gated). Three-state: a `$web_vitals`- * event definition exists → has-data; autocapture opted in without one yet →- * waiting-for-data; neither → needs-setup.- */-export const webVitalsSetupLogic = createSetupDetectionLogic({- productKey: ProductKey.WEB_ANALYTICS,- path: ['products', 'web_analytics', 'frontend', 'emptyState', 'webVitalsSetupLogic'],- cacheHasData: true,- revalidateCachedHasData: true,- detect: async () => {- const teamId = teamLogic.findMounted()?.values.currentTeamId- if (!teamId) {- return 'unknown'- }- const response = await eventDefinitionsList(String(teamId), { names: ['$web_vitals'], limit: 1 })- if (response.results.some((definition) => definition.name === '$web_vitals')) {- return 'has-data'- }- return teamLogic.findMounted()?.values.currentTeam?.autocapture_web_vitals_opt_in- ? 'waiting-for-data'- : 'needs-setup'- },- pollIntervalMs: 20000,- // Enabling autocapture (from this empty state or settings) must flip the- // screen to "waiting" right away, not on the next poll tick.- recheckActionTypes: () => [teamLogic.actionTypes.updateCurrentTeamSuccess],-})diff --git a/products/web_analytics/manifest.tsx b/products/web_analytics/manifest.tsxindex 3bff9009b998..3334aef8677c 100644--- a/products/web_analytics/manifest.tsx+++ b/products/web_analytics/manifest.tsx@@ -7,12 +7,10 @@ import { FileSystemIconColor, ProductManifest } from '../../frontend/src/types'export const manifest: ProductManifest = {name: 'Web Analytics',- // Boot-time approximation of webVitalsSetupLogic - this gates only the web- // vitals tab, not the analytics tabs. The in-scene check stays the source of- // truth (it also reads the autocapture opt-in for the waiting state).+ // Boot-time approximation of webAnalyticsSetupLogic.setupProbe: {productKey: ProductKey.WEB_ANALYTICS,- hasDataEvents: ['$web_vitals'],+ hasDataEvents: ['$pageview'],},urls: {webAnalytics: (): string => `/web`,diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex fe359c369bf9..f219706c5f9a 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -24925,6 +24925,8 @@ export namespace Schemas {is_first_party: boolean;/** Whether the user must choose to keep or disconnect this application, because it set up one of the user's organizations and PostHog has not verified it */requires_access_confirmation: boolean;+ /** Whether the application registered itself, through dynamic client registration or a client ID metadata document. MCP clients connect this way; applications PostHog registers do not. */+ is_self_registered: boolean;}/**@@ -70457,6 +70459,18 @@ export namespace Schemas {schema_name: string;}+ /**+ * * `legacy` - Default onboarding+ * * `simple` - Simple onboarding+ */+ export type OnboardingFlowVariantEnum = typeof OnboardingFlowVariantEnum[keyof typeof OnboardingFlowVariantEnum];+++ export const OnboardingFlowVariantEnum = {+ Legacy: 'legacy',+ Simple: 'simple',+ } as const;+/*** The first-run session that was started for the requester.*/@@ -70549,6 +70563,11 @@ export namespace Schemas {* @maxLength 64*/step_at_skip?: string;+ /** Which onboarding flow the user skipped from, for analytics only.+ *+ * * `legacy` - Default onboarding+ * * `simple` - Simple onboarding */+ flow_variant?: OnboardingFlowVariantEnum;}/**diff --git a/services/mcp/src/tools/links/app-url-manifest.json b/services/mcp/src/tools/links/app-url-manifest.jsonindex 75fc5ed222ce..8db28bc5f54e 100644--- a/services/mcp/src/tools/links/app-url-manifest.json+++ b/services/mcp/src/tools/links/app-url-manifest.json@@ -1309,6 +1309,11 @@"params": [],"scope": "project"},+ "onboardingWelcome": {+ "template": "/welcome",+ "params": [],+ "scope": "project"+ },"organizationBilling": {"template": "/organization/billing","params": [],@@ -1599,6 +1604,11 @@"params": [],"scope": "global"},+ "simpleOnboarding": {+ "template": "/onboarding/simple",+ "params": [],+ "scope": "project"+ },"site": {"template": "/site/{url}","params": ["url"],diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.jsonindex 79f8d9a64a5b..322982b6c964 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json@@ -13,7 +13,7 @@"type": "object"},"url": {- "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/analytics\n/analytics/all\n/analytics/mine\n/analytics/product-analytics\n/analytics/spaces\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/bi\n/bi/new\n/bi/{insightShortId}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/cross-project-dashboards\n/cross-project-dashboards/{id}\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}/ci-explorer\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error-tracking\n/error-tracking/alerts/new/{templateId}\n/error-tracking/alerts/{id}\n/error-tracking/fingerprint/{fingerprint}\n/error-tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scout-trials\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/metrics/dashboard-review\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/organization/legal\n/organization/startups\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/platform-alerts\n/platform-alerts/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/goal\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/goal\n/replay-vision/{id}/overview\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tools\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/verify_email\n/visual-review\n/visual-review/repos/{repoOwner}/{repoName}/flakiness\n/visual-review/repos/{repoOwner}/{repoName}/runs\n/visual-review/repos/{repoOwner}/{repoName}/runs/{runId}\n/visual-review/repos/{repoOwner}/{repoName}/snapshots\n/visual-review/repos/{repoOwner}/{repoName}/{runType}/snapshots/{identifier}\n/visual-review/runs/{runId}\n/visual-review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}",+ "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/analytics\n/analytics/all\n/analytics/mine\n/analytics/product-analytics\n/analytics/spaces\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/bi\n/bi/new\n/bi/{insightShortId}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/cross-project-dashboards\n/cross-project-dashboards/{id}\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}/ci-explorer\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error-tracking\n/error-tracking/alerts/new/{templateId}\n/error-tracking/alerts/{id}\n/error-tracking/fingerprint/{fingerprint}\n/error-tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scout-trials\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/metrics/dashboard-review\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/onboarding/simple\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/organization/legal\n/organization/startups\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/platform-alerts\n/platform-alerts/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/goal\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/goal\n/replay-vision/{id}/overview\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tools\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/verify_email\n/visual-review\n/visual-review/repos/{repoOwner}/{repoName}/flakiness\n/visual-review/repos/{repoOwner}/{repoName}/runs\n/visual-review/repos/{repoOwner}/{repoName}/runs/{runId}\n/visual-review/repos/{repoOwner}/{repoName}/snapshots\n/visual-review/repos/{repoOwner}/{repoName}/{runType}/snapshots/{identifier}\n/visual-review/runs/{runId}\n/visual-review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/welcome\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}","type": "string"}},