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): preserve dashboard context after discarding overrides (#95920)

Leonardo Rosaab7a2fe5bba9
diff --git a/frontend/src/scenes/insights/InsightSceneHeader.tsx b/frontend/src/scenes/insights/InsightSceneHeader.tsx
index 5347b8c4d8b8..2c4a418bf609 100644
--- a/frontend/src/scenes/insights/InsightSceneHeader.tsx
+++ b/frontend/src/scenes/insights/InsightSceneHeader.tsx
@@ -36,7 +36,10 @@ export function InsightSceneHeader({ insightLogicProps }: InsightSceneHeaderProp
Discard the filters to edit the saved insight.
</span>
- <LemonButton type="secondary" to={urls.insightView(insightId as InsightShortId)}>
+ <LemonButton
+ type="secondary"
+ to={urls.insightView(insightId as InsightShortId, insightLogicProps.dashboardId)}
+ >
Discard overrides
</LemonButton>
</div>
diff --git a/playwright/e2e/product-analytics/insights/funnels.spec.ts b/playwright/e2e/product-analytics/insights/funnels.spec.ts
index 0524449e73d8..9f6eb433ef51 100644
--- a/playwright/e2e/product-analytics/insights/funnels.spec.ts
+++ b/playwright/e2e/product-analytics/insights/funnels.spec.ts
@@ -449,6 +449,7 @@ test.describe('Funnel insights', () => {
.click()
await expect(page.getByText("a dashboard's filters applied")).not.toBeVisible()
await expect(insight.editButton).toBeVisible()
+ expect(page.url()).toContain(`dashboard=${dashboardId}`)
})
await test.step('edit controls work after discard', async () => {