Description
When users are creating an article on the site, there’s a risk they may accidentally close the browser tab or navigate away, resulting in the loss of all their progress. To improve the user experience, we should implement a simple auto-save mechanism that periodically caches the article content to the browser’s local storage.
If the user revisits the article creation page and unsaved content is detected, we should prompt them with an option to restore their draft. If they choose to restore, the content fields should be repopulated. If they decline, the cached data should be cleared.
The cache should also be cleared automatically once the user successfully submits their article. This feature should only store text-based content (like title, body, and tags) — image uploads should not be cached.
This addition will make the article-writing experience much more resilient and user-friendly, especially during longer writing sessions.