-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(insights): add modal asking if user wants to use/discard overrides when editing insight #38016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, 3 comments
// we whould always have a short_id when overrides are present | ||
if (insight.short_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Typo: "whould" should be "would"
// we whould always have a short_id when overrides are present | |
if (insight.short_id) { | |
// we would always have a short_id when overrides are present |
// we whould always have a short_id when overrides are present | ||
if (insight.short_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Typo: "whould" should be "would"
// we whould always have a short_id when overrides are present | |
if (insight.short_id) { | |
// we would always have a short_id when overrides are present |
// :FIXME: This should work, but doesn't due to a race condition in insightsSceneLogic. | ||
// What I _think_ is happening roughly: urlToAction gets called with the query, and calls updateQuery. | ||
// Then setSceneState gets executed and calls the reloadInsightLogic listener. This then calls loadInsight, | ||
// but the overrides are empty as the url doesn't have them any more. Now the query doesn't have the overrides as | ||
// well. | ||
urls.insightEdit( | ||
insight.short_id, | ||
currentLocation.searchParams.dashboard, | ||
query | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The FIXME comment indicates this code has a known race condition that prevents it from working correctly. This breaks the core functionality of editing with overrides.
Size Change: +129 B (0%) Total Size: 2.73 MB ℹ️ View Unchanged
|
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
Problem
https://posthog.slack.com/archives/C0368RPHLQH/p1756732974736689
Changes
This adds a modal asking the user wether they want to use or discard the overrides when editing an insight.
FIXME: Unfortuntately I haven't yet been able to get this working with the various layouts/states that insights can be in right now. See the comment in code. I hope it will be easier fixing it once the layout changes are through, and then we can revisit this.
How did you test this code?
👉 Stay up-to-date with PostHog coding conventions for a smoother review.