Skip to content
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

Offer to restore any available local post backup (instead of only the most recent one) #23955

Open
adamziel opened this issue Jul 15, 2020 · 3 comments
Labels
[Feature] History History, undo, redo, revisions, autosave. [Feature] Saving Related to saving functionality Needs Dev Ready for, and needs developer efforts Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.

Comments

@adamziel
Copy link
Contributor

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:

Zrzut ekranu 2020-07-15 o 13 11 23

(Note this only works with #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: #23781

@adamziel adamziel added Needs Design Feedback Needs general design feedback. [Feature] Saving Related to saving functionality Needs Technical Feedback Needs testing from a developer perspective. [Feature] History History, undo, redo, revisions, autosave. labels Jul 15, 2020
@adamziel adamziel changed the title Offer to restore the post backup from all available local drafts Offer to restore the backup from any available local drafts (instead of the most recent one) Jul 15, 2020
@adamziel adamziel changed the title Offer to restore the backup from any available local drafts (instead of the most recent one) Offer to restore the backup from any available local draft (instead of the most recent one) Jul 15, 2020
@adamziel adamziel changed the title Offer to restore the backup from any available local draft (instead of the most recent one) Offer to restore any available local post backup (instead of the most recent one) Jul 15, 2020
@adamziel adamziel changed the title Offer to restore any available local post backup (instead of the most recent one) Offer to restore any available local post backup (instead of only the most recent one) Jul 15, 2020
@shaunandrews
Copy link
Contributor

Maybe we can use a modal to show local backups, and let people choose one to restore — or discard them all:

image

It might be nice to show a preview when you hover over a local backup:

image

@mtias
Copy link
Member

mtias commented Aug 31, 2020

Agreed on trying to show anything that might be locally saved.

@paaljoachim
Copy link
Contributor

Hey @shaunandrews

Let's try it out.
It was brought up during a design triage. @kellychoffman and myself talked about it.

@paaljoachim paaljoachim added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Feb 16, 2021
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] History History, undo, redo, revisions, autosave. [Feature] Saving Related to saving functionality Needs Dev Ready for, and needs developer efforts Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants