Add [FEATURE]: Story Draft Auto-Save to LocalStorage in ShareStory and EditStory #151#181
Open
dhruvpatel16120 wants to merge 5 commits into
Open
Add [FEATURE]: Story Draft Auto-Save to LocalStorage in ShareStory and EditStory #151#181dhruvpatel16120 wants to merge 5 commits into
dhruvpatel16120 wants to merge 5 commits into
Conversation
👷 Deploy request for safevoiceforwomen pending review.Visit the deploys page to approve it
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠️ Pull Request
🏷️ PR Type
Select the type of PR (check one):
Closes #151
📝 Rationale / Motivation
Sharing personal experiences of distress can be emotionally taxing. Currently, if a user refreshes the page, accidentally closes their tab, or gets logged out mid-typing, their draft content is completely lost.
To address this, this PR implements a client-side auto-save mechanism using
localStoragein bothShareStoryandEditStoryeditors. This preserves progress and eliminates the risk of losing long stories.✨ Description of Changes
💾 LocalStorage Auto-Save
Share Story Drafts:
titleandcontentfromlocalStorage(safevoice_draft_title,safevoice_draft_content) on editor load.localStoragedynamically as the user types.Edit Story Drafts:
safevoice_edit_title_${story.id},safevoice_edit_content_${story.id}) to prevent draft collisions.🧪 Testing Instructions
Run the project locally:
⚡ Checklist
localStorageon mounttitleandcontenttolocalStorageon changelocalStoragekeys only after successful submission or updatelocalStoragekeys on editor edit cancellation