Skip to content

chore: Change redirect notification from toast to modal #30747

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

Merged
merged 11 commits into from
Apr 14, 2025
Merged

Conversation

joethreepwood
Copy link
Contributor

@joethreepwood joethreepwood commented Apr 3, 2025

Problem

Discussion: https://posthog.slack.com/archives/C01FHN8DNN6/p1743590167887249

The redirect toast is being missed. We should change it to a modal instead. I think this does that, but has the usual 'Joe is a shit coder who is just trying his best, just be glad this isn't in zapfino' caveats on it.

Screenshot 2025-04-07 at 10 16 51 AM

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

@joethreepwood joethreepwood requested a review from Twixes April 3, 2025 12:13
@joethreepwood joethreepwood self-assigned this Apr 3, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR replaces the toast-based redirect notification with a modal dialog in the authentication redirect flow.

  • Updated /frontend/src/scenes/authentication/redirectToLoggedInInstance.ts to import and use LemonModal for notifications.
  • The modal includes explicit "Continue" and "Cancel" actions, with the primary triggering a redirect.
  • The modal’s onClose callback unconditionally redirects, which may conflict with cancelling actions.
  • Uses dynamic import for the modal to handle asynchronous loading.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@zlwaterfield
Copy link
Contributor

Working on this now.

@zlwaterfield
Copy link
Contributor

@Twixes feel free to give this a review. I didn't set an automatic count down with a redirect but we could.

@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.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Apr 8, 2025

Size Change: -10 B (0%)

Total Size: 13.4 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 13.4 MB -10 B (0%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Great experience. Although I did find it a bit underwhelming that the auto part of the redirect was gone. Added an auto-redirect back:
redirect

@Twixes Twixes enabled auto-merge (squash) April 14, 2025 13:25
@Twixes Twixes merged commit 241c070 into master Apr 14, 2025
95 of 109 checks passed
@Twixes Twixes deleted the modal-redirect branch April 14, 2025 13:44
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.

4 participants