PostHog / posthog

🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
https://posthog.com
Other
21.47k stars 1.28k forks source link

Retain custom date period when clicking through from dashboard to saved insight #12169

Open corywatilo opened 2 years ago

corywatilo commented 2 years ago

I visited a saved dashboard, then applied a custom date range. Then I clicked through to one of the saved insights. It didn't carry over the custom date range.

I'd expect the saved insight to retain the custom date range I previously set on the dashboard, the use case being I'm drilling in for more details. Instead it "changes" the date range to past 90 days.

Based on my entry point/path to the insight, I'd expect to have different date ranges automatically applied.

pauldambra commented 2 years ago

I was sure there was an issue to link here but my github search skills are failing me

It would be relatively simple to include a query param in the UI so that we could load the insight view in the dashboard context (that's roughly how we load the cards on the dashboard)

But what is missing is the UI to show what filters are applied in view mode... you have to click edit to see them (and editing a filter in dashboard context would be tricky). So we should probably let someone view in dashboard context but warn them they're moving out of dashboard context if they click edit.

And the UI should probably make clear "these are the insight filters" and "these are the dashboard filters on top of that"

Agree that it makes sense that if I click through I'm expecting dashboard context to stay. But it's tricky to show someone there are two sets of filters being merged (particularly when we have no current way of showing the filters in view mode at all 🙈 )

corywatilo commented 2 years ago

The outlier here is the date range, since it's outside the bounds of any individual insight (when on a dashboard) and also doesn't live inside the query builder when assembling a saved insight. It seems reasonable enough to only carry the date range through.

Agreed it'd be a little inconsistent with filters, but having filters at a dashboard-level feels weird and doesn't seem like a 1:1 match with carrying that through to viewing a saved insight. (If we are worried about this, worst case is we through a banner above the saved insight when clicking through, showing how it's been modified.)

But I still think the date range is a common enough outlier where it would be worth carrying that through, given the context/use case.

posthog-bot commented 2 days ago

This issue hasn't seen activity in two years! If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in two weeks.