: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(replay-vision): surface scanner templates in the goal-based flow (#101325)
Kim Svatos Dugan8e3a23526c5c
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex de1b864f6582..30615175cd66 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -9605,9 +9605,9 @@ snapshots:scenes-app-replay-vision--scanner-editor-details--light:hash: v1.k794b7964.fc73906f3b66cea6854d196cbe65bf5e8a3586447dc9f56ba14490e9de8a3c1c.P1hBJpz_cfTllUtTdJSrgFOPNdIC106H6eAl0hswbCQscenes-app-replay-vision--scanner-editor-goal-flow--dark:- hash: v1.k794b7964.01e74d02bd3a9b91238032d92b59dc625c4533e25368a447a9981e84ca7f6497.6x8gPcdWdR5iYJWuJU4x6pGkreBIyozVkudsbJEJqro+ hash: v1.k794b7964.4f713baaac755abc276c4b8c73ef52a9e7d782d5daa7a3ecfe85da78c42c0b24.cCsTK5Amd519GiU8JGw5K4KufEBosM1gSXzOssc65mUscenes-app-replay-vision--scanner-editor-goal-flow--light:- hash: v1.k794b7964.57c4ffe514b4843a8cc3e5926c6ad3405b8050cc815e145b6218b0d8a2972e34.Zz-O4ewSTvBQAFZYRjUnNROD1yz9krDk7IXR-9pKclU+ hash: v1.k794b7964.4e016e86a155fea0300d1c6fec4e4d2d11c4502f9865ece9839056862b8e79fc.imLVOUpY09Gjo2rHMmKHmmu1D0OR_PzdSsQWaPgmOksscenes-app-replay-vision--scanner-editor-goal-overview--dark:hash: v1.k794b7964.4ef60f727ace235099b7180e0b8e6e96a81e3626ce2ccae46f74c29508f85c15.Mp6FnYUKmqMQBB2sni9IukHvqlxQSXt5l1F91H6F8Zgscenes-app-replay-vision--scanner-editor-goal-overview--light:@@ -9617,9 +9617,9 @@ snapshots:scenes-app-replay-vision--scanner-editor-goal-overview-experiment--light:hash: v1.k794b7964.6eaedf34e715312cbca9d79b2d6e634630338edd3c75e54410f41f4ea633b1bd.vVF1dO7E1KQN60xV05xwLEBhM2_mwDB6rfPNDFLzPA4scenes-app-replay-vision--scanner-editor-goal-overview-loading--dark:- hash: v1.k794b7964.a94f2025953ab7473f0483ea7f6cdd85de331d729b117eecd0b2d95ec0158ca5.Bvp5Vh_dIzetAM4rH8iV6SGeAN1R9dmqEl7v5e5PJUU+ hash: v1.k794b7964.7230ea3eab0869f5a8f86849383f3e04194551a3afcc074a50b1397b46a2b375.zj1EqjarBjVHCpotlMJ9paSjR9AuCTzOUFbMGckAQBYscenes-app-replay-vision--scanner-editor-goal-overview-loading--light:- hash: v1.k794b7964.08677286d79894d0b435378a498bf343806adc41dfe5688ab95836bd9f25262c.5ZUh6xUU-lD1BhpTkRRBz-sPx6g5EqcTb80fUAhThSE+ hash: v1.k794b7964.0d734d87e1105b4e24c9bb56cda230512228305903f7011d87565a9e8eccd3a7.A5dFxW7Ss-kphe3r11EfHJQgb5X8nxEjOLGxPya1BD8scenes-app-replay-vision--scanner-editor-triggers--dark:hash: v1.k794b7964.5bc5dc77d7346163d92585657a949d38938bdbabf11a2a0341bc3a6b9c980c80.AL7y75QUTSwtUvG6XKJvD4CPhbEXC4TmNPkxG_57CQ4scenes-app-replay-vision--scanner-editor-triggers--light:@@ -10559,7 +10559,7 @@ snapshots:scenes-other-onboarding-legacy--ai-observability-sdk-install-with-cloud-run-flag--dark:hash: v1.k794b7964.0c82a4b8b276a3f51b42dd3a20aed7672fbfb5f096e4bd9da51221b6eb52bbdc.mNBXA38xho8_capLIbeLCS22SJlBdDCCYmsl30jy3bIscenes-other-onboarding-legacy--ai-observability-sdk-install-with-cloud-run-flag--light:- hash: v1.k794b7964.57d23129f793fa3865ca4b69934324fb3fe40f3a61b0117aca3078ab2994b6d8.dCLPekVRS1NAAYJDZx1vljuojZMNCbiNW2DXLnnRtfA+ hash: v1.k794b7964.c369e4056eb19ceb37679e5bff4592d0ba3482bd828af31407f71c3b0859928d.t4vng4f1N8iOH1AepRjY7n0vDc1fAH8Yy21NP6xzAhYscenes-other-onboarding-legacy--alerts--dark:hash: v1.k794b7964.c22b202da34ceea01a9dc7162520e35f2366b891dc31dfef3f4cc1c02a732925.NcL-srF2HqgOaQZS2T1bWylckrTCHkBSYe72zVWgpIwscenes-other-onboarding-legacy--alerts--light:diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsxindex 2f53370ef640..ec413b5f9bea 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx@@ -1020,8 +1020,8 @@ export const StartupProgramCap: StoryObj = {],}-// The goal-based creation flow's two questions replace the template gallery when the flag's test-// variant is on.+// The goal-based creation flow when the flag's test variant is on: the two questions (goal, budget)+// lead, with the template gallery kept below them as a start-from-a-template alternative.export const ScannerEditorGoalFlow: StoryObj = {parameters: {pageUrl: urls.replayVisionScannerTemplate('new'),diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsxindex 6f5e6472c4ce..10cc091f50c3 100644--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx@@ -112,7 +112,6 @@ export function ScannerEditorSceneComponent(): JSX.Element {const { featureFlags } = useValues(featureFlagLogic)// Multivariate flag; a truthy check would turn the goal flow on for control too.const goalFlow = featureFlags[FEATURE_FLAGS.VISION_GOAL_BASED_CREATION_FLOW] === 'test'- const [manualMode, setManualMode] = useState(false)// Read once on mount, because the wizard strips the deep-link params as soon as it consumes them.const [experimentDeepLink] = useState(() => parseExperimentScannerParams(router.values.searchParams) !== null)// Reached a form step by clicking Edit on the goal overview: the overview is home, not a wizard@@ -138,7 +137,7 @@ export function ScannerEditorSceneComponent(): JSX.Element {// user restate it, so those entries get the template picker with the prefill already applied.// Only the deep link decides this. A context that arrives later (the experiment fetch, or a// restored draft that carries targeting) would swap the layout under someone already typing.- const showGoalEntry = step === 'template' && goalFlow && !manualMode && !experimentDeepLink+ const showGoalEntry = step === 'template' && goalFlow && !experimentDeepLinkif (step !== 'template' && (scannerLoading || !scanner)) {return (@@ -217,7 +216,7 @@ export function ScannerEditorSceneComponent(): JSX.Element {for you to review.</p></div>- <ScannerGoalFlow onManual={() => setManualMode(true)} />+ <ScannerGoalFlow /></>) : (<>diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsxindex 3e6c3b15ab2a..2e72f9a703d1 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx@@ -2,7 +2,7 @@ import { useActions, useValues } from 'kea'import { useState } from 'react'import { IconSparkles } from '@posthog/icons'-import { LemonButton, LemonInput, LemonTextArea, Link } from '@posthog/lemon-ui'+import { LemonButton, LemonInput, LemonTextArea } from '@posthog/lemon-ui'import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'@@ -10,6 +10,7 @@ import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPimport { getReplayVisionEditDisabledReason } from '../../utils/accessControl'import { creditsToUsd } from '../../utils/credits'import { replayScannerLogic } from '../replayScannerLogic'+import { ScannerTemplatePicker } from './ScannerTemplatePicker'// Credits, not recordings: the agent picks the model, so a fixed recording count no longer maps to// a fixed cost. The budget is what the user actually controls, and matches how we bill.@@ -17,8 +18,9 @@ const MIN_SCAN_BUDGET = 1const MAX_SCAN_BUDGET = 100000000/** The goal-based creation flow's two questions (goal, monthly budget): drafts a full scanner- * and lands the user on the overview step to review it. */-export function ScannerGoalFlow({ onManual }: { onManual: () => void }): JSX.Element {+ * and lands the user on the overview step to review it. The templates sit below, so someone who+ * would rather start from a pre-built scanner than describe a goal can see that option up front. */+export function ScannerGoalFlow(): JSX.Element {const logic = replayScannerLogic({ id: 'new' })const { goalDraftInput, goalBudgetInput, goalDraftLoading, experimentContext } = useValues(logic)const { draftScannerFromGoal, setGoalDraftInput, setGoalBudgetInput } = useActions(logic)@@ -148,10 +150,9 @@ export function ScannerGoalFlow({ onManual }: { onManual: () => void }): JSX.Ele<div className="flex-1 border-t border-border" /></div>- <div className="text-center">- <Link onClick={onManual} data-attr="vision-goal-flow-manual">- Set it up manually- </Link>+ <div className="flex flex-col gap-3">+ <p className="text-center text-sm text-muted m-0">Start from a template</p>+ <ScannerTemplatePicker /></div></div>)