Open adamziel opened 4 years ago
Maybe we can use a modal to show local backups, and let people choose one to restore — or discard them all:
It might be nice to show a preview when you hover over a local backup:
Agreed on trying to show anything that might be locally saved.
Hey @shaunandrews
Let's try it out. It was brought up during a design triage. @kellychoffman and myself talked about it.
Gutenberg has a "local autosave" feature that ensures your content is stored in the browser storage if at any point the internet connection breaks. Imagine this happens on
/wp-admin/post-new.php
for a new post that doesn't have an ID assigned yet. If you lose a connection, write a long post, close the browser, and then return later, then you will see the following notice:(Note this only works with https://github.com/WordPress/gutenberg/pull/23928 applied).
Clicking the button hydrates the editor with the backed up post content.
Now, let's imagine this happens multiple times or in multiple tabs.
At the moment only a single ID-less (auto-draft) local backup is handled - this means all the other ones are lost. What is the right solution here? I can see a few ways forward:
1) Store multiple local auto-draft backups and then offer all available ones in the notice. This would probably mean there should be a way to delete ones that are no longer needed. 2) Decide that having multiple backups for auto-draft posts isn't very likely and close this issue. 3) ?
CC @mtias @shaunandrews @mcsf @youknowriad
Also relevant, the content-loss issue here: https://github.com/WordPress/gutenberg/issues/23781