-
Notifications
You must be signed in to change notification settings - Fork 881
feat(site): warn user if they leave the editor without publishing #12406
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
Conversation
I'm not sure if there is a way to test this behavior 😞 but I'm open to learn it in case you know |
Unfortunately, Chrome and other browsers do not allow the script to change the warning message. |
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.
Nice change!
Yeah I thinking testing will be difficult. Maybe Playwright can do it, it has a way to interact with dialogs.
Can we make it work for the back buttons too? The one in the page and the browser back button. I am not entirely sure how though, maybe we have to somehow hook into React navigation?
Some of the tests are failing. It looks like they are trying to click on the build button but it is disabled, so it is probably the addition of && dirty
that is breaking them, I guess it is not getting set to true
when the tests make their changes.
@code-asher 100% I'm going to work on the suggestions. |
@code-asher I'm considering not adding e2e tests to this flow since it is a "nice to have" feature. Wdyt? |
Sounds good to me, I am not even sure it would work anyway. 😅 |
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.
Awesome!! Works wonderfully.
Screen.Recording.2024-03-04.at.11.14.14.mov
Close #12360