Skip to content

: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.

chore(replay-vision): retire stale feature flags and experiments (#111703)

Tue Haulundade04d1b7599
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 493055d53bdf..ab9531a28d97 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7966,10 +7966,6 @@ snapshots:
hash: v1.k794b7964.69acc2781af6db4a887b8cae0093a1b913fe5995e7b795fa4f0e3a7d4911cf08.knfck7uN_gIA4zEimD2w7UuhA09LwOpig0CWG6eGAuw
replay-tabs-home-success--second-recording-in-list--light:
hash: v1.k794b7964.ca5a857f71dd253cdf865a2555547945f3ee6e0c8267fdce3a0f68405608209a.ajJekZzCbHeYtB-T0URwjsqZKOULm_BioamuiXO5W7w
- replay-vision-analysis-nudge--default--dark:
- hash: v1.k794b7964.e21450a1b2054a36fab2a183fd4485190e7161c07830a04008b734f83ecabb1c.Hj2ygumZlfd2zAIz7tC6m7XoM-G15hY_amDmI_m-cJo
- replay-vision-analysis-nudge--default--light:
- hash: v1.k794b7964.7eff340ad050dbd7cf07813207e989e33fccb29ef9767e38f89d16b1d567017c.Kr8YaJd8YlDg3tPWTMYWt4vAxTb_HKQuhGUe4IKACDU
replay-vision-cited-markdown--hostile-links--dark:
hash: v1.k794b7964.d98b1851e8c4c695b87856379b85fd225d554c843086706f8d51fe5c060ad2d9.Nu73wfxltRa0Loo3i2L0DYIY_5NgIZwuP5RMTMyQGts
replay-vision-cited-markdown--hostile-links--light:
@@ -9786,10 +9782,6 @@ snapshots:
hash: v1.k794b7964.9b65251bcd4677987856d5856c908b4824dabc16727f74bef08997b28b511ae5.6KjiNo3mj5O1m9NHP9MjApuJCzZGaU6ENGFp5J6oI-A
scenes-app-errortracking--group-page-with-self-driving--light:
hash: v1.k794b7964.7163253868938e0d915a6a9a896531f5262e52a658135391569fb4dc2b0887a5.pdiZKwe3cMksN4hEXYQerkKZtPbr8_KNihl6M2aSgNg
- scenes-app-errortracking--group-page-with-vision-cross-sell--dark:
- hash: v1.k794b7964.f67b28c0a2246eab1d96f0b41915eb0b99b82f1adf53fcac949dcff512abf510.LDhSvTRRhv1sK6Bavubp1P25TSwPY6SlK07BD6PSmgU
- scenes-app-errortracking--group-page-with-vision-cross-sell--light:
- hash: v1.k794b7964.5f183e265c6e8e9fb9df2aa59814df96f4163f18af96129944721734d3369d30.aIY72vZeQnXM-bsqeR0Af4UC0ILTiZQuL-UelJjb_y4
scenes-app-errortracking--insights-page--dark:
hash: v1.k794b7964.547ba7d50edff3d4fd57c33937b1536edb9837c5c34fd57543b29a5fb257e848.V99ai7csLzzA-J4mPePBh5GIyIie_ulJCWMMU7bfioE
scenes-app-errortracking--insights-page--light:
@@ -12602,14 +12594,6 @@ snapshots:
hash: v1.k794b7964.07148958cd17ddb6f5e92153e6020b88a5c0faadd1d30453af7dcd3842efe1be.mbfalsNTUY56lRXxDljiT-ZQ19WP2LSF7Ngnn21lRsw
scenes-app-replay-vision--scanner-editor-configure--light:
hash: v1.k794b7964.441d1f2092c34a7b98fc0cca4ce039b03fa223acfa0955672a8200e9c4f1df69.iNQCuJrorTIeH3ontcAYe7EQOqQk76GpO_vVgGVzT0s
- scenes-app-replay-vision--scanner-editor-configure-lite-standard-pro--dark:
- hash: v1.k794b7964.c64f713375523d7ceb2ecede91d394caf0379f096ee9302e92d64e2de87514bb.L1skjowXVC5Yf3TLDthgxBXlzjvQZa6-i1ISygC3ZFY
- scenes-app-replay-vision--scanner-editor-configure-lite-standard-pro--light:
- hash: v1.k794b7964.397bf5513fa081897ffcac43eb0844a05d197c04e5a4f9e35ea8c83310e2d2df.e0Iddg_OnMKpq0RdZfhX1gUbhmpA7MFhevyls-TqHgk
- scenes-app-replay-vision--scanner-editor-configure-tier-names--dark:
- hash: v1.k794b7964.617d560964eee64beb4858b6864ea2fcda8f414b464b96a9f96d9806a7672cde.a6-JwVJ7LCDaPGEEg3NLnnLSMcqUj-sgRFvdAQ_4N0o
- scenes-app-replay-vision--scanner-editor-configure-tier-names--light:
- hash: v1.k794b7964.c7f71e1e378d2f2a6b13caf0a33b134b725d638896c952544b4683b5797d65da.vn0RAITVyyM1_eKd6fHDrQHWx-jR9kbn_iqq1jeBL3w
scenes-app-replay-vision--scanner-editor-details--dark:
hash: v1.k794b7964.b432270f77e7780bf7c0d1a0cbabfe3a6dcc4fcebbf2311f64a92f113f5ec8c2.N1ufgn3U8jNJTWVtd9YsSvOK6qxo8Kb-7Jkux2YeVdk
scenes-app-replay-vision--scanner-editor-details--light:
@@ -12654,14 +12638,6 @@ snapshots:
hash: v1.k794b7964.ce428f09777c68f7877231238a3e19ae7cc6b8768d6079b1382fe7ec65235d2f.GB1dNfKiEDNWWpYOg6CSWBL9VrQGoRo1jNn0UucRUtY
scenes-app-replay-vision--scanner-scouts-empty--light:
hash: v1.k794b7964.96bc080fa28fe04f239d200ce847119cde120c2ca985ff09b88d12b9447a03e8.rqHm0-oLrDHCJOuxqUbyDoKyiJtxvtyCkTGMlTmsiI4
- scenes-app-replay-vision--scanner-setup-lite-standard-pro--dark:
- hash: v1.k794b7964.01214733bf87360833d13c97d4f03a1ad2cbc1d80ac0bb5802395cd5a085e2b6.ScGeo--6ncL7f9N7rTRpx3_Fw4zXLPezqSunKkrp4LA
- scenes-app-replay-vision--scanner-setup-lite-standard-pro--light:
- hash: v1.k794b7964.48b5ade3f742b62525eede9e36a08937d739f08b921f2edce466546019eec9cd.dJx49fK4AIHMEwrDzYCVtCKuK3H73NcTGRH9Ru_QFtA
- scenes-app-replay-vision--scanner-setup-tier-names--dark:
- hash: v1.k794b7964.da789beb88e4cdb0146beb89a354915b86592ba176398a755b030d5fec09c834.Wg9tPp30WdEqLKf5nj3_zapyIpFgj8CjpNyNO79ZQUU
- scenes-app-replay-vision--scanner-setup-tier-names--light:
- hash: v1.k794b7964.40dac9914816882c2a7d77de705723bfd90094ca3af16dca603e0e5d1a5fda60.US_zz15OeP_p4i9xQJvAnDTi4WqPMbVeuKTY8wRgNjw
scenes-app-replay-vision--scanner-status-throttled--dark:
hash: v1.k794b7964.4f38e9093649330d8d9a87e2e6730e153a4592e832e20a0be6880105ae463a1f.b7I0bi116aXSjdoVZS2oGx603tzGNNsUHLSUHYbzYyA
scenes-app-replay-vision--scanner-status-throttled--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 35b1d76fb741..ef44c4d0ea1d 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -508,9 +508,7 @@ export const FEATURE_FLAGS = {
REPLAY_RECOMMENDED_RECORDINGS_FILTER_EXPERIMENT: 'replay-recommended-recordings-filter-experiment', // owner: @arnohillen #team-replay multivariate=control,test
REPLAY_TRIGGERS_V2: 'replay-triggers-v2', // owner: #team-replay
REPLAY_UI_REDESIGN_2026: 'replay-ui-redesign-2026', // owner: #team-replay, New UI layout for replay
- REPLAY_VISION_ANALYSIS_NUDGE: 'replay-vision-analysis-nudge', // owner: #team-replay, in-player nudge offering an AI-drafted scanner after analyzing several recordings
REPLAY_VISION_HOME_REDESIGN_EXPERIMENT: 'replay-vision-home-redesign-experiment', // owner: #team-replay multivariate=control,test — gate on === 'test'; a truthy check turns on for control too
- REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT: 'replay-vision-model-tier-naming-experiment', // owner: #team-replay multivariate=control,test,lite-standard-pro
REVAMPED_PY_NOTEBOOKS: 'revamped-py-notebooks', // owner: #team-data-tools
REVENUE_FIELDS_IN_POWER_USERS_TABLE: 'revenue-fields-in-power-users-table', // owner: @arthurdedeus #team-customer-analytics
REVIEW_HOG: 'review-hog', // owner: #team-devex, gates the Code review menu entry, scene, and API access
@@ -572,7 +570,6 @@ export const FEATURE_FLAGS = {
UNIFIED_APM_PRODUCT: 'unified-apm-product', // owner: #team-apm (@jonmcwest, @frankh), gates the shared APM product backing logs, tracing, and metrics
UX_HIDE_PROJECT_NOTICE: 'ux-hide-project-notice', // owner: #team-platform-ux, hides the project notice banner across all scenes
UX_REMOVE_SIDEPANEL: 'ux-remove-sidepanel', // owner: #team-surveys
- VISION_ENTRYPOINT_ERROR_TRACKING: 'vision-entrypoint-error-tracking', // owner: #team-replay, cross-sell entry point from the error tracking issue recording tab
VISION_ENTRYPOINT_EXPERIMENTS: 'vision-entrypoint-experiments', // owner: #team-replay, cross-sell entry points from experiments
VISION_ENTRYPOINT_REPLAY_FILTERS: 'vision-entrypoint-replay-filters', // owner: #team-replay, cross-sell entry point from the replay filters panel
VISION_GOAL_FLOW_V2: 'vision-goal-flow-v2', // owner: #team-replay multivariate=control,test — gate on === 'test'; a truthy check turns on for control too
diff --git a/frontend/src/lib/posthog-typed.ts b/frontend/src/lib/posthog-typed.ts
index ea01628a1ffa..a05c6391551a 100644
--- a/frontend/src/lib/posthog-typed.ts
+++ b/frontend/src/lib/posthog-typed.ts
@@ -3212,16 +3212,6 @@ interface EventSchemas {
'renewal pipeline closed won': Record<string, any>
'renewal pipeline onboarding': Record<string, any>
'renewal pipeline onboarding complete': Record<string, any>
- 'replay vision analysis nudge dismissed': {
- analyzed_count?: number
- }
- 'replay vision analysis nudge shown': {
- analyzed_count?: number
- }
- 'replay vision analysis nudge submitted': {
- analyzed_count?: number
- goal_length?: number
- }
'replayer error swallowed': Record<string, any>
'report ingestion third party plugin installed': Record<string, any>
'resource access level updated': Record<string, any>
diff --git a/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx b/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx
index 75780ada1faa..50130273508e 100644
--- a/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx
+++ b/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx
@@ -8,7 +8,6 @@ import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { MatchingEventsMatchType } from 'scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic'
-import { AnalysisNudge } from 'products/replay_vision/frontend/components/AnalysisNudge'
import { ObservationsDock } from 'products/replay_vision/frontend/components/ObservationsDock'
import { visionSurfaceShown } from 'products/replay_vision/frontend/utils/visionSurface'
@@ -113,17 +112,14 @@ function SessionRecordingPlayerInternal({
<div className="relative flex flex-col flex-1 min-w-0 min-h-0">
<PurePlayer noMeta={noMeta} noBorder={noBorder} />
{visionSurfaceShown(logicProps) && (
- <>
- <ObservationsDock
- // The player modal covers the side panel, so the conversation would open out of sight.
- extraActions={
- featureFlags[FEATURE_FLAGS.REPLAY_DEBUG_WITH_AI] && logicProps.playerKey !== 'modal' ? (
- <DebugReplayButton />
- ) : null
- }
- />
- <AnalysisNudge />
- </>
+ <ObservationsDock
+ // The player modal covers the side panel, so the conversation would open out of sight.
+ extraActions={
+ featureFlags[FEATURE_FLAGS.REPLAY_DEBUG_WITH_AI] && logicProps.playerKey !== 'modal' ? (
+ <DebugReplayButton />
+ ) : null
+ }
+ />
)}
</div>
{withSidebar && <PlayerSidebar />}
diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.test.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.test.ts
index f7f9e6588d57..0b00d31d782b 100644
--- a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.test.ts
+++ b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.test.ts
@@ -17,7 +17,6 @@ import { urls } from 'scenes/urls'
import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'
import { ExporterFormat, RecordingSegment, RecordingSnapshot, SessionPlayerState } from '~/types'
-import { analysisNudgeLogic } from 'products/replay_vision/frontend/logics/analysisNudgeLogic'
import { isUsableHeatmapUrl } from 'products/web_analytics/frontend/heatmaps/replayIframeData'
import { deletedRecordingsLogic } from '../deletedRecordingsLogic'
@@ -434,18 +433,11 @@ describe('sessionRecordingPlayerLogic', () => {
logic.unmount()
logic = sessionRecordingPlayerLogic({ sessionRecordingId: '2', playerKey: 'test', autoPlay: true })
logic.mount()
- const nudgeLogic = analysisNudgeLogic.build()
- nudgeLogic.mount()
silenceKeaLoadersErrors()
await expectLogic(logic).toDispatchActions([logic.actionTypes.setPlay, logic.actionTypes.markViewed])
- // The analyzed mark also feeds the replay vision analysis nudge counter.
- await expectLogic(nudgeLogic).toDispatchActions(['recordingAnalyzed'])
- expect(nudgeLogic.values.analyzedRecordingIds).toContain('2')
-
- nudgeLogic.unmount()
resumeKeaLoadersErrors()
})
diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts
index a603a42dda90..f593be2d3d67 100644
--- a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts
+++ b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts
@@ -82,7 +82,6 @@ import {
runnerPanelLogic,
} from 'products/posthog_ai/frontend/api/logics'
import { AttachedContextItem } from 'products/posthog_ai/frontend/api/types'
-import { analysisNudgeLogic } from 'products/replay_vision/frontend/logics/analysisNudgeLogic'
import {
MAX_REPLAY_IFRAME_HTML_CHARS,
ReplayIframeData,
@@ -3307,7 +3306,6 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>(
analyzed: true,
player_metadata: values.sessionPlayerMetaData,
})
- analysisNudgeLogic.findMounted()?.actions.recordingAnalyzed(props.sessionRecordingId)
},
setPause: () => {
actions.stopAnimation()
diff --git a/products/error_tracking/frontend/ErrorTracking.stories.tsx b/products/error_tracking/frontend/ErrorTracking.stories.tsx
index e62ac2401cdc..5e52a087917c 100644
--- a/products/error_tracking/frontend/ErrorTracking.stories.tsx
+++ b/products/error_tracking/frontend/ErrorTracking.stories.tsx
@@ -787,14 +787,6 @@ export const GroupPage: Story = {
parameters: { pageUrl: urls.errorTrackingIssue(ISSUE_ID) },
}
-export const GroupPageWithVisionCrossSell: Story = {
- name: 'Issue scene with Replay vision cross-sell',
- parameters: {
- pageUrl: urls.errorTrackingIssue(ISSUE_ID),
- featureFlags: [FEATURE_FLAGS.VISION_ENTRYPOINT_ERROR_TRACKING],
- },
-}
-
export const GroupPageManyAssignees: Story = {
name: 'Issue scene with many assignees',
parameters: { pageUrl: urls.errorTrackingIssue(ISSUE_ID) },
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
index 0d61981a5c45..672e2cef52e0 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
@@ -77,7 +77,6 @@ export function ErrorTrackingIssueScene(): JSX.Element {
const isMobile = isWindowLessThan('md')
const sceneMenuBarEnabled = useFeatureFlag('SCENE_MENU_BAR')
const hasIssueSplitting = useFeatureFlag('ERROR_TRACKING_ISSUE_SPLITTING')
- const visionCrossSellEnabled = useFeatureFlag('VISION_ENTRYPOINT_ERROR_TRACKING')
// Jump to the session replay list filtered to this issue. Captured so we can measure how often
// people watch recordings themselves, the baseline the Replay vision cross-sell is weighed against.
@@ -162,7 +161,7 @@ export function ErrorTrackingIssueScene(): JSX.Element {
<IconRewindPlay />
View recordings
</SceneMenuBarItem>
- {visionCrossSellEnabled && (
+ {issue.name && (
<SceneMenuBarItem
onClick={setUpVisionScanner}
data-attr="issue-menubar-scan-with-vision"
@@ -207,7 +206,7 @@ export function ErrorTrackingIssueScene(): JSX.Element {
disabled={issue.status != 'active'}
/>
</ButtonGroup>
- {visionCrossSellEnabled ? (
+ {issue.name ? (
<ButtonGroup>
<Button
variant="outline"
diff --git a/products/replay_vision/frontend/components/AnalysisNudge.stories.tsx b/products/replay_vision/frontend/components/AnalysisNudge.stories.tsx
deleted file mode 100644
index f84362232b7d..000000000000
--- a/products/replay_vision/frontend/components/AnalysisNudge.stories.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import type { Decorator, Meta, StoryObj } from '@storybook/react'
-import { useMountedLogic } from 'kea'
-import { useEffect, useRef } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-
-import { mswDecorator } from '~/mocks/browser'
-import { AccessControlLevel, AccessControlResourceType } from '~/types'
-
-import { ANALYSIS_NUDGE_THRESHOLD, analysisNudgeLogic } from '../logics/analysisNudgeLogic'
-import { AnalysisNudge } from './AnalysisNudge'
-
-// The nudge hides without scanner editor access; grant it on the storybook app context before
-// the story mounts and restore the original on unmount so story order can't leak. Persisted
-// suppressions are cleared here too, before the logic's persisted reducers read them on mount.
-const grantScannerAccess: Decorator = function GrantScannerAccess(Story): JSX.Element {
- const appContext = (window as any).POSTHOG_APP_CONTEXT
- const original = useRef<{ value: unknown }>()
- if (appContext && !original.current) {
- original.current = { value: appContext.resource_access_control }
- appContext.resource_access_control = {
- ...appContext.resource_access_control,
- [AccessControlResourceType.ReplayScanner]: AccessControlLevel.Editor,
- [AccessControlResourceType.SessionRecording]: AccessControlLevel.Editor,
- }
- localStorage.removeItem('products.replay_vision.frontend.logics.analysisNudgeLogic.suppressed')
- localStorage.removeItem('products.replay_vision.frontend.logics.analysisNudgeLogic.lastShownAt')
- }
- useEffect(
- () => () => {
- if (appContext && original.current) {
- appContext.resource_access_control = original.current.value
- }
- },
- [appContext]
- )
- return <Story />
-}
-
-const meta: Meta<typeof AnalysisNudge> = {
- title: 'Replay Vision/Analysis nudge',
- component: AnalysisNudge,
- decorators: [
- grantScannerAccess,
- // The nudge only shows for teams without scanners, checked against this endpoint.
- mswDecorator({
- get: {
- '/api/projects/:team_id/vision/scanners/': { count: 0, next: null, previous: null, results: [] },
- },
- }),
- ],
- parameters: {
- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_ANALYSIS_NUDGE]: true },
- },
-}
-export default meta
-
-function PrimedNudge(): JSX.Element {
- const logic = useMountedLogic(analysisNudgeLogic)
- useEffect(() => {
- for (let i = 0; i < ANALYSIS_NUDGE_THRESHOLD; i++) {
- logic.actions.recordingAnalyzed(`story-recording-${i}`)
- }
- }, [logic])
- return (
- // Stands in for the player area the card overlays in the app. An explicit width matters:
- // the card is absolutely positioned, so without one the wrapper collapses to its borders
- // and the visual-regression snapshot captures a 2px sliver instead of the card.
- <div className="relative h-80 w-160 border rounded">
- <AnalysisNudge />
- </div>
- )
-}
-
-export const Default: StoryObj = {
- render: () => <PrimedNudge />,
-}
diff --git a/products/replay_vision/frontend/components/AnalysisNudge.tsx b/products/replay_vision/frontend/components/AnalysisNudge.tsx
deleted file mode 100644
index 78e5e04bcd57..000000000000
--- a/products/replay_vision/frontend/components/AnalysisNudge.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-import { useActions, useValues } from 'kea'
-import { useState } from 'react'
-
-import { IconSparkles, IconX } from '@posthog/icons'
-import { LemonButton, LemonTextArea } from '@posthog/lemon-ui'
-
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
-import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
-import { urls } from 'scenes/urls'
-
-import { analysisNudgeLogic } from '../logics/analysisNudgeLogic'
-import { consumeGoalDraftIntent, markGoalDraftIntent } from '../replay_scanners/goalDraftIntent'
-import { getReplayVisionEditDisabledReason } from '../utils/accessControl'
-
-/** Card overlaying the player once the user has analyzed a few recordings this session:
- * collects what they're looking for and hands it to the scanner creation wizard's AI draft. */
-export function AnalysisNudge(): JSX.Element | null {
- const { nudgeVisible, goalInput } = useValues(analysisNudgeLogic)
- const { dismissNudge, setGoalInput, submitGoal } = useActions(analysisNudgeLogic)
- const { dataProcessingAccepted } = useValues(aiConsentLogic)
- // The exact goal that initiated the consent ask; approving submits this, not the live input,
- // so edits made while the popover is open can't be sent unvalidated (or blank).
- const [pendingConsentGoal, setPendingConsentGoal] = useState<string | null>(null)
-
- // Creating a scanner needs editor access, so users who couldn't finish the flow never see it.
- if (!nudgeVisible || getReplayVisionEditDisabledReason()) {
- return null
- }
-
- const handleSubmit = (): void => {
- const goal = goalInput.trim()
- if (!goal) {
- return
- }
- if (dataProcessingAccepted) {
- submitGoal(goal)
- } else {
- // Stored before the consent ask: approving can trigger a full-page SSO reauth that
- // unloads before onApprove runs, and on return the wizard (pendingRedirectUrl below)
- // picks the goal up from the hand-off instead of losing it.
- markGoalDraftIntent(goal)
- setPendingConsentGoal(goal)
- }
- }
-
- return (
- <div
- className="absolute bottom-16 right-4 z-10 w-80 rounded-lg border bg-bg-light shadow-md p-3 flex flex-col gap-2"
- data-attr="vision-analysis-nudge"
- >
- <div className="flex items-center gap-1.5">
- <IconSparkles className="text-ai size-4" />
- <span className="font-semibold text-sm flex-1">Looking for something specific?</span>
- <LemonButton
- size="xsmall"
- icon={<IconX />}
- onClick={dismissNudge}
- tooltip="Dismiss"
- data-attr="vision-analysis-nudge-dismiss"
- />
- </div>
- <p className="text-xs text-secondary mb-0">
- Tell PostHog AI what you're looking for and it'll set up a scanner that watches every new recording for
- it.
- </p>
- <LemonTextArea
- value={goalInput}
- onChange={setGoalInput}
- onPressEnter={handleSubmit}
- placeholder="e.g., Find sessions where users get stuck during onboarding"
- minRows={2}
- maxRows={4}
- data-attr="vision-analysis-nudge-input"
- />
- <AIConsentPopoverWrapper
- placement="top"
- showArrow
- ignoreDismissal
- hideTrainingDisclaimer
- hidden={pendingConsentGoal === null}
- pendingRedirectUrl={urls.replayVisionTemplates()}
- onApprove={() => {
- if (pendingConsentGoal) {
- submitGoal(pendingConsentGoal)
- }
- setPendingConsentGoal(null)
- }}
- onDismiss={() => {
- // Disarm the hand-off so a later wizard visit can't auto-start a draft the
- // user backed out of.
- consumeGoalDraftIntent()
- setPendingConsentGoal(null)
- }}
- >
- <LemonButton
- type="primary"
- size="small"
- fullWidth
- center
- onClick={handleSubmit}
- disabledReason={!goalInput.trim() ? 'Describe what the scanner should look for' : undefined}
- data-attr="vision-analysis-nudge-submit"
- >
- Create a scanner with AI
- </LemonButton>
- </AIConsentPopoverWrapper>
- </div>
- )
-}
diff --git a/products/replay_vision/frontend/logics/analysisNudgeLogic.test.ts b/products/replay_vision/frontend/logics/analysisNudgeLogic.test.ts
deleted file mode 100644
index 49200d15a0c6..000000000000
--- a/products/replay_vision/frontend/logics/analysisNudgeLogic.test.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-import { router } from 'kea-router'
-import { expectLogic } from 'kea-test-utils'
-import posthog from 'posthog-js'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { teamLogic } from 'scenes/teamLogic'
-import { urls } from 'scenes/urls'
-
-import { useMocks } from '~/mocks/jest'
-import { initKeaTests } from '~/test/init'
-import { AccessControlLevel, AccessControlResourceType } from '~/types'
-
-import { consumeGoalDraftIntent } from '../replay_scanners/goalDraftIntent'
-import { ANALYSIS_NUDGE_THRESHOLD, analysisNudgeLogic } from './analysisNudgeLogic'
-
-describe('analysisNudgeLogic', () => {
- let logic: ReturnType<typeof analysisNudgeLogic.build>
- let scannersSpy: jest.Mock
-
- const setFlagEnabled = (enabled: boolean): void => {
- featureFlagLogic.actions.setFeatureFlags(
- enabled ? [FEATURE_FLAGS.REPLAY_VISION_ANALYSIS_NUDGE] : [],
- enabled ? { [FEATURE_FLAGS.REPLAY_VISION_ANALYSIS_NUDGE]: true } : {}
- )
- }
-
- beforeEach(() => {
- // The suppression reducers persist to localStorage and the goal hand-off to
- // sessionStorage; isolate tests from each other.
- localStorage.clear()
- sessionStorage.clear()
- // Access control fails closed, and the shown capture is gated on scanner editor access.
- window.POSTHOG_APP_CONTEXT = {
- ...window.POSTHOG_APP_CONTEXT,
- resource_access_control: {
- [AccessControlResourceType.ReplayScanner]: AccessControlLevel.Editor,
- [AccessControlResourceType.SessionRecording]: AccessControlLevel.Editor,
- },
- } as any
- scannersSpy = jest.fn(() => [200, { count: 0, next: null, previous: null, results: [] }])
- useMocks({ get: { '/api/projects/:team/vision/scanners/': scannersSpy } })
- initKeaTests()
- teamLogic.mount()
- featureFlagLogic.mount()
- setFlagEnabled(true)
- logic = analysisNudgeLogic.build()
- logic.mount()
- })
-
- afterEach(() => {
- logic.unmount()
- })
-
- const analyzeUpToThreshold = (): void => {
- for (let i = 0; i < ANALYSIS_NUDGE_THRESHOLD; i++) {
- logic.actions.recordingAnalyzed(`recording-${i}`)
- }
- }
-
- it('shows only after enough unique recordings, so re-watching one never triggers it', async () => {
- logic.actions.recordingAnalyzed('recording-0')
- logic.actions.recordingAnalyzed('recording-0')
- for (let i = 1; i < ANALYSIS_NUDGE_THRESHOLD - 1; i++) {
- logic.actions.recordingAnalyzed(`recording-${i}`)
- }
- await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.nudgeVisible).toBe(false)
- expect(scannersSpy).not.toHaveBeenCalled()
-
- await expectLogic(logic, () =>
- logic.actions.recordingAnalyzed(`recording-${ANALYSIS_NUDGE_THRESHOLD - 1}`)
- ).toDispatchActions(['checkTeamScannersSuccess'])
- expect(logic.values.nudgeVisible).toBe(true)
- })
-
- it('stays hidden past the threshold when the feature flag is off', async () => {
- setFlagEnabled(false)
- analyzeUpToThreshold()
- await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.nudgeVisible).toBe(false)
- })
-
- it('stays hidden for a team already running scanners', async () => {
- scannersSpy.mockReturnValue([200, { count: 1, next: null, previous: null, results: [{ id: 'existing' }] }])
- await expectLogic(logic, analyzeUpToThreshold).toDispatchActions(['checkTeamScannersSuccess'])
- expect(logic.values.teamHasScanners).toBe(true)
- expect(logic.values.nudgeVisible).toBe(false)
- })
-
- it('captures shown once, not again for every further analyzed recording', async () => {
- const captureSpy = jest.spyOn(posthog, 'capture').mockImplementation(() => undefined as any)
- await expectLogic(logic, analyzeUpToThreshold).toDispatchActions(['checkTeamScannersSuccess'])
- logic.actions.recordingAnalyzed('recording-extra')
- await expectLogic(logic).toFinishAllListeners()
- const shownCalls = captureSpy.mock.calls.filter((call) => call[0] === 'replay vision analysis nudge shown')
- expect(shownCalls).toHaveLength(1)
- })
-
- it('a shown-but-ignored nudge stays hidden on the next mount, so ignoring is not re-pitched every session', async () => {
- await expectLogic(logic, analyzeUpToThreshold).toDispatchActions(['nudgeShown'])
- expect(logic.values.nudgeVisible).toBe(true)
-
- logic.unmount()
- logic = analysisNudgeLogic.build()
- logic.mount()
- analyzeUpToThreshold()
- await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.nudgeVisible).toBe(false)
- })
-
- it.each([
- ['dismissing', () => logic.actions.dismissNudge()],
- ['submitting', () => logic.actions.submitGoal('find rage clicks')],
- ])('%s suppresses the nudge even as more recordings are analyzed', async (_name, act) => {
- analyzeUpToThreshold()
- act()
- logic.actions.recordingAnalyzed('recording-after')
- await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.suppressed).toBe(true)
- expect(logic.values.nudgeVisible).toBe(false)
- })
-
- it('submitting hands the goal to the creation wizard via sessionStorage, never the URL', () => {
- analyzeUpToThreshold()
- logic.actions.submitGoal('find rage clicks in checkout')
- expect(router.values.location.pathname).toContain(urls.replayVisionTemplates())
- expect(router.values.searchParams.goal).toBeUndefined()
- expect(consumeGoalDraftIntent()).toEqual('find rage clicks in checkout')
- })
-})
diff --git a/products/replay_vision/frontend/logics/analysisNudgeLogic.ts b/products/replay_vision/frontend/logics/analysisNudgeLogic.ts
deleted file mode 100644
index 7821068b35d6..000000000000
--- a/products/replay_vision/frontend/logics/analysisNudgeLogic.ts
+++ /dev/null
@@ -1,265 +0,0 @@
-import {
- MakeLogicType,
- actions,
- afterMount,
- connect,
- kea,
- listeners,
- path,
- reducers,
- selectors,
- sharedListeners,
-} from 'kea'
-import type { BreakPointFunction } from 'kea'
-import { loaders } from 'kea-loaders'
-import { router } from 'kea-router'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import posthog from 'lib/posthog-typed'
-import { teamLogic } from 'scenes/teamLogic'
-import { urls } from 'scenes/urls'
-
-import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
-import { visionScannersList } from '../generated/api'
-import { markGoalDraftIntent } from '../replay_scanners/goalDraftIntent'
-import { getReplayVisionEditDisabledReason } from '../utils/accessControl'
-
-export const ANALYSIS_NUDGE_THRESHOLD = 5
-
-/** How long a shown-but-ignored nudge stays quiet. Dismissal and submission suppress forever;
- * ignoring is softer, so it re-pitches eventually rather than every qualifying session. */
-export const IGNORED_NUDGE_COOLDOWN_MS = 30 * 24 * 60 * 60 * 1000
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface analysisNudgeLogicValues {
- featureFlags: FeatureFlagsSet // featureFlagLogic
- analyzedRecordingIds: string[]
- cooldownActive: boolean
- goalInput: string
- lastShownAt: number | null
- nudgeVisible: boolean
- suppressed: boolean
- teamHasScanners: boolean | null
- teamHasScannersLoading: boolean
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface analysisNudgeLogicActions {
- checkTeamScanners: () => any
- checkTeamScannersFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- checkTeamScannersSuccess: (
- teamHasScanners: boolean | null,
- payload?: any
- ) => {
- teamHasScanners: boolean | null
- payload?: any
- }
- dismissNudge: () => {
- value: true
- }
- nudgeShown: () => {
- shownAt: number
- }
- recordingAnalyzed: (sessionRecordingId: string) => {
- sessionRecordingId: string
- }
- setCooldownActive: (active: boolean) => {
- active: boolean
- }
- setGoalInput: (goal: string) => {
- goal: string
- }
- submitGoal: (goal: string) => {
- goal: string
- }
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface analysisNudgeLogicMeta {
- sharedListeners: {
- reportShownIfVisible: (
- payload: any,
- breakpoint: BreakPointFunction,
- action: {
- type: string
- payload: any
- },
- previousState: any
- ) => void | Promise<void>
- }
- __keaTypeGenInternalSelectorTypes: {
- nudgeVisible: (
- analyzedRecordingIds: string[],
- suppressed: boolean,
- cooldownActive: boolean,
- teamHasScanners: boolean | null,
- featureFlags: FeatureFlagsSet
- ) => boolean
- }
-}
-
-export type analysisNudgeLogicType = MakeLogicType<
- analysisNudgeLogicValues,
- analysisNudgeLogicActions,
- Record<string, any>,
- analysisNudgeLogicMeta
->
-
-/** After a user analyzes a few recordings in one browser session, offers to turn what they're
- * looking for into a Replay Vision scanner via the AI goal-draft flow on the creation wizard. */
-export const analysisNudgeLogic = kea<analysisNudgeLogicType>([
- path(['products', 'replay_vision', 'frontend', 'logics', 'analysisNudgeLogic']),
- connect(() => ({ values: [featureFlagLogic, ['featureFlags']] })),
- actions({
- recordingAnalyzed: (sessionRecordingId: string) => ({ sessionRecordingId }),
- dismissNudge: true,
- nudgeShown: () => ({ shownAt: Date.now() }),
- setCooldownActive: (active: boolean) => ({ active }),
- setGoalInput: (goal: string) => ({ goal }),
- submitGoal: (goal: string) => ({ goal }),
- }),
- loaders({
- // A team already running scanners doesn't need the pitch. Null means "not checked yet"
- // and keeps the nudge hidden, so an API failure can never pitch such a team.
- teamHasScanners: [
- null as boolean | null,
- {
- checkTeamScanners: async () => {
- const teamId = teamLogic.findMounted()?.values.currentTeamId
- if (!teamId) {
- return null
- }
- try {
- const response = await visionScannersList(String(teamId), { limit: 1 })
- return (response.results ?? []).length > 0
- } catch {
- return null
- }
- },
- },
- ],
- }),
- reducers({
- // Unique ids so re-watching one recording doesn't count as hunting through several.
- analyzedRecordingIds: [
- [] as string[],
- {
- recordingAnalyzed: (state, { sessionRecordingId }) =>
- state.includes(sessionRecordingId) ? state : [...state, sessionRecordingId],
- },
- ],
- // Persisted so neither a dismissal nor a submission ever nags the same browser again.
- suppressed: [
- false,
- { persist: true },
- {
- dismissNudge: () => true,
- submitGoal: () => true,
- },
- ],
- // Persisted so a shown-but-ignored nudge counts against the cooldown across sessions.
- lastShownAt: [
- null as number | null,
- { persist: true },
- {
- nudgeShown: (_, { shownAt }) => shownAt,
- },
- ],
- // The cooldown is evaluated once at mount: recording a sighting mid-session must not
- // hide the card the user is currently reading.
- cooldownActive: [
- false,
- {
- setCooldownActive: (_, { active }) => active,
- },
- ],
- goalInput: ['', { setGoalInput: (_, { goal }) => goal }],
- }),
- selectors({
- nudgeVisible: [
- (s) => [s.analyzedRecordingIds, s.suppressed, s.cooldownActive, s.teamHasScanners, s.featureFlags],
- (
- analyzedRecordingIds: string[],
- suppressed: boolean,
- cooldownActive: boolean,
- teamHasScanners: boolean | null,
- featureFlags: Record<string, boolean | string | undefined>
- ): boolean => {
- // Reading the flags proxy reports exposure, so the read stays behind the other
- // guards: exposure has to cover exactly the users who qualified for the nudge.
- if (suppressed || cooldownActive || analyzedRecordingIds.length < ANALYSIS_NUDGE_THRESHOLD) {
- return false
- }
- // Strict false so both "team already runs scanners" and "not known yet" hide it.
- if (teamHasScanners !== false) {
- return false
- }
- return !!featureFlags[FEATURE_FLAGS.REPLAY_VISION_ANALYSIS_NUDGE]
- },
- ],
- }),
- sharedListeners(({ actions, cache, values }) => ({
- // Fires from both paths that can flip nudgeVisible to true: the analyzed count crossing
- // the threshold, and the async scanners check resolving after it.
- reportShownIfVisible: () => {
- // Mirrors the component's render guards so "shown" only fires when the card rendered.
- if (!values.nudgeVisible || cache.shownReported || getReplayVisionEditDisabledReason()) {
- return
- }
- cache.shownReported = true
- actions.nudgeShown()
- posthog.capture('replay vision analysis nudge shown', {
- analyzed_count: values.analyzedRecordingIds.length,
- })
- },
- })),
- listeners(({ actions, values, sharedListeners }) => ({
- recordingAnalyzed: [
- () => {
- // Checked lazily, only once a viewer qualifies, so plain replay watching never
- // fetches the scanner list.
- if (
- values.teamHasScanners === null &&
- !values.teamHasScannersLoading &&
- !values.suppressed &&
- !values.cooldownActive &&
- values.analyzedRecordingIds.length >= ANALYSIS_NUDGE_THRESHOLD
- ) {
- actions.checkTeamScanners()
- }
- },
- sharedListeners.reportShownIfVisible,
- ],
- checkTeamScannersSuccess: sharedListeners.reportShownIfVisible,
- dismissNudge: () => {
- posthog.capture('replay vision analysis nudge dismissed', {
- analyzed_count: values.analyzedRecordingIds.length,
- })
- },
- submitGoal: ({ goal }) => {
- posthog.capture('replay vision analysis nudge submitted', {
- analyzed_count: values.analyzedRecordingIds.length,
- goal_length: goal.length,
- })
- // The goal travels via the sessionStorage hand-off, never the URL: it is free text
- // that can contain customer emails or names, and a query param would land in
- // autocapture's $current_url, our own replay, and browser history. The wizard
- // consumes it on mount, prefills the AI box, and starts the draft, so all creation
- // gates (consent, estimate, quota) stay in force.
- markGoalDraftIntent(goal)
- router.actions.push(urls.replayVisionTemplates())
- },
- })),
- afterMount(({ actions, values }) => {
- if (values.lastShownAt !== null && Date.now() - values.lastShownAt < IGNORED_NUDGE_COOLDOWN_MS) {
- actions.setCooldownActive(true)
- }
- }),
-])
diff --git a/products/replay_vision/frontend/observations/ObservationDetails.tsx b/products/replay_vision/frontend/observations/ObservationDetails.tsx
index c72217710458..1b10ac3c08d0 100644
--- a/products/replay_vision/frontend/observations/ObservationDetails.tsx
+++ b/products/replay_vision/frontend/observations/ObservationDetails.tsx
@@ -1,4 +1,3 @@
-import { useValues } from 'kea'
import { useState } from 'react'
import { IconChevronRight } from '@posthog/icons'
@@ -6,15 +5,13 @@ import { Link } from '@posthog/lemon-ui'
import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'
import { TZLabel } from 'lib/components/TZLabel'
-import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { cn } from 'lib/utils/css-classes'
import { formatDurationMilliseconds } from 'lib/utils/durations'
import { urls } from 'scenes/urls'
import type { ReplayObservationApi } from '../generated/api.schemas'
-import { modelLabel, modelNamingVariant } from '../replay_scanners/types'
+import { modelLabel } from '../replay_scanners/types'
import { Fact, FactList } from './FactList'
function durationLabel(observation: ReplayObservationApi): string | null {
@@ -28,8 +25,6 @@ function durationLabel(observation: ReplayObservationApi): string | null {
export function ObservationDetails({ observation }: { observation: ReplayObservationApi }): JSX.Element {
const [expanded, setExpanded] = useState(false)
const snapshot = observation.scanner_snapshot
- const { featureFlags } = useValues(featureFlagLogic)
- const namingVariant = modelNamingVariant(featureFlags[FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT])
const duration = durationLabel(observation)
return (
@@ -87,7 +82,7 @@ export function ObservationDetails({ observation }: { observation: ReplayObserva
</Fact>
)}
{duration && <Fact label="Duration">{duration}</Fact>}
- {snapshot?.model && <Fact label="Model">{modelLabel(snapshot.model, namingVariant)}</Fact>}
+ {snapshot?.model && <Fact label="Model">{modelLabel(snapshot.model)}</Fact>}
</FactList>
)}
</div>
diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx
index d0a3aab96e80..6bf5344ccc40 100644
--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx
@@ -1299,24 +1299,6 @@ export const ScannerOnDemand: StoryObj = {
parameters: { pageUrl: `${urls.replayVision(summarizerScanner.id)}?tab=run` },
}
-// Test arms of the model tier-naming experiment: models labeled by capability tier instead of
-// provider names, as the Overview's Setup card shows them.
-export const ScannerSetupTierNames: StoryObj = {
- parameters: {
- pageUrl: urls.replayVision(summarizerScanner.id),
- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT]: 'test' },
- },
-}
-
-export const ScannerSetupLiteStandardPro: StoryObj = {
- parameters: {
- pageUrl: urls.replayVision(summarizerScanner.id),
- featureFlags: {
- [FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT]: 'lite-standard-pro',
- },
- },
-}
-
const digestScoutConfig = {
id: '00000000-0000-0000-0000-0000000000c1',
skill_name: 'signals-scout-daily-digest-confused-checkout',
@@ -1555,22 +1537,6 @@ export const ScannerEditorConfigure: StoryObj = {
parameters: { pageUrl: urls.replayVisionScannerConfigure(summarizerScanner.id) },
}
-export const ScannerEditorConfigureTierNames: StoryObj = {
- parameters: {
- pageUrl: urls.replayVisionScannerConfigure(summarizerScanner.id),
- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT]: 'test' },
- },
-}
-
-export const ScannerEditorConfigureLiteStandardPro: StoryObj = {
- parameters: {
- pageUrl: urls.replayVisionScannerConfigure(summarizerScanner.id),
- featureFlags: {
- [FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT]: 'lite-standard-pro',
- },
- },
-}
-
export const ScannerEditorTriggers: StoryObj = {
parameters: { pageUrl: urls.replayVisionScannerTriggers(summarizerScanner.id) },
}
@@ -1758,10 +1724,10 @@ export const ScannerEditorGoalOverviewExperiment: StoryObj = {
id: 11,
name: 'AI-based scanner creation',
description: 'Does the goal flow beat the template gallery?',
- feature_flag_key: 'vision-goal-based-creation-flow',
+ feature_flag_key: 'ai-scanner-creation-flow',
feature_flag: {
id: 11,
- key: 'vision-goal-based-creation-flow',
+ key: 'ai-scanner-creation-flow',
filters: {
multivariate: {
variants: [
diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
index eb082d9abe18..49a03679d03d 100644
--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
@@ -64,7 +64,7 @@ import {
scannerStepUrlWithParams,
} from './scannerEditorSceneLogic'
import { scannerSelfDrivingStatsLogic } from './scannerSelfDrivingStatsLogic'
-import { SCANNER_TYPE_OPTIONS, getModelOptions, modelNamingVariant } from './types'
+import { MODEL_OPTIONS, SCANNER_TYPE_OPTIONS } from './types'
const HedgehogConstruction2 = pngHoggie(construction2Png)
const HedgehogImTheDriver = pngHoggie(imTheDriverPng)
@@ -351,8 +351,6 @@ function ConfigureStep(): JSX.Element {
const { scanner, isNew, goalDraft } = useValues(replayScannerLogic({ id: scannerId }))
const { setScannerType } = useActions(replayScannerLogic({ id: scannerId }))
const { searchParams } = useValues(router)
- const { featureFlags } = useValues(featureFlagLogic)
- const namingVariant = modelNamingVariant(featureFlags[FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT])
const isTypeSelectable = isNew && !searchParams.template
if (!scanner) {
@@ -428,18 +426,10 @@ function ConfigureStep(): JSX.Element {
<div className="flex flex-col gap-1 items-start">
<LemonField name="model" label="Model" className="items-start">
- <LemonSelect
- className="max-w-full"
- value={scanner.model}
- options={getModelOptions(namingVariant)}
- />
+ <LemonSelect className="max-w-full" value={scanner.model} options={MODEL_OPTIONS} />
</LemonField>
- {/* The price line stays outside the variant branch so every arm of the model-naming experiment
- shows it. Tier names give even less of a cost anchor than provider model names do. */}
<div className="text-xs text-muted">
- {namingVariant
- ? 'Higher tiers tend to produce higher-quality observations, but cost more per observation.'
- : 'Newer models tend to produce higher-quality observations, but cost more per observation.'}{' '}
+ Newer models tend to produce higher-quality observations, but cost more per observation.{' '}
<CreditPriceNote dataAttr="vision-pricing-link-model-picker" />
</div>
</div>
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerSetupCard.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerSetupCard.tsx
index 94dbdc349416..95a562c43f26 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ScannerSetupCard.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerSetupCard.tsx
@@ -3,9 +3,7 @@ import { useValues } from 'kea'
import { LemonButton, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
-import { FEATURE_FLAGS } from 'lib/constants'
import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { percentage } from 'lib/utils/numbers'
import { urls } from 'scenes/urls'
@@ -13,7 +11,7 @@ import { LabeledRow } from '../../components/LabeledRow'
import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'
import { formatCreditCount } from '../../utils/credits'
import { replayScannerLogic } from '../replayScannerLogic'
-import { SCANNER_TYPE_OPTIONS, modelName, modelNamingVariant, scannerTypeLabel } from '../types'
+import { SCANNER_TYPE_OPTIONS, modelName, scannerTypeLabel } from '../types'
import { PromptPreview } from './PromptPreview'
import { ScannerRecordingFilters } from './ScannerRecordingFilters'
@@ -23,11 +21,9 @@ function EnabledText({ enabled }: { enabled: boolean }): JSX.Element {
export function ScannerSetupCard({ scannerId }: { scannerId: string }): JSX.Element | null {
const { scanner, experimentContext } = useValues(replayScannerLogic({ id: scannerId }))
- const { featureFlags } = useValues(featureFlagLogic)
if (!scanner) {
return null
}
- const namingVariant = modelNamingVariant(featureFlags[FEATURE_FLAGS.REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT])
const config = scanner.scanner_config
const targeting = scanner.experiment_targeting
@@ -60,7 +56,7 @@ export function ScannerSetupCard({ scannerId }: { scannerId: string }): JSX.Elem
{scannerTypeLabel(scanner.scanner_type)}
</span>
</Tooltip>{' '}
- · {modelName(scanner.model, namingVariant)}
+ · {modelName(scanner.model)}
</span>
{scanner.credits_per_observation != null && (
<span className="text-xs text-muted">
diff --git a/products/replay_vision/frontend/replay_scanners/goalDraftIntent.ts b/products/replay_vision/frontend/replay_scanners/goalDraftIntent.ts
deleted file mode 100644
index f76c765886bb..000000000000
--- a/products/replay_vision/frontend/replay_scanners/goalDraftIntent.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-const GOAL_DRAFT_INTENT_KEY = 'replay-vision.goal-draft-intent'
-
-/** One-shot hand-off of the in-player analysis nudge's goal to the creation wizard. The goal is
- * free text that can contain customer emails or names, so it travels via sessionStorage rather
- * than the URL, keeping it out of autocapture's $current_url, our own replay of our app, and
- * browser history. Only this channel auto-starts the AI draft, so a crafted external ?goal= link
- * can prefill the goal box but never spend the user's AI allowance on its own. */
-export function markGoalDraftIntent(goal: string): void {
- try {
- sessionStorage.setItem(GOAL_DRAFT_INTENT_KEY, goal)
- } catch {
- // Storage can be unavailable (private mode); the nudge then just opens the wizard blank.
- }
-}
-
-/** Reads and clears the hand-off. The wizard must call this on every entry, whichever prefill
- * path wins, so a hand-off can never stay armed for the rest of the tab session and auto-start
- * a draft from a later, unrelated wizard visit. */
-export function consumeGoalDraftIntent(): string | null {
- try {
- const goal = sessionStorage.getItem(GOAL_DRAFT_INTENT_KEY)
- sessionStorage.removeItem(GOAL_DRAFT_INTENT_KEY)
- return goal
- } catch {
- return null
- }
-}
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
index 41181bb45b74..92b87937f511 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
@@ -13,7 +13,6 @@ import { NodeKind } from '~/queries/schema/schema-general'
import { initKeaTests } from '~/test/init'
import { parseCsvParam, parseNumericParam, parseSortParam } from '../utils/urlParams'
-import { consumeGoalDraftIntent, markGoalDraftIntent } from './goalDraftIntent'
import {
buildObservationListParams,
ObservationStatusValue,
@@ -65,8 +64,8 @@ describe('replayScannerLogic', () => {
'/api/projects/:team/vision/scanners/draft/': draftSpy,
},
})
- // The draft layer persists form edits to localStorage and the nudge hand-off marker to
- // sessionStorage; without a reset, one test's state bleeds into the next.
+ // The draft layer persists form edits to localStorage and the cross-product hand-off
+ // marker to sessionStorage; without a reset, one test's state bleeds into the next.
localStorage.clear()
sessionStorage.clear()
initKeaTests()
@@ -330,54 +329,9 @@ describe('replayScannerLogic', () => {
expect(router.values.location.pathname).toEqual(pathBefore)
})
- // The in-player analysis nudge hands the goal to the wizard via a one-shot sessionStorage
- // hand-off that authorizes the auto-start; the free text never travels in the URL.
- it('consumes the nudge hand-off: prefills the box and starts the draft with the goal never in the URL', async () => {
- draftSpy.mockReturnValue([
- 200,
- { name: 'Rage clicks', description: '', scanner_type: 'monitor', scanner_config: { prompt: 'x' } },
- ])
- markGoalDraftIntent('find rage clicks in checkout')
- router.actions.push(urls.replayVisionScannerTemplate('new'))
-
- await expectLogic(logic, () => logic.actions.loadScanner())
- .toDispatchActions([
- logic.actionCreators.setGoalDraftInput('find rage clicks in checkout'),
- 'draftScannerFromGoal',
- ])
- .toFinishAllListeners()
-
- expect(draftSpy).toHaveBeenCalled()
- expect(router.values.searchParams.goal).toBeUndefined()
- expect(logic.values.scanner).toMatchObject({ name: 'Rage clicks' })
- expect(router.values.location.pathname).toContain(urls.replayVisionScannerDetails('new'))
- // One-shot: the entry consumed the hand-off, so a reload cannot re-fire the draft.
- expect(consumeGoalDraftIntent()).toBeNull()
- })
-
- // The hand-off is consumed on every wizard entry, even when another prefill path wins,
- // so it can't stay armed for the tab session and auto-start from a later ?goal= link.
- it('an entry that takes the experiment path still consumes the hand-off, so a later ?goal= link cannot auto-start', async () => {
- useMocks({
- get: {
- '/api/projects/:team/experiments/:id/': () => [200, { id: 7, name: 'Checkout redesign' }],
- },
- })
- markGoalDraftIntent('find rage clicks in checkout')
- router.actions.push(urls.replayVisionScannerTemplate('new'), { experiment: '7' })
- await expectLogic(logic, () => logic.actions.loadScanner()).toFinishAllListeners()
-
- router.actions.push(urls.replayVisionScannerTemplate('new'), { goal: 'find rage clicks in checkout' })
- await expectLogic(logic, () => logic.actions.loadScanner()).toFinishAllListeners()
-
- expect(logic.values.goalDraftInput).toEqual('find rage clicks in checkout')
- expect(draftSpy).not.toHaveBeenCalled()
- })
-
// Documented precedence with the ?filters= deep link (a fully built query): filters win,
// the free-text goal is dropped, regardless of which entry point built the URL.
it('an explicit ?filters= param outranks the goal prefill and drops it', async () => {
- markGoalDraftIntent('find rage clicks in checkout')
router.actions.push(urls.replayVisionScannerTemplate('new'), {
filters: JSON.stringify({ kind: 'RecordingsQuery' }),
goal: 'find rage clicks in checkout',
@@ -389,8 +343,8 @@ describe('replayScannerLogic', () => {
expect(draftSpy).not.toHaveBeenCalled()
})
- // A ?goal= link without the nudge's marker (e.g. crafted or shared) must not spend the
- // user's AI allowance on its own; it only prefills the box for an explicit click.
+ // A ?goal= link (e.g. crafted or shared) must not spend the user's AI allowance on its own;
+ // it only prefills the box for an explicit click.
it('a bare ?goal= param prefills the input without auto-starting the draft', async () => {
router.actions.push(urls.replayVisionScannerTemplate('new'), { goal: 'find rage clicks in checkout' })
@@ -401,23 +355,6 @@ describe('replayScannerLogic', () => {
expect(router.values.searchParams.goal).toBeUndefined()
})
- // The drafted scanner persists over the sole saved-draft slot, so auto-starting on top of
- // a restored draft would destroy the user's saved work without any action of theirs.
- it('a nudge hand-off over a saved draft restores the draft and does not auto-start', async () => {
- writeScannerDraft(MOCK_TEAM_ID, {
- ...logic.values.scanner!,
- name: 'My saved work',
- })
- markGoalDraftIntent('find rage clicks in checkout')
- router.actions.push(urls.replayVisionScannerTemplate('new'))
-
- await expectLogic(logic, () => logic.actions.loadScanner()).toFinishAllListeners()
-
- expect(logic.values.scanner).toMatchObject({ name: 'My saved work' })
- expect(logic.values.goalDraftInput).toEqual('find rage clicks in checkout')
- expect(draftSpy).not.toHaveBeenCalled()
- })
-
// A cross-product entry point (e.g. "scan this error's recordings" in error tracking)
// hands over a whole prefilled scanner via one-shot sessionStorage, so customer text in
// the name and prompt never enters the URL. It expresses fresh intent like the experiment
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
index 1f39eb04ab81..60b5ae07d129 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
@@ -75,7 +75,6 @@ import {
prefillScannerForExperiment,
reconcileVariantKey,
} from './experimentTargeting'
-import { consumeGoalDraftIntent } from './goalDraftIntent'
import { ReplayScannerTab } from './replayScannerSceneLogic'
import { clearScannerDraft, readScannerDraft, writeScannerDraft } from './scannerDraft'
import {
@@ -1740,12 +1739,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
typeof router.values.searchParams.goal === 'string'
? router.values.searchParams.goal.trim()
: ''
- // Consumed unconditionally on every wizard entry: whichever prefill path wins
- // below, a hand-off armed by the nudge must not stay usable for the rest of
- // the tab session, where a later ?goal= link would auto-start a draft and
- // spend the user's AI allowance without fresh intent.
- const handedOffGoal = consumeGoalDraftIntent()?.trim() ?? ''
- // Consumed unconditionally for the same reason: a cross-product hand-off must
+ // Consumed unconditionally on every wizard entry: a cross-product hand-off must
// not stay armed for the rest of the tab session and prefill a later,
// unrelated wizard visit.
const handoff = consumeScannerHandoffIntent()
@@ -1857,17 +1851,10 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
} finally {
cache.restoringDraft = false
}
- // The goal prefills the AI box; the draft only auto-starts for the in-player
- // nudge's sessionStorage hand-off (which carries the goal so the free text
- // never enters the URL), and never over a saved draft. A crafted external
- // ?goal= link can therefore neither spend the user's AI allowance nor
- // overwrite saved work without an explicit click.
- const goal = handedOffGoal || goalParam
- if (goal && !hasFiltersPrefill) {
- actions.setGoalDraftInput(goal)
- if (handedOffGoal && !draft) {
- actions.draftScannerFromGoal(handedOffGoal)
- }
+ // The goal only prefills the AI box, so a crafted external ?goal= link can neither
+ // spend the user's AI allowance nor overwrite saved work without an explicit click.
+ if (goalParam && !hasFiltersPrefill) {
+ actions.setGoalDraftInput(goalParam)
}
return
}
diff --git a/products/replay_vision/frontend/replay_scanners/types.test.ts b/products/replay_vision/frontend/replay_scanners/types.test.ts
index 9ce217c4fcc9..3fb7716bb0e8 100644
--- a/products/replay_vision/frontend/replay_scanners/types.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/types.test.ts
@@ -1,13 +1,4 @@
-import {
- type FailureKind,
- type ModelNamingVariant,
- failureRetryGuidance,
- getModelOptions,
- modelLabel,
- modelName,
- modelNamingVariant,
- observationRetryOffer,
-} from './types'
+import { type FailureKind, failureRetryGuidance, modelLabel, modelName, observationRetryOffer } from './types'
describe('scanner type helpers', () => {
describe('failureRetryGuidance', () => {
@@ -72,53 +63,14 @@ describe('scanner type helpers', () => {
})
describe('model naming', () => {
- // Every tier map satisfies the same type, so wiring the wrong map into an arm (a Gemini name
- // leaking into tier labels, or one scheme's labels into the other) would silently contaminate
- // the naming experiment's arms.
- it.each<[ModelNamingVariant | null, string[]]>([
- [
- null,
- [
- 'Gemini 3.5 Flash Lite · 2 credits/observation',
- 'Gemini 3 Flash · 5 credits/observation',
- 'Gemini 3.8 Flash · 15 credits/observation',
- ],
- ],
- [
- 'test',
- ['Basic · 2 credits/observation', 'Pro · 5 credits/observation', 'Ultra · 15 credits/observation'],
- ],
- [
- 'lite-standard-pro',
- ['Lite · 2 credits/observation', 'Standard · 5 credits/observation', 'Pro · 15 credits/observation'],
- ],
- ])('labels models for naming variant %s', (variant, labels) => {
- expect(getModelOptions(variant).map((o) => o.label)).toEqual(labels)
- })
-
- // The flag can serve values this build doesn't know (a new arm added before the frontend
- // deploys, control, or a plain boolean); all of them must degrade to provider names, never
- // to a tier scheme, or the control arm gets contaminated.
- it.each<[unknown, ModelNamingVariant | null]>([
- ['test', 'test'],
- ['lite-standard-pro', 'lite-standard-pro'],
- ['control', null],
- ['some-future-arm', null],
- [true, null],
- [undefined, null],
- ])('narrows flag value %p to naming variant %p', (flagValue, expected) => {
- expect(modelNamingVariant(flagValue)).toBe(expected)
- })
-
it('falls back to the raw id for retired models frozen in old observation snapshots', () => {
- expect(modelLabel('gemini-1.5-retired', 'test')).toBe('gemini-1.5-retired')
- expect(modelLabel('gemini-1.5-retired', null)).toBe('gemini-1.5-retired')
+ expect(modelLabel('gemini-1.5-retired')).toBe('gemini-1.5-retired')
})
// A model leaving the lineup must not turn every past observation's label into a raw slug.
it.each(['gemini-3.7-flash', 'gemini-3.6-flash'])('still names retired model %s', (model) => {
- expect(modelLabel(model, null)).toContain('Flash')
- expect(modelName(model, 'test')).toContain('Flash')
+ expect(modelLabel(model)).toContain('Flash')
+ expect(modelName(model)).toContain('Flash')
})
})
})
diff --git a/products/replay_vision/frontend/replay_scanners/types.ts b/products/replay_vision/frontend/replay_scanners/types.ts
index e87e75dd1ebf..106f1179b8e4 100644
--- a/products/replay_vision/frontend/replay_scanners/types.ts
+++ b/products/replay_vision/frontend/replay_scanners/types.ts
@@ -302,7 +302,7 @@ const MODEL_NAMES: Record<ScannerModelEnumApi, string> = {
}
// Names for models dropped from the lineup, so an observation frozen against one still reads as a
-// product name instead of a raw id. Tier arms keep provider names here: no tier claim survives retirement.
+// product name instead of a raw id.
const RETIRED_MODEL_NAMES: Record<string, string> = {
'gemini-3.7-flash': 'Gemini 3.7 Flash',
'gemini-3.6-flash': 'Gemini 3.6 Flash',
@@ -317,57 +317,27 @@ export function homeRedesignVariant(flagValue: unknown): HomeRedesignVariant | n
return flagValue === 'control' || flagValue === 'test' ? flagValue : null
}
-// Tier-name arms of the replay-vision-model-tier-naming-experiment flag: capability tiers instead
-// of provider model names, keyed by the flag's variant key. Every surface that shows a model must
-// resolve the variant the same way so a user never sees mixed naming schemes for one scanner.
-export type ModelNamingVariant = 'test' | 'lite-standard-pro'
-
-const MODEL_TIER_NAMES: Record<ModelNamingVariant, Record<ScannerModelEnumApi, string>> = {
- test: {
- [ScannerModelEnumApi.Gemini35FlashLite]: 'Basic',
- [ScannerModelEnumApi.Gemini3FlashPreview]: 'Pro',
- [ScannerModelEnumApi.Gemini38Flash]: 'Ultra',
- },
- 'lite-standard-pro': {
- [ScannerModelEnumApi.Gemini35FlashLite]: 'Lite',
- [ScannerModelEnumApi.Gemini3FlashPreview]: 'Standard',
- [ScannerModelEnumApi.Gemini38Flash]: 'Pro',
- },
-}
-
-// Narrows a raw flag value to a naming variant. Control, booleans, and variant keys this build
-// doesn't know yet all resolve to null (provider model names), so a flag/frontend version skew
-// degrades to the control experience instead of mislabeling an arm.
-export function modelNamingVariant(flagValue: unknown): ModelNamingVariant | null {
- return typeof flagValue === 'string' && flagValue in MODEL_TIER_NAMES ? (flagValue as ModelNamingVariant) : null
-}
-
-export function getModelOptions(
- namingVariant: ModelNamingVariant | null
-): { value: ScannerModelEnumApi; label: string }[] {
- return Object.values(ScannerModelEnumApi).map((value) => ({
+export const MODEL_OPTIONS: { value: ScannerModelEnumApi; label: string }[] = Object.values(ScannerModelEnumApi).map(
+ (value) => ({
value,
- label: `${modelName(value, namingVariant)} · ${formatCreditCount(OBSERVATION_CREDITS_BY_MODEL[value])}/observation`,
- }))
-}
+ label: `${MODEL_NAMES[value]} · ${formatCreditCount(OBSERVATION_CREDITS_BY_MODEL[value])}/observation`,
+ })
+)
// Falls back to the raw id for models retired before they were named here.
-export function modelLabel(model: string | null | undefined, namingVariant: ModelNamingVariant | null = null): string {
+export function modelLabel(model: string | null | undefined): string {
if (!model) {
return '—'
}
- return (
- getModelOptions(namingVariant).find((opt) => opt.value === model)?.label ?? RETIRED_MODEL_NAMES[model] ?? model
- )
+ return MODEL_OPTIONS.find((opt) => opt.value === model)?.label ?? RETIRED_MODEL_NAMES[model] ?? model
}
/** Plain model name without the price suffix, for surfaces that show the price separately. */
-export function modelName(model: string | null | undefined, namingVariant: ModelNamingVariant | null = null): string {
+export function modelName(model: string | null | undefined): string {
if (!model) {
return '—'
}
- const names = namingVariant ? MODEL_TIER_NAMES[namingVariant] : MODEL_NAMES
- return names[model as ScannerModelEnumApi] ?? RETIRED_MODEL_NAMES[model] ?? model
+ return MODEL_NAMES[model as ScannerModelEnumApi] ?? RETIRED_MODEL_NAMES[model] ?? model
}
/** Fallback name for a scanner the user never named, e.g. "Hedgebox classifier". */