#20692 closed enhancement (fixed)
Handle unsaved changes in the customizer
Reported by: | koopersmith | Owned by: | helenyhou |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description
Losing your changes is no fun.
The way I see it, we have two options:
1) Show an AYS when leaving the customizer by using an onbeforeunload handler.
2) Store unsaved customizations in a customize_data_$stylesheet option. The fact that certain customize settings persist across theme changes (options) while others don't (theme_mods and some theme-specific options) could pose a problem.
I say let's start with #1.
Attachments (1)
Change History (11)
#2
in reply to:
↑ 1
@
13 years ago
- Keywords needs-patch added
- Owner set to helenyhou
- Status changed from new to assigned
Replying to jane:
I'd hate to put in an unnecessary AYS. IF it's that big a concern, would be better to bring save up to top and have blue "Save & Activate" on right, 2ndary button for "Cancel" instead of "Return to Manage Themes" on left.
I like this idea quite a bit.
From dev chat, helenyhou is going to take a stab at the patch.
#31
@
11 years ago
For the Widgets UI Refresh feature-as-plugin effort, a user test was put together to test integration with the Customizer. In the video at ~7:30 in, after the user had made changes to the controls and previewed them, he navigated away from the page. He forgot to hit Save & Publish, or didn't notice it there, and so he lost all of his changes. See the video here: http://make.wordpress.org/ui/2013/09/18/widgets-sept-16-chat-notes/#comment-23907
So if the dialog is out of the question, perhaps the Save & Publish button needs some more prominent styling when it transitions from its disabled to enabled state? Maybe an animated box-shadow or something to really get the user's attention?
/cc @helenyhou @jane
#33
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Regarding:
2) Store unsaved customizations in a customize_data_$stylesheet option. The fact that certain customize settings persist across theme changes (options) while others don't (theme_mods and some theme-specific options) could pose a problem.
I just thought of an alternative to this. Now that autosave will store the drafted post in localStorage
, we could do the same for settings in the customizer. Since all of the settings are stored in memory as JS objects, when leaving the customizer with unsaved changes it could store those settings in localStorage
.
After having abandoned changes, when returning to the customizer, the initially-disabled "Saved" button could then swap out with an enabled "Restore" button. As soon as a change is made to a setting on the page, the Restore button would replace with the "Save & Publish" button, and the localStorage
-preserved settings would be discarded. But if you hit "Restore" then the localStorage
settings would be populated into the customizer settings and the button would also change out from "Restore" to "Save & Publish".
I realize that all of this dovetails nicely with the Settings Revisions plugin <http://wordpress.org/plugins/settings-revisions/> so this functionality could be prototyped there.
Thoughts? I'm re-opening this ticket due to the findings from the user test referenced above.
I'd hate to put in an unnecessary AYS. IF it's that big a concern, would be better to bring save up to top and have blue "Save & Activate" on right, 2ndary button for "Cancel" instead of "Return to Manage Themes" on left.