: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(insights): suppress redundant date label on compact dashboard tiles (#64855)
Vasco de Krijger579b50b51c4c
diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsxindex ef999ccfa219..3c571a338a0a 100644--- a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx+++ b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx@@ -288,8 +288,15 @@ export function InsightMeta({? 'Refreshing...': undefined+ // On compact dashboard tiles the date just mirrors the dashboard's own range unless the+ // tile overrides it, so suppress the redundant label and only keep it for tile-level overrides.+ const tileHasOwnDateOverride = tileFiltersOverride?.date_from != null || tileFiltersOverride?.date_to != nullconst topHeadingEl = showCompactHeading ? (- <TopHeading {...topHeadingProps} showInsightType={!showCompactTile} />+ <TopHeading+ {...topHeadingProps}+ showInsightType={!showCompactTile}+ showDate={!showCompactTile || tileHasOwnDateOverride}+ />) : nullconst popoverTopHeadingEl = showCompactTile ? <TopHeading {...topHeadingProps} /> : undefineddiff --git a/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx b/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsxindex a83a01b2e2f5..6da883fd35d7 100644--- a/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx+++ b/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx@@ -32,6 +32,7 @@ export function TopHeading({hasTileOverrides,resolvedDateRange,showInsightType = true,+ showDate = true,dateFromOverride,dateToOverride,}: {@@ -40,6 +41,7 @@ export function TopHeading({hasTileOverrides?: boolean | nullresolvedDateRange?: ResolvedDateRangeResponse | nullshowInsightType?: boolean+ showDate?: booleandateFromOverride?: string | nulldateToOverride?: string | null}): JSX.Element {@@ -76,7 +78,7 @@ export function TopHeading({typeLabel={insightType?.name}typeTitle={insightType?.description}showTypeLabel={showInsightType}- dateText={dateText}+ dateText={showDate ? dateText : null}dateTooltip={resolvedDateTooltip}>{lastRefresh ? <InsightFreshness lastRefresh={lastRefresh} /> : null}