: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): add in-app feedback survey buttons (#62262)
Kim Svatos Dugan51160a45dc99
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 1db5293e23b4..df46e7030c24 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5703,9 +5703,9 @@ snapshots:scenes-app-promoted-product--intent-with-product--light:hash: v1.k794b7964.a520d81ca3c66ae61e8fa10602ed5f40da3d97bee4efd9daf03009c238a8b0dc.Ruf-wJ_f_UjycVlKd7vE_z2t-r_SY8cC5bO-NSR0Ao4scenes-app-replay-vision--scanners-list--dark:- hash: v1.k794b7964.bcb104797b0216e5b8e55c80afd258ae30dc4a786c39baef05e6ad9a3097b2a8.uXVyFXWo6v9isQ-fI_HjB29MyvNjeIdWhK0Od7GnHfA+ hash: v1.k794b7964.799b429ca99dca7adb8cdd95f91e011bd63158763e8a16605da222f8523dc844.3Rnmy2I38dZUyEx1G59wDeho1bwV-oWF8EMtJIQmpeEscenes-app-replay-vision--scanners-list--light:- hash: v1.k794b7964.0b7623ca48d83996f9ce31902306ee592d919da1ba56ea19ca8e772b2af18036._WsfdWi3XlVh3J_dJXPFajxDOruRhYfBbDEsOBkQBh8+ hash: v1.k794b7964.7d5fe1b0fee217479a9ac2b87cf5bf86f167d246c88a136694706ff951866637.bY8VMFOdL1WFJqfU6IrUkYl1Y7k4_LcEjwHYTjHSS1cscenes-app-revenue-analytics--revenue-analytics-dashboard--dark:hash: v1.k794b7964.7c2a90fe3c3a969c054186bb666664efa891d65d411a546539a968518938ea71.OoOKh-Mc_IiPWTgIV4QNPtACZXPPktfU7bjGk-q-uLEscenes-app-revenue-analytics--revenue-analytics-dashboard--light:diff --git a/products/replay_vision/frontend/components/ReplayVisionFeedbackButton.tsx b/products/replay_vision/frontend/components/ReplayVisionFeedbackButton.tsxnew file mode 100644index 000000000000..3c8183655366--- /dev/null+++ b/products/replay_vision/frontend/components/ReplayVisionFeedbackButton.tsx@@ -0,0 +1,26 @@+import { LemonButton, LemonButtonProps } from '@posthog/lemon-ui'++import posthog from 'lib/posthog-typed'++/**+ * Feedback button for the Replay vision product. Clicking it captures the `replay_vision_feedback_clicked`+ * event, which triggers the Replay vision feedback survey (a popover) configured in PostHog.+ */+export function ReplayVisionFeedbackButton({+ label = 'Feedback',+ type,+}: {+ label?: string+ type?: LemonButtonProps['type']+} = {}): JSX.Element {+ return (+ <LemonButton+ size="small"+ type={type}+ tooltip="Share feedback on Replay vision"+ onClick={() => posthog.capture('replay_vision_feedback_clicked')}+ >+ {label}+ </LemonButton>+ )+}diff --git a/products/replay_vision/frontend/observations/ReplayObservation.tsx b/products/replay_vision/frontend/observations/ReplayObservation.tsxindex 829f365c75d9..51ac24e32b86 100644--- a/products/replay_vision/frontend/observations/ReplayObservation.tsx+++ b/products/replay_vision/frontend/observations/ReplayObservation.tsx@@ -29,6 +29,7 @@ import {readResult,} from '../components/ObservationCard'import { ObservationProgressBar } from '../components/ObservationProgressBar'+import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import {failureKindDescription,ineligibleKindDescription,@@ -181,6 +182,7 @@ export function ReplayObservationSceneComponent(): JSX.Element {name={scannerName}description={`Observation of session ${observation.session_id}`}resourceType={{ type: 'replay_vision' }}+ actions={<ReplayVisionFeedbackButton />}/><div className="grid grid-cols-1 lg:grid-cols-3 gap-4">diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsxindex dd87336ea750..48fb39701077 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx@@ -16,6 +16,7 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { ProductKey } from '~/queries/schema/schema-general'import { AccessControlLevel, AccessControlResourceType } from '~/types'+import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { visionQuotaLogic } from '../logics/visionQuotaLogic'import { QUOTA_WARN_THRESHOLD } from '../utils/quotaProjection'import { ScannerConfigReadonly } from './components/ScannerConfigReadonly'@@ -55,29 +56,32 @@ export function ReplayScannerSceneComponent(): JSX.Element {description={scanner.description}resourceType={{ type: 'replay_vision' }}actions={- <More- size="small"- overlay={- <LemonButton- status="danger"- fullWidth- onClick={() =>- LemonDialog.open({- title: `Delete "${scanner.name || 'Untitled scanner'}"?`,- description: 'This cannot be undone.',- primaryButton: {- children: 'Delete',- status: 'danger',- onClick: () => deleteScanner(),- },- secondaryButton: { children: 'Cancel' },- })- }- >- Delete- </LemonButton>- }- />+ <>+ <ReplayVisionFeedbackButton />+ <More+ size="small"+ overlay={+ <LemonButton+ status="danger"+ fullWidth+ onClick={() =>+ LemonDialog.open({+ title: `Delete "${scanner.name || 'Untitled scanner'}"?`,+ description: 'This cannot be undone.',+ primaryButton: {+ children: 'Delete',+ status: 'danger',+ onClick: () => deleteScanner(),+ },+ secondaryButton: { children: 'Cancel' },+ })+ }+ >+ Delete+ </LemonButton>+ }+ />+ </>}/>diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsxindex f7e5561f8fdf..d6f6655ce791 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx@@ -1,7 +1,7 @@import { useActions, useValues } from 'kea'import { router } from 'kea-router'-import { IconPencil, IconPlus, IconSearch, IconTrash } from '@posthog/icons'+import { IconPencil, IconPlus, IconRefresh, IconSearch, IconTrash } from '@posthog/icons'import { LemonButton, LemonInput, LemonSwitch, LemonTable, LemonTag, Link } from '@posthog/lemon-ui'import { AccessControlAction } from 'lib/components/AccessControlAction'@@ -20,6 +20,7 @@ import { ProductKey } from '~/queries/schema/schema-general'import { AccessControlLevel, AccessControlResourceType } from '~/types'import { FilterPill } from '../components/FilterPill'+import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { VisionMetrics } from './components/VisionMetrics'import { type ScannersSorting, SCANNERS_PAGE_SIZE, replayScannersLogic } from './replayScannersLogic'import {@@ -192,6 +193,7 @@ export function ReplayScannersScene(): JSX.Element {name="Replay vision"description="Set up AI scanners that automatically analyze new session recordings as they come in. Each result emits a queryable event."resourceType={{ type: 'replay_vision' }}+ actions={<ReplayVisionFeedbackButton />}/><ProductIntroduction@@ -234,6 +236,7 @@ export function ReplayScannersScene(): JSX.Element {className="max-w-sm"/><div className="ml-auto flex flex-wrap items-center gap-2">+ <ReplayVisionFeedbackButton label="Feedback?" type="tertiary" /><FilterPill<EnabledFilter>label="Status"options={ENABLED_OPTIONS}@@ -257,9 +260,14 @@ export function ReplayScannersScene(): JSX.Element {Clear filters</LemonButton>)}- <LemonButton type="secondary" onClick={() => loadScanners()} size="small">- Refresh- </LemonButton>+ <LemonButton+ type="secondary"+ size="small"+ icon={<IconRefresh />}+ tooltip="Refresh"+ onClick={() => loadScanners()}+ loading={scannersLoading}+ /></div></div>diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsxindex 5767a5c5595c..da283682a755 100644--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx@@ -24,6 +24,7 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { ProductKey } from '~/queries/schema/schema-general'+import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { ScannerTriggers } from './components/ScannerTriggers'import { ScannerTypeConfigEditor } from './components/ScannerTypeConfigEditor'import { replayScannerLogic } from './replayScannerLogic'@@ -84,7 +85,11 @@ export function ScannerEditorSceneComponent(): JSX.Element {<SceneContent><div className="flex flex-col items-center pt-16 pb-8"><div className="w-full max-w-4xl px-4 flex flex-col gap-6">- <SceneTitleSection name={title} resourceType={{ type: 'replay_vision' }} />+ <SceneTitleSection+ name={title}+ resourceType={{ type: 'replay_vision' }}+ actions={<ReplayVisionFeedbackButton />}+ /><ScannerEditorStepper currentStep={step} onStepClick={goToStep} stepErrors={stepErrors} /><Form logic={replayScannerLogic} props={{ id: scannerId }} formKey="scanner" enableFormOnSubmit><div className="bg-bg-light border rounded-lg shadow-sm p-6 flex flex-col gap-6 [&_.Field--error_.input-like]:!border-danger">