Skip to content

: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.

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.tsx
index 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 != null
const topHeadingEl = showCompactHeading ? (
- <TopHeading {...topHeadingProps} showInsightType={!showCompactTile} />
+ <TopHeading
+ {...topHeadingProps}
+ showInsightType={!showCompactTile}
+ showDate={!showCompactTile || tileHasOwnDateOverride}
+ />
) : null
const popoverTopHeadingEl = showCompactTile ? <TopHeading {...topHeadingProps} /> : undefined
diff --git a/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx b/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx
index 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 | null
resolvedDateRange?: ResolvedDateRangeResponse | null
showInsightType?: boolean
+ showDate?: boolean
dateFromOverride?: string | null
dateToOverride?: 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}