The "auto-save drafts" pattern is surprisingly under-implemented in modern apps, especially considering how trivial it is with current tech. A simple approach that works well:
Debounced auto-save (500ms after typing stops) LocalStorage as primary backup (instant, works offline) Server sync as secondary (periodic, handles multi-device) Visual indicator showing save state (saving/saved/error)
The hard part isn't the tech—it's the UX decisions:
When do you restore a draft? (always? ask first? only if newer than saved version?) How do you handle conflicts? (user edited on phone, then opens laptop with older draft) When do you clean up drafts? (after successful post? after N days? never?)
We implemented this for a form-heavy app and the reduction in support tickets ("I lost my work!") paid for the dev time in weeks. One gotcha: LocalStorage can be cleared by browsers under storage pressure. IndexedDB is more reliable for draft persistence, though slightly more complex to implement. What's your approach for handling draft conflicts across devices?