mrwweb / plans-editor-toolbar

Adds formatting and shortcut buttons and shortcuts to the GrinnellPlans editor. Also transforms the editor on mobile for easier editing.
GNU General Public License v3.0
0 stars 0 forks source link

Help prevent plan-loss, Phase 2: Save last draft to localStorage #21

Open mrwweb opened 8 months ago

mrwweb commented 8 months ago

Building on #20, the next step is to save a copy of the plan to localStorage during editing so that it can be restored if lost.

Rough first thought of how to do this:

  1. Save local copy of plan text to localStorage every ~15 seconds
  2. If the saved copy doesn't match the plan editor when the page first loads, show a notice with a button to: restore the old copy

Question: Do I ever discard the saved copy? Maybe there's a "dismiss" x button that can delete the message by hiding the notice. Not totally sure.

mrwweb commented 4 months ago

How will I determine when a plan autosave is stale?