: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
chore(replay-vision): say "billing period" in spend copy (#88169)
coryslater06cd144a34e3
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 356cfd797464..42ce980841a1 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7513,7 +7513,7 @@ snapshots:scenes-app-replay-vision--observation-detail--light:hash: v1.k794b7964.6fa71e0981942176d54c6c3ae7a408f89a874ffe9f5bd9ebaa5eff0555109b74.Gl2gvSnNMXaaiSoqu5RJIQwa-fe5An65LGg_uh-7R-Iscenes-app-replay-vision--scanner-calibration--dark:- hash: v1.k794b7964.466724aa8f93e012ae4eef9408b905ccca0503ad9c3fb83d166404e79e58cf24.iSSmrv7z3isqUmgqRo0TZxcshU-4yNWOF0vzlbCaUn4+ hash: v1.k794b7964.552e7aeeaa303f346e08cc00e50e01e8ae73b11037189f30ee352c2539c079cc.netD6AKXfx9ScvYD3N4ZNR4wxXAKdtRUxavYrnrURTAscenes-app-replay-vision--scanner-calibration--light:hash: v1.k794b7964.052104891cea7a902b874826c922e3688d23053b0ebb2128b1c0dbca7ab2a32b.LofDLlNAhm2-XL4aPULNJ7Wwduy_ZItRnWWQdAvir1kscenes-app-replay-vision--scanner-configuration--dark:diff --git a/products/replay_vision/backend/api/prompt_suggestions.py b/products/replay_vision/backend/api/prompt_suggestions.pyindex 5eac36bd4a91..8b7e3ed0c7c8 100644--- a/products/replay_vision/backend/api/prompt_suggestions.py+++ b/products/replay_vision/backend/api/prompt_suggestions.py@@ -453,7 +453,7 @@ class ReplayScannerPromptSuggestionViewSet(detail=(f"This test would use {planned_credits:,} credits but this scanner has "f"{scanner_budget.remaining or 0:,} left of its {scanner_budget.credit_limit or 0:,} credit "- f"limit for this period. Lower the test session count or raise the scanner's limit."+ f"limit for this billing period. Lower the test session count or raise the scanner's limit."),code="scanner_credit_limit_exceeded",)diff --git a/products/replay_vision/backend/api/trigger.py b/products/replay_vision/backend/api/trigger.pyindex 0d3fda9b4ee9..eae27c6897ce 100644--- a/products/replay_vision/backend/api/trigger.py+++ b/products/replay_vision/backend/api/trigger.py@@ -94,7 +94,7 @@ def check_scanner_quota(scanner: ReplayScanner) -> None:raise QuotaLimitExceeded(detail=(f"This scanner has {budget.remaining:,} of its {budget.credit_limit:,} credit limit left "- f"for this period, not enough for another observation. Raise the scanner's limit to keep "+ f"for this billing period, not enough for another observation. Raise the scanner's limit to keep "f"scanning."),code="scanner_credit_limit_exceeded",diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsxindex 626ff975a630..0d94e180c7ac 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx@@ -198,11 +198,11 @@ function QuotaBanner(): JSX.Element | null {<LemonBanner type="warning">{state.kind === 'exhausted'? `${- onFreePlan ? 'Free credits used up' : 'Monthly spend limit reached'+ onFreePlan ? 'Free credits used up' : 'Spend limit reached'}: ${formatCreditsRange(state.quota.credits_used, state.quota.credit_limit ?? 0)}. New observations are paused until ${state.resetsOn}.`: onFreePlan- ? `You've used ${Math.round(state.quota.credits_used).toLocaleString('en-US')} of your ${Math.round(state.quota.credit_limit ?? 0).toLocaleString('en-US')} free credits this month. New observations will pause once they run out. Resets ${state.resetsOn}.`- : `You've used ${formatCreditsRange(state.quota.credits_used, state.quota.credit_limit ?? 0)} this month. New observations will pause once you hit the limit. Resets ${state.resetsOn}.`}+ ? `You've used ${Math.round(state.quota.credits_used).toLocaleString('en-US')} of your ${Math.round(state.quota.credit_limit ?? 0).toLocaleString('en-US')} free credits this billing period. New observations will pause once they run out. Resets ${state.resetsOn}.`+ : `You've used ${formatCreditsRange(state.quota.credits_used, state.quota.credit_limit ?? 0)} this billing period. New observations will pause once you hit the limit. Resets ${state.resetsOn}.`}</LemonBanner>)}diff --git a/products/replay_vision/frontend/replay_scanners/components/BackfillCostEstimate.tsx b/products/replay_vision/frontend/replay_scanners/components/BackfillCostEstimate.tsxindex 9f8bf399204f..6eaf1071791b 100644--- a/products/replay_vision/frontend/replay_scanners/components/BackfillCostEstimate.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/BackfillCostEstimate.tsx@@ -56,7 +56,7 @@ export function BackfillCostEstimate({ estimate, loading }: Props): JSX.Elementconst breakdown = (<div className="text-xs space-y-0.5"><div>- Spent this period: <strong>{formatCreditCount(used)}</strong>+ Spent this billing period: <strong>{formatCreditCount(used)}</strong></div><div>Projected from scanners:{' '}diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerCalibrationTab.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerCalibrationTab.tsxindex 7b4e65e7527a..aa5dce957bf2 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerCalibrationTab.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerCalibrationTab.tsx@@ -218,7 +218,7 @@ function SuggestionEvaluationPanel({{summary.errors > 0 && <LemonTag type="muted">{summary.errors} failed to run</LemonTag>}</>)}- <Tooltip title="Only results that ran successfully count against the monthly Replay Vision quota">+ <Tooltip title="Only results that ran successfully count against the Replay vision quota"><span className="text-muted text-xs">{chargedCount} observation{chargedCount === 1 ? '' : 's'} charged to your quota</span>@@ -409,9 +409,9 @@ function ConfigRecommendationPanel({ scannerId }: { scannerId: string }): JSX.El(ratedCount === 0? 'Rate at least one result first': quota?.exhausted && quota.credit_limit !== null- ? `Monthly Replay Vision budget of ${formatCreditCount(quota.credit_limit)} reached. Resets ${dayjs(quota.period_end).format('MMM D')}.`+ ? `Replay vision budget of ${formatCreditCount(quota.credit_limit)} reached. Resets ${dayjs(quota.period_end).format('MMM D')}.`: quota && quota.remaining !== null && plannedTestCredits > quota.remaining- ? `Only ${formatCreditCount(quota.remaining)} of budget left this period. Lower the number of results to test.`+ ? `Only ${formatCreditCount(quota.remaining)} of budget left this billing period. Lower the number of results to test.`: undefined)}tooltip="Re-runs the scanner with the suggested prompt against your rated results, so you can see what would change. Each tested result is charged like a normal observation."@@ -469,7 +469,7 @@ function ConfigRecommendationPanel({ scannerId }: { scannerId: string }): JSX.El{Math.min(evaluationSessionCap, ratedCount) === 1 ? '' : 's'}, thumbs down first. Costs{' '}{formatCreditCount(plannedTestCredits)}{displayQuota && displayQuota.remaining !== null && displayQuota.credit_limit !== null- ? `, ${formatCreditsRange(displayQuota.remaining, displayQuota.credit_limit)} left this period`+ ? `, ${formatCreditsRange(displayQuota.remaining, displayQuota.credit_limit)} left this billing period`: ''}.</span>diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerCreditLimit.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerCreditLimit.tsxindex e78d4c11b659..323dac198ef7 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerCreditLimit.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerCreditLimit.tsx@@ -86,8 +86,8 @@ export function ScannerCreditLimit({ scannerId }: ScannerCreditLimitProps): JSX.)}<div className="text-xs text-muted">When this scanner reaches its limit, it stops scanning until the next billing period. It- stays enabled, but sessions it skipped this period aren't scanned later, even after you- raise the limit.+ stays enabled, but sessions it skipped this billing period aren't scanned later, even+ after you raise the limit.</div></>)}diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerQuotaForecast.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerQuotaForecast.tsxindex 75f96e599d65..8b6038603fad 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerQuotaForecast.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerQuotaForecast.tsx@@ -94,7 +94,7 @@ export function ScannerQuotaForecast({ scannerId }: Props): JSX.Element | null {const breakdown = (<div className="text-xs space-y-0.5"><div>- Spent this period: <strong>{formatCreditCount(used)}</strong>+ Spent this billing period: <strong>{formatCreditCount(used)}</strong></div><div>Projected from this scanner: <strong>~{formatCreditCount(projectedCredits ?? 0)}/month</strong>diff --git a/products/replay_vision/frontend/replay_scanners/components/VisionMetrics.tsx b/products/replay_vision/frontend/replay_scanners/components/VisionMetrics.tsxindex fae9988de262..b64878c92384 100644--- a/products/replay_vision/frontend/replay_scanners/components/VisionMetrics.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/VisionMetrics.tsx@@ -120,7 +120,7 @@ export function VisionMetrics(): JSX.Element {</div><div className="flex-1 bg-bg-light border rounded p-4 flex flex-col"><div className="flex items-baseline justify-between gap-3 mb-2">- <div className="text-muted text-xs font-medium uppercase">Spend this period</div>+ <div className="text-muted text-xs font-medium uppercase">Spend this billing period</div>{hasCap && (<span className={`text-xs tabular-nums ${styles.text}`}>{periodEndPct}%{' '}@@ -153,7 +153,7 @@ export function VisionMetrics(): JSX.Element {title={<div className="text-xs space-y-0.5"><div>- Spent this period:{' '}+ Spent this billing period:{' '}<strong>{formatCreditCount(quota.credits_used)}</strong></div><div>diff --git a/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsx b/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsxindex b0302c97c3bb..0b94c24aab66 100644--- a/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/VisionUsageTab.tsx@@ -215,7 +215,7 @@ export function VisionUsageTab(): JSX.Element {key: 'credits_this_month',width: '30%',className: 'pl-6',- tooltip: 'How much of the total spend this period came from this scanner.',+ tooltip: 'How much of the total spend this billing period came from this scanner.',render: (_, scanner) => {const sharePct = totalCredits > 0 ? Math.round((scanner.credits_this_month / totalCredits) * 100) : 0return (@@ -243,7 +243,7 @@ export function VisionUsageTab(): JSX.Element {{hasCap? formatCreditsRange(quota.credits_used, quota.credit_limit ?? 0): formatCreditCount(quota.credits_used)}{' '}- this period+ this billing period{projection.resetsOn ? `, resets ${projection.resetsOn}` : ''}</span></Tooltip>@@ -282,7 +282,7 @@ export function VisionUsageTab(): JSX.Element {rowKey={(scanner) => scanner.id}emptyState={<>- No spend this period yet. Costs appear here once scanners produce observations.{' '}+ No spend this billing period yet. Costs appear here once scanners produce observations.{' '}<VisionDocsLink page="quota-and-limits" dataAttr="vision-empty-docs-link-usage">Learn how credits and limits work</VisionDocsLink>@@ -291,7 +291,8 @@ export function VisionUsageTab(): JSX.Element {footer={hiddenCount > 0 ? (<div className="px-3 py-2 text-xs text-muted">- {hiddenCount} scanner{hiddenCount === 1 ? '' : 's'} with no spend or estimate this period+ {hiddenCount} scanner{hiddenCount === 1 ? '' : 's'} with no spend or estimate this billing+ period</div>) : undefined}diff --git a/products/replay_vision/frontend/utils/quotaProjection.ts b/products/replay_vision/frontend/utils/quotaProjection.tsindex 09e62acc2b85..600ce6f585d5 100644--- a/products/replay_vision/frontend/utils/quotaProjection.ts+++ b/products/replay_vision/frontend/utils/quotaProjection.ts@@ -149,11 +149,11 @@ export function quotaUx(quota: VisionQuotaApi | null): { disabledReason?: stringreturn {disabledReason: isFreeAllocationOnly(quota)? `You've used all your free Replay vision credits. Resets ${state.resetsOn}.`- : `Monthly Replay vision spend limit reached. Resets ${state.resetsOn}.`,+ : `Replay vision spend limit reached. Resets ${state.resetsOn}.`,}}return {- tooltip: `${formatCreditCount(state.quota.remaining ?? 0)} left this month (resets ${state.resetsOn})`,+ tooltip: `${formatCreditCount(state.quota.remaining ?? 0)} left this billing period (resets ${state.resetsOn})`,}}