: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): link pricing wherever credits are shown (#82762)
coryslater479395eecba8
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex c66a63620713..0836afdbb51f 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7349,9 +7349,9 @@ snapshots:scenes-app-replay-vision--summarizer-overview--light:hash: v1.k794b7964.908b0e15c561ac57de772ff9fa297fd54b52c182eeb8af645aaaf18646b5a4ec.FCJjo-nOsab96YEv1fZh4QQK0DkWfcTbae5bI9GPxgwscenes-app-replay-vision--usage-tab--dark:- hash: v1.k794b7964.1c59c2d43bdbec93998576d6870d7a007140d582fdd3f02824b4e6541cdbe313.5pfeVm5jp7DXcfz74b93uFXcUYsvdCcOw7ZW2XkzdqQ+ hash: v1.k794b7964.2cbe01468a4afb2779cd3ce13961c7f12f5de30b17ff2f1745d08aca2d90d6b1.h0UIDulO8w6XzMcfmA9URttOLJ9pT7XUKlPJpBwjwTYscenes-app-replay-vision--usage-tab--light:- hash: v1.k794b7964.5720941b9fbc04e674c36e253a001363174d88f7468f6ee05455d4805f584a81.asfHysRPORqJe0n6Ufuc8LZdpRtJmXiRcl20ER96i_c+ hash: v1.k794b7964.5e63ef4530beaec03140fc557480037e2dc59c0251332ea0a0f28017dbb9d8af.UgdvVrSEaZBpwSwqp-Q5BRyQNSz7pVpxIO6-86L6Uu8scenes-app-saved-insights--empty-state--dark:hash: v1.k794b7964.43545664c9133c8afd354be6a6ed8f808c35b381101325d9605114632fcdc0c9.l8w9uEOEmrH6Xl1kNd9ueRtg_51cJUSjWLdjWDM0Fkoscenes-app-saved-insights--empty-state--light:diff --git a/products/replay_vision/frontend/components/PricingLink.tsx b/products/replay_vision/frontend/components/PricingLink.tsxnew file mode 100644index 000000000000..e41fd57f8ec9--- /dev/null+++ b/products/replay_vision/frontend/components/PricingLink.tsx@@ -0,0 +1,30 @@+import { Link } from '@posthog/lemon-ui'++import { creditsToUsd, formatCreditCount } from '../utils/credits'++const VISION_PRICING_URL = 'https://posthog.com/replay-vision/pricing'++/** Pricing link for replay vision surfaces. Opens in a new tab so nobody loses a half-configured scanner. */+function VisionPricingLink({ dataAttr, children }: { dataAttr: string; children: React.ReactNode }): JSX.Element {+ return (+ <Link to={VISION_PRICING_URL} target="_blank" data-attr={dataAttr}>+ {children}+ </Link>+ )+}++/**+ * The credit-to-dollar rate, for surfaces that price something in credits.+ *+ * Credits are the unit we bill, so credits are what the numbers use, but the rate means nothing to someone who+ * hasn't already looked it up. The inline dollar equivalent next to a total only renders for orgs that can be+ * billed, so free-plan orgs have no other way to read a credit figure as money.+ */+export function CreditPriceNote({ dataAttr }: { dataAttr: string }): JSX.Element {+ return (+ <span>+ {formatCreditCount(1)} is {creditsToUsd(1)}.{' '}+ <VisionPricingLink dataAttr={dataAttr}>Read more about pricing</VisionPricingLink>+ </span>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsxindex 53a6b1cc60ac..fc83d6c84a2d 100644--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx@@ -24,6 +24,7 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { tagsModel } from '~/models/tagsModel'import { ProductKey } from '~/queries/schema/schema-general'+import { CreditPriceNote } from '../components/PricingLink'import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { getReplayVisionEditDisabledReason } from '../utils/accessControl'import { ScannerGoalDraft } from './components/ScannerGoalDraft'@@ -323,10 +324,13 @@ function ConfigureStep(): JSX.Element {options={getModelOptions(namingVariant)}/></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/ScannerConfigReadonly.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsxindex 923591ff2e06..bd22c306cc0f 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsx@@ -35,6 +35,7 @@ import { FilterLogicalOperator, UniversalFilterValue } from '~/types'import { BooleanTag } from '../../components/BooleanTag'import { CardHeader } from '../../components/CardHeader'import { LabeledRow } from '../../components/LabeledRow'+import { CreditPriceNote } from '../../components/PricingLink'import { ScannerTypeBadge } from '../../components/ScannerTypeBadge'import { visionQuotaLogic } from '../../logics/visionQuotaLogic'import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'@@ -567,6 +568,9 @@ export function ScannerConfigReadonly({ scanner }: { scanner: ReplayScanner }):{observationStats.ineligible.toLocaleString()} ineligible</span></LabeledRow>+ <div className="text-xs text-muted">+ <CreditPriceNote dataAttr="vision-pricing-link-scanner-usage" />+ </div></div></LemonCard></div>diff --git a/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsx b/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsxindex 966fd5301a24..b0302c97c3bb 100644--- a/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsx@@ -13,6 +13,7 @@ import { InsightVizNode, NodeKind, ProductKey } from '~/queries/schema/schema-geimport { BaseMathType, ChartDisplayType, InsightLogicProps, PropertyFilterType, PropertyOperator } from '~/types'import { VisionDocsLink } from '../../components/DocsLink'+import { CreditPriceNote } from '../../components/PricingLink'import { visionQuotaLogic } from '../../logics/visionQuotaLogic'import { creditsToUsd, formatCreditCount, formatCreditsMaybeUsd, formatCreditsRange } from '../../utils/credits'import { exhaustionForecast, hasCreditLimit, projectQuota } from '../../utils/quotaProjection'@@ -295,6 +296,9 @@ export function VisionUsageTab(): JSX.Element {) : undefined}/>+ <div className="text-xs text-muted">+ <CreditPriceNote dataAttr="vision-pricing-link-usage" />+ </div></div>)}