: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
fix(replay-vision): align tag bars and link digest citations (#72765)
Arno Hillen3f5dbbb78f30
diff --git a/products/replay_vision/frontend/replay_scanners/VisionActionRunScene.tsx b/products/replay_vision/frontend/replay_scanners/VisionActionRunScene.tsxindex 0b9ecf345b5d..fd4777a3e0c8 100644--- a/products/replay_vision/frontend/replay_scanners/VisionActionRunScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/VisionActionRunScene.tsx@@ -1,3 +1,5 @@+import './components/ScannerSummary.scss'+import { useValues } from 'kea'import { LemonCard, LemonTable, LemonTableColumns, Link, Tooltip } from '@posthog/lemon-ui'@@ -130,7 +132,7 @@ function VisionActionRunScene(): JSX.Element {{run.synthesized_markdown ? (<LemonCard hoverEffect={false} className="p-4">{/* Same untrusted-content guard as the scanner-page digest card. */}- <LemonMarkdown className="text-base" disableImages>+ <LemonMarkdown className="ScannerSummaryMarkdown text-base" disableImages>{summaryMarkdown}</LemonMarkdown></LemonCard>diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerDigestCard.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerDigestCard.tsxindex 241a9f6d082c..890aa8e0bb60 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerDigestCard.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerDigestCard.tsx@@ -1,3 +1,5 @@+import './ScannerSummary.scss'+import { useActions, useValues } from 'kea'import { IconPlus } from '@posthog/icons'@@ -10,6 +12,7 @@ import { urls } from 'scenes/urls'import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'import { replayScannerLogic } from '../replayScannerLogic'import { scannerDigestLogic } from '../scannerDigestLogic'+import { resolveObservationCitations } from '../visionActionRunSceneLogic'function CardShell({ children }: { children: React.ReactNode }): JSX.Element {return (@@ -148,9 +151,10 @@ export function ScannerDigestCard({: 'max-h-60 overflow-hidden [mask-image:linear-gradient(to_bottom,black_12rem,transparent_15rem)]'}>- {/* LLM/replay-derived content: render non-PostHog images as links, not auto-fetched <img>s. */}- <LemonMarkdown className="text-sm" disableImages>- {latestRun.synthesized_markdown}+ {/* LLM/replay-derived content: render non-PostHog images as links, not auto-fetched <img>s.+ Resolve the summarizer's [obs N] markers into links to each cited observation. */}+ <LemonMarkdown className="ScannerSummaryMarkdown text-sm" disableImages>+ {resolveObservationCitations(latestRun.synthesized_markdown, latestRun.observations)}</LemonMarkdown></div><div className="flex flex-wrap items-center gap-2 border-t pt-2">diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerOverview.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerOverview.tsxindex 3362aa1d2d34..9ed48e8c8c79 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerOverview.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerOverview.tsx@@ -188,9 +188,12 @@ function ClassifierOverview({ scannerId }: { scannerId: string }): JSX.Element |<div className="space-y-1.5">{top.map(([tag, count]) => (<div key={tag} className="flex items-center gap-2">- <LemonTag type="option" className="shrink-0">- {tag}- </LemonTag>+ {/* Fixed-width label column so every bar shares the same left edge and their lengths stay comparable. */}+ <div className="w-40 shrink-0 flex">+ <LemonTag type="option" title={tag} className="max-w-full truncate">+ {tag}+ </LemonTag>+ </div><LemonProgress percent={Math.round((count / maxCount) * 100)} className="flex-1" /><span className="text-xs text-muted tabular-nums text-right whitespace-nowrap shrink-0 w-12">{count.toLocaleString()}diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerSummary.scss b/products/replay_vision/frontend/replay_scanners/components/ScannerSummary.scssnew file mode 100644index 000000000000..7721ec34e1e0--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerSummary.scss@@ -0,0 +1,17 @@+// Shared styling for a scanner's synthesized summary markdown (digest card + run scene).+.ScannerSummaryMarkdown {+ // Observation citations ([obs N] resolved to observation links) read as compact superscript markers,+ // rather than a cluttered inline row of external-link chips.+ a[href*='/replay-vision/observations/'] {+ font-size: 0.7em;+ font-weight: 600;+ line-height: 1;+ white-space: nowrap;+ vertical-align: super;++ // LemonMarkdown appends an "open in new tab" icon to every link; citations read cleaner without it.+ svg {+ display: none;+ }+ }+}