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(dashboards): show effective date on tile when dashboard overrides it (#58317)

Georgis Andonisfc73ffb96a04
diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
index 76a56f47730e..b71576e11eaf 100644
--- a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
+++ b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
@@ -169,13 +169,15 @@ export function InsightMeta({
placement === DashboardPlacement.Public ||
placement === DashboardPlacement.Builtin
const isSqlInsight = isDataVisualizationNode(insight.query)
- const showCompactHeading = !showCompactTile || (!filtersOverride?.date_from && !isSqlInsight)
+ const showCompactHeading = !showCompactTile || !isSqlInsight
const topHeadingProps = {
query: insight.query,
lastRefresh: insight.last_refresh,
hasTileOverrides: Object.keys(tileFiltersOverride ?? {}).length > 0,
resolvedDateRange: insightData?.resolved_date_range,
+ dateFromOverride: tileFiltersOverride?.date_from ?? filtersOverride?.date_from,
+ dateToOverride: tileFiltersOverride?.date_to ?? filtersOverride?.date_to,
}
const summary = useSummarizeInsight()(insight.query)
diff --git a/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx b/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx
index be946e8de319..358f2d04c70b 100644
--- a/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx
+++ b/frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx
@@ -32,12 +32,16 @@ export function TopHeading({
hasTileOverrides,
resolvedDateRange,
showInsightType = true,
+ dateFromOverride,
+ dateToOverride,
}: {
query: Node | null
lastRefresh?: string | null
hasTileOverrides?: boolean | null
resolvedDateRange?: ResolvedDateRangeResponse | null
showInsightType?: boolean
+ dateFromOverride?: string | null
+ dateToOverride?: string | null
}): JSX.Element {
const insightType = getInsightType(query)
@@ -49,6 +53,12 @@ export function TopHeading({
date_to = queryDateRange.date_to
}
}
+ if (dateFromOverride != null) {
+ date_from = dateFromOverride
+ }
+ if (dateToOverride != null) {
+ date_to = dateToOverride
+ }
let dateText: string | null = null
if (insightType?.name !== 'Retention') {