: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(marketing): align clickable conversion cell styling (#112564)
Javier Bahamondes2c70eee15389
diff --git a/docs/internal/marketing-attribution-session-precompute.md b/docs/internal/marketing-attribution-session-precompute.mdindex 35624b36c583..9f6ae0482055 100644--- a/docs/internal/marketing-attribution-session-precompute.md+++ b/docs/internal/marketing-attribution-session-precompute.md@@ -13,6 +13,9 @@ The raw-session lookup filters to those IDs before merging entry properties andReach and credit share the resolved session rows and conversion aggregation within the query.Table and paths reports execute separate queries.+Clickable conversion metrics use the same spacing, typography, and comparison backgrounds as other Marketing analytics table cells.+The cell accepts an optional click handler and uses a native button for keyboard activation.+Touchpoints and conversions resolve identity through `events.person_id`, so merges, splits, and delayed identity mappings follow the legacy live query without rebuilding session jobs.Late-arriving events and session updates do not depend on a stored dimension snapshot.Missing precompute coverage at a calendar boundary cannot switch this route back to the legacy query.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 9fb5f56fe392..11ad836afe3b 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -11818,6 +11818,10 @@ snapshots:hash: v1.k794b7964.71ad45e65a5513ff7088e026d8ffb2bf891fb1effddb0e9dbd95ba78b597c3b1.0e6bNu95d2bH_NlZmGGW7oiHJ__aHNSxqzRcxMUA4xMscenes-app-marketing-analytics-freshness--fresh--light:hash: v1.k794b7964.b8d9453c270c310350d2bcf30cdb54cae4da19b8877e8d3206160478eb2dda94.dJpt6MIMxg7mOxiHC6PoqwTGwMfiGrln7SheHTKHTcU+ scenes-app-marketing-analytics-metric-cells--clickable-and-static--dark:+ hash: v1.k794b7964.f9b440217e994a034cd41b83c7ce116d3f80c8ffe0a713e478f571d6d3a17523.nVNlflYTiAcXYQ-MYXqFWg3XELCQxOiOIbqp-I6G8pE+ scenes-app-marketing-analytics-metric-cells--clickable-and-static--light:+ hash: v1.k794b7964.a35385e9aafb9d78b1b0ef339b1e0979599718ff4678ebab9301a12e68851ac5.ZT4_n2eit5rOyZqjI8giGDt-iTrI3v2ZJSZ8KKQe6A8scenes-app-marketing-analytics-search-performance--awaiting-sync--dark:hash: v1.k794b7964.a68e5069915d1416731bb56e1bd061b81020839cf35d98cdc01552a0c7fe0602.s7rS2bvBpMV8lvMnKn2C5VihtDFuU_Bq0x7vnTZ7jK4scenes-app-marketing-analytics-search-performance--awaiting-sync--light:diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/MarketingAnalyticsCell.stories.tsx b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/MarketingAnalyticsCell.stories.tsxnew file mode 100644index 000000000000..e02de9306b64--- /dev/null+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/MarketingAnalyticsCell.stories.tsx@@ -0,0 +1,49 @@+import type { Meta, StoryObj } from '@storybook/react'++import { fn } from 'storybook/test'++import { MarketingAnalyticsCell } from './shared'++const meta: Meta<typeof MarketingAnalyticsCell> = {+ title: 'Scenes-App/Marketing Analytics/Metric cells',+ component: MarketingAnalyticsCell,+ args: { onClick: fn() },+}+export default meta++type Story = StoryObj<typeof MarketingAnalyticsCell>++export const ClickableAndStatic: Story = {+ render: ({ onClick }) => (+ <div className="w-96 max-w-full text-sm border rounded overflow-hidden">+ <div className="grid grid-cols-2 bg-surface-secondary border-b font-semibold">+ <div className="p-2">Clickable conversions</div>+ <div className="p-2">Static metric</div>+ </div>+ {[+ { value: 2400, previous: 2000, changeFromPreviousPct: 20, hasComparison: true },+ { value: 60, previous: 100, changeFromPreviousPct: -40, hasComparison: true },+ { value: 100, previous: 100, changeFromPreviousPct: 0, hasComparison: true },+ { value: 40, previous: null, changeFromPreviousPct: null, hasComparison: false },+ { value: 0, previous: 20, changeFromPreviousPct: -100, hasComparison: true },+ { value: null, previous: null, changeFromPreviousPct: null, hasComparison: false },+ ].map((comparison, index) => {+ const value = {+ key: 'Conversions',+ kind: 'unit' as const,+ isIncreaseBad: false,+ ...comparison,+ }+ return (+ <div key={index} className="grid grid-cols-2 border-b last:border-b-0">+ <MarketingAnalyticsCell+ value={value}+ onClick={comparison.value && comparison.value > 0 ? onClick : undefined}+ />+ <MarketingAnalyticsCell value={value} />+ </div>+ )+ })}+ </div>+ ),+}diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/shared.tsx b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/shared.tsxindex 73ce7871ab24..ce7d42f886d9 100644--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/shared.tsx+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/shared.tsx@@ -190,9 +190,11 @@ const getChangeBackgroundColor = (const MarketingAnalyticsCellInternal = ({value: item,style,+ onClick,}: {value: MarketingAnalyticsItemstyle?: React.CSSProperties+ onClick?: () => void}): JSX.Element | null => {const { baseCurrency } = useValues(teamLogic)@@ -258,13 +260,31 @@ const MarketingAnalyticsCellInternal = ({const bgColor = getChangeBackgroundColor(item.changeFromPreviousPct, item.isIncreaseBad)+ const Cell = onClick ? 'button' : 'div'+return (- <Tooltip title={tooltip} delayMs={300} className="cursor-default">- <div- className="flex flex-wrap items-center min-w-0 cursor-default w-full hover:bg-warning-highlight h-full"+ <Tooltip+ title={+ onClick ? (+ <>+ {tooltip}+ <br />+ Click to view people+ </>+ ) : (+ tooltip+ )+ }+ delayMs={300}+ className={onClick ? 'cursor-pointer' : 'cursor-default'}+ >+ <Cell+ type={onClick ? 'button' : undefined}+ onClick={onClick}+ data-attr={onClick ? 'marketing-analytics-view-conversions' : undefined}+ className={`flex flex-wrap items-center min-w-0 w-full text-left font-normal hover:bg-warning-highlight h-full p-2 ${onClick ? 'cursor-pointer' : 'cursor-default'}`}style={{backgroundColor: bgColor,- padding: '0.5rem',...style,}}>@@ -280,7 +300,7 @@ const MarketingAnalyticsCellInternal = ({{changePercFormatted}</div>)}- </div>+ </Cell></Tooltip>)}@@ -289,14 +309,22 @@ const MarketingAnalyticsCellInternal = ({export const MarketingAnalyticsCell = ({value,style,+ onClick,}: {value: unknownstyle?: React.CSSProperties+ onClick?: () => void}): JSX.Element | null => {// Type guard to ensure we have a MarketingAnalyticsItemif (typeof value !== 'object' || value === null || !('key' in value)) {return <span>-</span>}- return <MarketingAnalyticsCellInternal value={withEmptyUtmLabel(value as MarketingAnalyticsItem)} style={style} />+ return (+ <MarketingAnalyticsCellInternal+ value={withEmptyUtmLabel(value as MarketingAnalyticsItem)}+ style={style}+ onClick={onClick}+ />+ )}