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.

feat(replay-vision): show example observations next to the drafted scanner (#113586)

Kim Svatos Dugane606d69fc4d9
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 6ed5eabc30f2..e9cdb067ff21 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -13277,17 +13277,17 @@ snapshots:
scenes-app-replay-vision--scanner-editor-goal-flow--light:
hash: v1.k794b7964.e47a57726a0631ab9c557b543ae744a7c54f542861d1163be8a893ab45cf8415.X-yyqBDmpTMOKm4dpRqyBdwU02uLLpDbphgFmBqVa5U
scenes-app-replay-vision--scanner-editor-goal-overview--dark:
- hash: v1.k794b7964.e6714595ba0ce82b0d2120120327e228824680238b822730da5737b64ca1377b.l4FiR3KFlfqccQNVs7_oxpENN8I0TGebcifFQU64ND4
+ hash: v1.k794b7964.f01ae73fc01d6f402ea1587d8fa62cd0195288283e5f02640a7d533b4ad09bfd.udZKrn75onISEkfnNqDPgFTA1zHMAm5n383-eNRdoPw
scenes-app-replay-vision--scanner-editor-goal-overview--light:
- hash: v1.k794b7964.1df9b72547fe7a33557154c0cdecca42849523ee3930aa02eaf674a99ff688b0.nCG6Ar0h6d71Y-exUY6xM4PYlI1RxHshkWu-f1IVTrI
+ hash: v1.k794b7964.9522d0cf5a021637d694e64b47499b3ea59b1f4190b418a3c956edd230bb6674.jMbMAjH6vT_UynFlvsCkdNSpKOI3kiY2sEvjaYd6458
scenes-app-replay-vision--scanner-editor-goal-overview-experiment--dark:
- hash: v1.k794b7964.bb23ed20fa34a412db9228dba2790feb2f2f4ea9a39353c5cf86db21e853746b.0kjhA7cqYlnGm1XT6TDODIphKatHsAykS0i3PVy7s4I
+ hash: v1.k794b7964.eb9e640621c319777e9d0f35160e175e5740430705ed29e2b00190a416916561.LnXPwb9D0h9JoDXETFIZmQ9mX_kexX838Nm7XfM33TA
scenes-app-replay-vision--scanner-editor-goal-overview-experiment--light:
- hash: v1.k794b7964.6eaedf34e715312cbca9d79b2d6e634630338edd3c75e54410f41f4ea633b1bd.vVF1dO7E1KQN60xV05xwLEBhM2_mwDB6rfPNDFLzPA4
+ hash: v1.k794b7964.d2d2658ddbf2aace36438d92fa5aa1689badeb9445c1c55322234d0e3a0d66ce.AMSsv3Q7mbqIiVnfFXikAe3a0i4NMkDGtc9JJc-ZE_U
scenes-app-replay-vision--scanner-editor-goal-overview-loading--dark:
- hash: v1.k794b7964.99201d1fcc588f17814fd36d77580993ae1af5aa4d0a61936b13be79fafbe826.2zmd7lGjTNlYy2ES__K7YR9BjisPNV3JWXMZICO6Rfc
+ hash: v1.k794b7964.bfb3f7c4a3b32b7aa090636568df7f158f48f08c78de444d35a5cc6bec4e94b6.56aJziWdamTTKgo5cUbmTCjJKmsI46FfoaDAJn3IDRM
scenes-app-replay-vision--scanner-editor-goal-overview-loading--light:
- hash: v1.k794b7964.5582e18627bc245ef9e9e85502d1d40afe8ec06e02d5f1f4410b795c97a69616.YkMhLUMo3Cn-ms_UNLkc94JjUFg3myjXCZnyZGzY9Qo
+ hash: v1.k794b7964.8270f22be1c71a97bec46c9def572f6c6c22b188dc08e27514529b24477be037.DmHAOu1zlwtBPfUXoFCcfFH-gxoE7QE_EXriVt2tJ7w
scenes-app-replay-vision--scanner-editor-triggers--dark:
hash: v1.k794b7964.5bc5dc77d7346163d92585657a949d38938bdbabf11a2a0341bc3a6b9c980c80.AL7y75QUTSwtUvG6XKJvD4CPhbEXC4TmNPkxG_57CQ4
scenes-app-replay-vision--scanner-editor-triggers--light:
diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
index c406714ad36f..6be0b304ca0d 100644
--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
@@ -45,6 +45,7 @@ import { ProductKey } from '~/queries/schema/schema-general'
import { CreditPriceNote } from '../components/PricingLink'
import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'
import { getReplayVisionEditDisabledReason } from '../utils/accessControl'
+import { ExampleObservations } from './components/ExampleObservations'
import { ScannerBudget } from './components/ScannerBudget'
import { ScannerGoalDraft } from './components/ScannerGoalDraft'
import { ScannerGoalFlow } from './components/ScannerGoalFlow'
@@ -230,8 +231,20 @@ export function ScannerEditorSceneComponent(): JSX.Element {
</>
)
) : step === 'overview' ? (
- <div className="max-w-4xl w-full mx-auto">
- <ScannerGoalOverview scannerId={scannerId} />
+ <div className="@container w-full">
+ <div className="grid grid-cols-1 @3xl:grid-cols-[minmax(0,1fr)_18rem] gap-6">
+ <ScannerGoalOverview scannerId={scannerId} />
+ {/* Outside the overview so it also shows while the draft generates, which
+ is when people have time to read what a scanner gives them. */}
+ <aside className="flex flex-col gap-2 @3xl:sticky @3xl:top-4 @3xl:self-start">
+ <div className="text-sm font-semibold">What you get</div>
+ <p className="text-xs text-secondary m-0">
+ For each recording it watches, the scanner writes an observation like these and
+ cites the moment it found.
+ </p>
+ <ExampleObservations compact />
+ </aside>
+ </div>
</div>
) : (
<Form
diff --git a/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsx b/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsx
new file mode 100644
index 000000000000..8465a27f1102
--- /dev/null
+++ b/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsx
@@ -0,0 +1,84 @@
+import { IconPlayFilled } from '@posthog/icons'
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { cn } from 'lib/utils/css-classes'
+
+interface ExampleClip {
+ scannerName: string
+ scannerType: string
+ headline: string
+ reason: string
+}
+
+/**
+ * Invented, not sampled. A reader with no scanners has no observations to preview, so these stand in
+ * for the shape of a card rather than for anything their project has recorded.
+ */
+const EXAMPLE_CLIPS: ExampleClip[] = [
+ {
+ scannerName: 'Checkout friction',
+ scannerType: 'Monitor',
+ headline: 'Repeated clicks on a payment button that stayed disabled',
+ reason: 'The scanner answered yes for this session.',
+ },
+ {
+ scannerName: 'Onboarding drop-off',
+ scannerType: 'Summarizer',
+ headline: 'Went back and forth between plans, then closed the tab',
+ reason: 'The scanner raised a UX friction signal from this session.',
+ },
+ {
+ scannerName: 'Search quality',
+ scannerType: 'Scorer',
+ headline: 'Three searches in a row, none of them opened',
+ reason: "Scored far from this scanner's recent average.",
+ },
+]
+
+export interface ExampleObservationsProps {
+ /** Stacks the thumbnail above the text, for a side column too narrow for the two side by side. */
+ compact?: boolean
+}
+
+/** Example observation cards, so a reader without observations of their own sees what a scanner produces. */
+export function ExampleObservations({ compact = false }: ExampleObservationsProps): JSX.Element {
+ return (
+ <div className="relative flex flex-col gap-2">
+ <p className="text-xs text-secondary m-0">Examples, not your data</p>
+ {EXAMPLE_CLIPS.map((clip) => (
+ <div
+ key={clip.scannerName}
+ className={cn(
+ 'flex border rounded bg-bg-light',
+ compact ? 'flex-col gap-2 p-3' : 'gap-4 items-start p-4'
+ )}
+ >
+ <div
+ className={cn(
+ 'flex-none rounded bg-surface-secondary flex items-center justify-center text-secondary',
+ compact ? 'w-full h-16' : 'w-40 h-24'
+ )}
+ >
+ <IconPlayFilled className="text-xl" />
+ </div>
+ <div className="min-w-0 flex flex-col gap-1">
+ <div className="flex flex-wrap gap-1">
+ <LemonTag type="highlight">Example</LemonTag>
+ <LemonTag type="muted">{clip.scannerName}</LemonTag>
+ <LemonTag type="muted">{clip.scannerType}</LemonTag>
+ </div>
+ <h4 className="text-sm font-semibold m-0">{clip.headline}</h4>
+ <p className="text-xs text-secondary m-0">{clip.reason}</p>
+ </div>
+ </div>
+ ))}
+ {/* The examples stand in for a feed the reader does not have, so the column fades into
+ the page instead of ending on a hard edge, which would read as a real feed cut
+ short. The stop is the scene background token, so the fade lands in both themes. */}
+ <div
+ aria-hidden
+ className="absolute inset-0 pointer-events-none bg-gradient-to-b from-transparent from-30% to-[var(--color-bg-primary)]"
+ />
+ </div>
+ )
+}
diff --git a/products/replay_vision/frontend/replay_scanners/components/WatchFeedIntro.tsx b/products/replay_vision/frontend/replay_scanners/components/WatchFeedIntro.tsx
index 975154bfb9fb..0e3b1bb85d75 100644
--- a/products/replay_vision/frontend/replay_scanners/components/WatchFeedIntro.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/WatchFeedIntro.tsx
@@ -1,40 +1,6 @@
-import { IconPlayFilled } from '@posthog/icons'
-import { LemonTag } from '@posthog/lemon-ui'
-
import { VisionDocsLink } from '../../components/DocsLink'
import { CreateScannerButton } from './CreateScannerButton'
-
-interface ExampleClip {
- scannerName: string
- scannerType: string
- headline: string
- reason: string
-}
-
-/**
- * Invented, not sampled. A reader with no scanners has no observations to preview, so these stand in
- * for the shape of a card rather than for anything their project has recorded.
- */
-const EXAMPLE_CLIPS: ExampleClip[] = [
- {
- scannerName: 'Checkout friction',
- scannerType: 'Monitor',
- headline: 'Repeated clicks on a payment button that stayed disabled',
- reason: 'The scanner answered yes for this session.',
- },
- {
- scannerName: 'Onboarding drop-off',
- scannerType: 'Summarizer',
- headline: 'Went back and forth between plans, then closed the tab',
- reason: 'The scanner raised a UX friction signal from this session.',
- },
- {
- scannerName: 'Search quality',
- scannerType: 'Scorer',
- headline: 'Three searches in a row, none of them opened',
- reason: "Scored far from this scanner's recent average.",
- },
-]
+import { ExampleObservations } from './ExampleObservations'
/**
* What the What to watch tab shows a reader who has no scanners: what the feed is for, an example of
@@ -61,32 +27,7 @@ export function WatchFeedIntro(): JSX.Element {
</div>
</div>
- <div className="relative flex flex-col gap-2">
- <p className="text-xs text-secondary m-0">Examples, not your data</p>
- {EXAMPLE_CLIPS.map((clip) => (
- <div key={clip.scannerName} className="flex gap-4 items-start border rounded bg-bg-light p-4">
- <div className="flex-none w-40 h-24 rounded bg-surface-secondary flex items-center justify-center text-secondary">
- <IconPlayFilled className="text-xl" />
- </div>
- <div className="min-w-0 flex flex-col gap-1">
- <div className="flex flex-wrap gap-1">
- <LemonTag type="highlight">Example</LemonTag>
- <LemonTag type="muted">{clip.scannerName}</LemonTag>
- <LemonTag type="muted">{clip.scannerType}</LemonTag>
- </div>
- <h4 className="text-sm font-semibold m-0">{clip.headline}</h4>
- <p className="text-xs text-secondary m-0">{clip.reason}</p>
- </div>
- </div>
- ))}
- {/* The examples stand in for a feed the reader does not have, so the column fades into
- the page instead of ending on a hard edge, which would read as a real feed cut
- short. The stop is the scene background token, so the fade lands in both themes. */}
- <div
- aria-hidden
- className="absolute inset-0 pointer-events-none bg-gradient-to-b from-transparent from-30% to-[var(--color-bg-primary)]"
- />
- </div>
+ <ExampleObservations />
</div>
)
}