You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Site Editing: Discard unsaved changes when moving between editing modes #27896
When switching between the post editor and template editing modes, the changes aren't properly discarded.
To reproduce
Steps to reproduce the behavior:
Install Gutenberg 9.6+ and a FSE ready theme.
Go to Posts > Add New
Make some changes to the post > Publish or Save Draft
Use the option to edit the template to switch into template editing mode in the document settings section.
Make some changes to the header, footer, and post content.
Select "Apply" and only select the changes to the post content to save. Confirm that decision
You'll then be brought back to the post editor but see "Update" instead of "Publish"
If you select "Update", it then brings you to a screen to save the changes previously not selected in the various template parts. There's not a way to dismiss these and if you try to navigate away, you're notified that you'll lose changes.
This also needs to be considered when it comes to the template part editing flow as well. For example, saving changes as a new template part rather than overwriting the current one.
Maybe I'm missing something, but to me this feels like a bug: after navigating out of the template editing mode, shouldn't the unchecked items be discarded automatically?
changed the title [-]Site Editing: Improve saving flow when dismissing changes[/-][+]Site Editing: Discard unsaved changes when moving between editing modes[/+]on Mar 31, 2021
At this point, it's a fine line dividing both, but I would say it's a bug because I don't believe this behavior was the original intent when designing and developing the feature; it looks like an oversight rather than the original intended purpose (in which case it would be an enhancement because it would indeed be working as expected by those creating the feature).
Still in the template editor I went to view the post. Then trying to get back to the template editor I got the page editor which informed me that there was a saved version that contained changes. (I have been caught by this before – on my own site when making changes in the templates and then going to the page editor, if I had clicked on the revert to saved I potentially might have lost all the changes that I had just tried to make. This is confusing!)
This continues to be a bit of an awkward flow that would benefit from greater clarity.
I kept unchecking the box to save the template part, but this preference wasn’t remembered the next time I went to save. I felt like it should remember that (at least until I made another edit to that template part).
When switching to another template or template part, there’s no message (alert) about unsaved changes will be lost. I know these are saved “in general”, but I think it would be great to prompt save changes before switching to another template or template part.
This is a good one to solve. Technically this is mainly surfaced by the new save interface, moreso than being a new issue, insofar as the current way you "discard" changes is you exist the design section without saving. I think this is made especially prominent through the new always visible save button.
I do agree that discarding changes through an explicit action could be nice to have. Such an option may also, in the future, fit well into a save panel, which I believe @jameskoster and @richtabor have explored some options for, that may be relevant to this conversation. Mainly, once all changes are saved, it seems like the panel could simply say "Saved", just like it does inside the editor.
Activity
annezazu commentedon Mar 1, 2021
This also needs to be considered when it comes to the template part editing flow as well. For example, saving changes as a new template part rather than overwriting the current one.
javierarce commentedon Mar 29, 2021
Maybe I'm missing something, but to me this feels like a bug: after navigating out of the template editing mode, shouldn't the unchecked items be discarded automatically?
annezazu commentedon Mar 29, 2021
I'm not quite sure what the intent is :D Good question though. @jameskoster do you have a sense of this?
jameskoster commentedon Mar 30, 2021
Yeah I think this is an oversight. I agree with @javierarce – the unsaved changes should be discarded.
[-]Site Editing: Improve saving flow when dismissing changes[/-][+]Site Editing: Discard unsaved changes when moving between editing modes[/+]annezazu commentedon Mar 31, 2021
Awesome. Thank you both! I've updated the issue title and description to be more accurate to the bug that remains.
annezazu commentedon Apr 5, 2021
@priethor would you consider this a bug at this point over an enhancement? Wanted to check in first before altering labels :)
priethor commentedon Apr 8, 2021
At this point, it's a fine line dividing both, but I would say it's a bug because I don't believe this behavior was the original intent when designing and developing the feature; it looks like an oversight rather than the original intended purpose (in which case it would be an enhancement because it would indeed be working as expected by those creating the feature).
annezazu commentedon May 10, 2022
More usability feedback in general to pass along related to this issue from the fourteenth call for testing for the FSE Outreach Program:
This continues to be a bit of an awkward flow that would benefit from greater clarity.
annezazu commentedon Nov 29, 2022
This was once more mentioned in the FSE Outreach Program's Site Editor Sneak Peek:
annezazu commentedon Jan 13, 2023
Noting that this was brought up in the FSE Outreach Program's nineteenth call for testing:
annezazu commentedon Feb 20, 2023
Noting that this problem also happens with the new "global save" button with browse mode:
Site.Editor.global.save.button.mov
@jasmussen @youknowriad as a heads up. Notice I can't discard changes and that the push to Save will persist.
jasmussen commentedon Feb 27, 2023
This is a good one to solve. Technically this is mainly surfaced by the new save interface, moreso than being a new issue, insofar as the current way you "discard" changes is you exist the design section without saving. I think this is made especially prominent through the new always visible save button.
I do agree that discarding changes through an explicit action could be nice to have. Such an option may also, in the future, fit well into a save panel, which I believe @jameskoster and @richtabor have explored some options for, that may be relevant to this conversation. Mainly, once all changes are saved, it seems like the panel could simply say "Saved", just like it does inside the editor.
StevenDufresne commentedon Jun 4, 2024
I've run into this multiple times as well and find this experience to be very frustrating.
Here's where I got stuck recently.
How do I revert this change?
GIFs
Getting a weird edit for doing nothing

Not being able to remove it

Environment
Gutenberg version 18.3.0
youknowriad commentedon Jun 4, 2024
We definitely need a "revert" button on this modal/save flow. Thanks for the feedback.