-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Show edit page confirmation dialog on tree view file change #36130
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: main
Are you sure you want to change the base?
Conversation
|
So I understand that the JS would navigate to another entry, ignoring the "dirty form" state, and by adding this condition, it makes it skip the JS navigation via A better solution would be to make |
Yes I think it's best to completely replace it with custom logic eventually. The plugin only works for full page navigation, while here we have a case of JS-based navigation (pushState and replaceState). It needs to support both forms of navigation.
Yes, this would be a good way to expose the dirty checking as a function used for JS-based navigation. |
|
Oh and I still think the "unsaved warning" should eventually be replaced by a mechanism that automatically saves and restores unsaved content (based on URL) if the user decides to navigate back. E.g. like https://github.com/github/session-resume. |
# Conflicts: # web_src/js/components/ViewFileTreeItem.vue
Sorry for the delay, I've relocated it to a helper function now |
|
Tested it, works. I notice it does a full-page load after the popup is triggered, because it let's the I think it could be optimized to do it without the full-page reload but that requires more changes in are-you-sure because it works by returning a string to So this is LGTM, and more improvements can be done later. |
|
I checked further: This specific browser popup can only be triggered by returning a string from |
05ef5d1 to
d69a429
Compare


Currently, when editing or deleting a file and the edit/commit form has changes, navigating the file tree will discard all changes without any warning. This PR prevents partial reloading when the edit form has unsaved changes, which will trigger a browser native warning dialog.