Skip to content
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

fix(insights): only show confirmation when navigating to new url #24216

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

thmsobrmlr
Copy link
Contributor

Problem

We show the "Leave insight?" confirmation when navigating to a new insight via the urls.insightNew helper.

Repro:

  • Go to a new insight (to load the insightSceneLogic)
  • Go to web analytics
  • Click on "Open as new insight"
  • Observe that the "Leave insight?" confirmation is triggered
  • This is because of internal redirects -> we should ignore those in the insightSceneLogic

Changes

This is because we redirect from non-project URLs to project URLs and vice-versa (/project/1/insight/new vs /insight/new). Removing the project part from both pathnames makes our existing check work.

How did you test this code?

Tried the repro before and after

@thmsobrmlr thmsobrmlr requested review from a team and robbie-c August 6, 2024 10:09
Copy link
Contributor

github-actions bot commented Aug 6, 2024

Size Change: 0 B

Total Size: 1.07 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.07 MB

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member

@robbie-c robbie-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, just tested it locally and it works

@thmsobrmlr thmsobrmlr merged commit ce49493 into master Aug 6, 2024
93 checks passed
@thmsobrmlr thmsobrmlr deleted the fix-insight-navigation-confirmation branch August 6, 2024 13:04
silentninja pushed a commit to silentninja/posthog that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants