-
Notifications
You must be signed in to change notification settings - Fork 25
EVG-16959: Reintroduce navigation warning modal #1851
Conversation
Passing run #10208 ↗︎Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
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.
This is sweet to have back. Is it possible to render the modal when the user selects a project from the project dropdown (since the selections are cleared) or click on "Switch to Legacy UI" or "Documentation." The modal appears and looks good for the other cases!
unsavedTabs: ProjectSettingsTabRoutes[]; | ||
} => { | ||
const { tabs } = useProjectSettingsContext(); | ||
const unsavedTabs = Object.entries(tabs) |
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.
nit: memoizing unsavedTabs will prevent always returning a new reference
The two navbar links function outside of react-router so it's impossible to catch them here sadly. But Documentation opens in a separate window, and soon we are deprecating the legacy project settings page and the "Switch" button will be removed when users are looking at project settings, so I think the impact is minimal here. Good catch on warning when a user navigates to a new project, added handling for that! |
EVG-16959
Description
@remix-run/router
: Add support for navigation blocking remix-run/react-router#9709. We can once again warn when a user tries to navigate away from project settings with unsaved changes.Screenshots
Testing