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.

fix(replay-vision): let the goal flow create a scanner with zero recent matches (#125790)

Kim Svatos Dugand726c0b8b656
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerGoalOverview.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerGoalOverview.tsx
index 55dfe1bcf20b..fe1af7aa92ad 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ScannerGoalOverview.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerGoalOverview.tsx
@@ -3,7 +3,7 @@ import { router } from 'kea-router'
import { useEffect, useState } from 'react'
import { TextMorph } from 'torph/react'
-import { IconInfo } from '@posthog/icons'
+import { IconInfo, IconWarning } from '@posthog/icons'
import { LemonBanner, LemonButton, LemonSkeleton, LemonSnack, LemonTag, Spinner, Tooltip } from '@posthog/lemon-ui'
import { formatPropertyLabel } from 'lib/components/PropertyFilters/utils'
@@ -312,9 +312,13 @@ export function ScannerGoalOverview({ scannerId }: { scannerId: string }): JSX.E
// A free-only scanner without its own cap can never bill, so it gets a credit count and a note instead of a cost.
const freeCreditsOnly = !!scanner.free_only && scanner.credit_limit == null
- const saveDisabledReason =
- getReplayVisionEditDisabledReason(scanner.user_access_level) ??
- (zeroMatches ? 'No recordings are eligible. Change the filter first.' : undefined)
+ // Zero recent matches only warns: a new project can have no recordings yet, and the scanner scans
+ // the matching recordings that arrive after it is created.
+ const saveDisabledReason = getReplayVisionEditDisabledReason(scanner.user_access_level)
+ const zeroMatchesWarning =
+ zeroMatches && !saveDisabledReason
+ ? `No recordings matched in the last ${pluralize(scannerEstimate.window_days, 'day')}. The scanner scans new matching recordings when they arrive.`
+ : undefined
// The recordings-first experiment arm reviews what the scanner watches before what it asks.
const askSection = (
@@ -380,7 +384,8 @@ export function ScannerGoalOverview({ scannerId }: { scannerId: string }): JSX.E
) : zeroMatches ? (
<LemonBanner type="warning">
No recordings match these filters for the last {pluralize(scannerEstimate.window_days, 'day')}.
- Change the filter, or the scanner may never run.
+ You can still create the scanner. It scans new matching recordings when they arrive. If you
+ expected matches, change the filter.
</LemonBanner>
) : scannerEstimate ? (
<div className="text-sm text-muted">
@@ -480,6 +485,8 @@ export function ScannerGoalOverview({ scannerId }: { scannerId: string }): JSX.E
onClick={() => submitScanner()}
loading={isScannerSubmitting}
disabledReason={saveDisabledReason}
+ icon={zeroMatchesWarning ? <IconWarning /> : undefined}
+ tooltip={zeroMatchesWarning}
data-attr="vision-goal-overview-create"
>
Create scanner