Skip to content

feat: add auto-save draft support for form editor#75

Merged
Amansingh0807 merged 4 commits into
Amansingh0807:masterfrom
KumarManglam-123:feature-auto-save-draft
Mar 1, 2026
Merged

feat: add auto-save draft support for form editor#75
Amansingh0807 merged 4 commits into
Amansingh0807:masterfrom
KumarManglam-123:feature-auto-save-draft

Conversation

@KumarManglam-123

@KumarManglam-123 KumarManglam-123 commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds an auto-save draft feature to the form editor to prevent data loss during form creation or editing.

The implementation automatically saves form state to localStorage on field changes and restores the last saved draft when the editor is reopened. This improves reliability and user experience for long or complex forms.

Related Issue

Resolves #47

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix
  • Breaking change
  • Documentation update
  • UI/UX improvement
  • Performance improvement
  • Code refactoring
  • Test update

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • I have read the CODE_OF_CONDUCT.md
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings or errors
  • I have tested my changes locally

AI Disclosure

  • Did you use AI tools to generate or assist with this code? Yes

If yes:

  • Tool used: ChatGPT
  • AI-assisted parts: Hook design and logic optimization guidance
  • Code reviewed manually: Yes

Testing

  • Tested locally
  • Tested in production-like environment
  • Added unit tests
  • Added integration tests

Environment:

  • Node: 18+
  • Browser: Chrome
  • OS: Windows

Additional Notes

Draft saving uses browser localStorage and does not affect backend APIs.

@vercel

vercel Bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

@KumarManglam-123 is attempting to deploy a commit to the Aman Singh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jan 29, 2026

Copy link
Copy Markdown

✅ PR Checklist Complete

Great job @KumarManglam-123! Your PR follows all the guidelines. A maintainer will review it soon. Thank you for your contribution! 🙏

@vercel

vercel Bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
genform.ai Ready Ready Preview, Comment Mar 1, 2026 2:26pm

Remove clerk configuration from .gitignore
@Amansingh0807 Amansingh0807 self-requested a review January 29, 2026 10:39
@Amansingh0807 Amansingh0807 added SWoC26 Official Tag for Social Winter of Code Easy labels Jan 29, 2026
@KumarManglam-123

Copy link
Copy Markdown
Contributor Author

Auto-save draft feature implemented and tested locally. Please review. Thanks!

@Amansingh0807 Amansingh0807 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually don't need the changes in package-lock.json and package.json file. Otherwise it looks good to me.

@KumarManglam-123

Copy link
Copy Markdown
Contributor Author

Hi @Amansingh0807,
I’ve reverted the unintended changes in package.json and package-lock.json and pushed the update.
Kindly review when convenient. Thank you!

@Amansingh0807 Amansingh0807 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice formatting and auto-save! However, you accidentally removed crucial UI for field types, options, and the live form preview. Please restore these core features so we can merge.
In FormEditor.tsx, you accidentally removed core features (field types, options UI, and live preview). Please restore them alongside your auto-save changes so we can merge.

@KumarManglam-123

Copy link
Copy Markdown
Contributor Author

Hi ,
I’ve restored the field type selector, options UI, required toggle, and live preview while keeping the auto-save functionality intact.
Tested locally including draft restore and clearing after save.
Thank you!

@Amansingh0807 Amansingh0807 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything Looks good to me. Thank you for Contributing.

@Amansingh0807 Amansingh0807 merged commit f338461 into Amansingh0807:master Mar 1, 2026
5 checks passed
@KumarManglam-123

Copy link
Copy Markdown
Contributor Author

Everything Looks good to me. Thank you for Contribution.

Thanks for the approval and support. This is my last contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants