-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Navigation screen: Better handling of unsaved changes #30322
Comments
For "Step 1" of your outline, I think we can take some cues from the site editor and make use of the dot to help indicate when there are unsaved changes. Along with that, it might be helpful to have a disabled state for the save button with a tooltip explaining why it's disabled. "Step 2" makes sense, too, and I think would just make use of a normal browse dialog to confirm or cancel navigating away from the editor when there are unsaved changes. I'm not so sure about "Step 3." I think the multi-entity saving flow might be too complex in the context of the menu editor. Though, I do like that it could allow for tracking changes while switching menus — I'm just not sure we need to display the checkboxes and pre-publish confirmation sidebar. Maybe we can just always save all the changes when the button is clicked? |
@shaunandrews so all but And the second question - how the dots should look like when there are changes made in checkboxes (theme location) and toggle (add new pages)? |
I like the way the dot works, that's very cool.
Yeah true. Lets go with that. |
Remember that sometimes the user does not want to save a change but wants to discard changes. |
Should we also copy the |
@talldan, I think we can close this one. First, two steps are now handled in the navigation editor. |
What problem does this address?
The navigation editor currently doesn't warn if a users attempts to exit without saving.
There are a few instances this may happen:
Some of the challenges here are because the menu screen allows users to edit multiple menus without reloading.
On the same topic, the screen also allows users to repeatedly save even if there are no unsaved changes, so it seems there's currently no detection of unsaved changes at all.
What is your proposed solution?
Step 1 - Detect unsaved changes, and only enable the save button when there are unsaved changes.
Implement detections of unsaved changes. In the nav editor I think there are two 'entities' that an be edited - the navigation post and the menu. This would need to be double-checked, but hopefully it should be possible to use the entity system to check for edits.
Then make the save button 'disabled' when there are no edits.
Step 2 - Warn the user if they navigate away
The user should always be shown a 'confirm' warning if they try to navigate away.
Step 3 - Handling saving for multiple menus
The screen could also borrow from the other editors and allow the user to save multiple menus at once, a bit like editing reusable blocks in the post editor or template parts in the site editor:
Alternatively the screen could use the 'confirm' warning when switching menus or creating a new menu if there are unsaved changes.
The text was updated successfully, but these errors were encountered: