: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(error-tracking): add docs button to source maps banner and card (#62630)
Aleksander Błaszkiewiczb2db1a4f9be7
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/SourceMapsBanner.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/SourceMapsBanner.tsxindex ff2c3b7e9d17..9e3ef6c7dceb 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/SourceMapsBanner.tsx+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/SourceMapsBanner.tsx@@ -1,11 +1,11 @@import { useActions, useValues } from 'kea'import { IconMagicWand } from '@posthog/icons'-import { LemonBanner } from '@posthog/lemon-ui'+import { LemonBanner, LemonButton } from '@posthog/lemon-ui'import { isSourceMapsRecommendation, recommendationsTabLogic } from '../recommendations/recommendationsTabLogic'import { SourceMapsFixModal } from '../recommendations/SourceMapsFixModal'-import { sourceMapsFixWizardLogic } from '../recommendations/sourceMapsFixWizardLogic'+import { SOURCE_MAPS_DOCS_URL, sourceMapsFixWizardLogic } from '../recommendations/sourceMapsFixWizardLogic'// Dismissal is independent of the source maps recommendation's own dismissed_at —// dismissing here only hides this banner, via the standard localStorage-backed pattern.@@ -23,6 +23,7 @@ export function SourceMapsBanner(): JSX.Element | null {}const percent = Math.round((sourceMaps.meta.unresolved_pct ?? 0) * 100)+ const lookbackHours = sourceMaps.meta.lookback_hoursreturn (<>@@ -36,8 +37,16 @@ export function SourceMapsBanner(): JSX.Element | null {onClick: () => openModal('issues_list'),}}>- We detected that {percent}% of your stack frames in the last {sourceMaps.meta.lookback_hours} hours are- missing source maps, so their stack traces aren't readable. Run the setup wizard to upload them.+ <div className="flex items-center justify-between gap-2">+ <span>+ We detected that {percent}% of your stack frames in the last {lookbackHours} hours are missing+ source maps, so their stack traces aren't readable. Run the wizard or follow the docs to upload+ them.+ </span>+ <LemonButton type="secondary" to={SOURCE_MAPS_DOCS_URL} targetBlank>+ Read docs+ </LemonButton>+ </div></LemonBanner><SourceMapsFixModal /></>diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/SourceMapsRecommendationCard.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/SourceMapsRecommendationCard.tsxindex fafafef0639f..37e966290903 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/SourceMapsRecommendationCard.tsx+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/SourceMapsRecommendationCard.tsx@@ -5,7 +5,7 @@ import { LemonButton } from '@posthog/lemon-ui'import { RecommendationCard } from './RecommendationCard'import { SourceMapsFixModal } from './SourceMapsFixModal'-import { sourceMapsFixWizardLogic } from './sourceMapsFixWizardLogic'+import { SOURCE_MAPS_DOCS_URL, sourceMapsFixWizardLogic } from './sourceMapsFixWizardLogic'import type { SourceMapsRecommendation } from './types'export function SourceMapsRecommendationCard({@@ -40,7 +40,10 @@ export function SourceMapsRecommendationCard({of frames were unresolved in the last {lookback_hours} hours</div></div>- <div className="flex justify-center mt-2">+ <div className="flex justify-center gap-2 mt-2">+ <LemonButton type="secondary" to={SOURCE_MAPS_DOCS_URL} targetBlank>+ Read docs+ </LemonButton><LemonButton type="primary" icon={<IconMagicWand />} onClick={() => openModal('recommendations')}>Fix with wizard</LemonButton>diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.tsindex bb2f7a42b761..40238ac862b0 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts@@ -11,6 +11,8 @@ import type { sourceMapsFixWizardLogicType } from './sourceMapsFixWizardLogicTypexport type WizardRating = 'good' | 'bad'export type WizardOpenSource = 'issues_list' | 'recommendations'+export const SOURCE_MAPS_DOCS_URL = 'https://posthog.com/docs/error-tracking/upload-source-maps'+// Delay before we ask "how did the wizard do?" — long enough that the user has// actually had a chance to copy the command and kick the wizard off.const FEEDBACK_REVEAL_DELAY_MS = 1000