Skip to content

feat: add safe state persistence and recovery for challenge creation …#124

Closed
Yashvi29-power wants to merge 5 commits intogdg-charusat:mainfrom
Yashvi29-power:feat/safe-state-persistence
Closed

feat: add safe state persistence and recovery for challenge creation …#124
Yashvi29-power wants to merge 5 commits intogdg-charusat:mainfrom
Yashvi29-power:feat/safe-state-persistence

Conversation

@Yashvi29-power
Copy link
Copy Markdown
Contributor

Team : Team125

Description

Implemented a safe state persistence and recovery mechanism for the Challenge Creation view to prevent accidental data loss during page refresh.

Problem

Refreshing the page during:

  • Challenge creation
  • Form filling

could cause unsaved form data to be lost.

Solution

  • Persisted form state using localStorage
  • Automatically restored saved state on component mount
  • Cleared persisted state after successful submission
  • No visual changes introduced
  • Behavior-only enhancement

This implementation is lightweight, dependency-free, and scoped only to the critical challenge creation form to avoid unnecessary architectural changes.


Related Issue

Closes #113


Type of Change

  • Feature
  • Bug fix
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Style/UI improvement

Changes Made

  • Added localStorage-based temporary state persistence
  • Implemented automatic state restoration on reload
  • Cleared stored data after successful form submission
  • Modified only CreateChallenge.tsx
  • No impact on existing UI or routing logic


Testing

  • Filled the challenge creation form
  • Refreshed the page → form state restored successfully
  • Submitted the challenge → state cleared properly
  • Refreshed again → no stale data restored

Additional Notes

The implementation is intentionally minimal and isolated to maintain frontend simplicity and avoid introducing global state complexity.

@krishnapaljadeja krishnapaljadeja self-requested a review February 28, 2026 04:55
@krishnapaljadeja krishnapaljadeja added the needs-review Valid issue-linked PR awaiting review label Feb 28, 2026
@krishnapaljadeja
Copy link
Copy Markdown
Contributor

✅ PR Validation Passed

Hey @Yashvi29-power! Your PR looks good. Here is what we found:

Field Value
Team Number Team125
Linked Issue Closes #113

A maintainer will review your PR within 24–48 hours. Stay responsive to feedback!

GDG CHARUSAT Open Source Contri Sprintathon

@krishnapaljadeja krishnapaljadeja added needs-review Valid issue-linked PR awaiting review and removed needs-review Valid issue-linked PR awaiting review labels Feb 28, 2026
@krishnapaljadeja krishnapaljadeja added needs-review Valid issue-linked PR awaiting review and removed needs-review Valid issue-linked PR awaiting review labels Feb 28, 2026
@Yashvi29-power Yashvi29-power force-pushed the feat/safe-state-persistence branch from 11f54de to db2d91d Compare February 28, 2026 13:18
@krishnapaljadeja krishnapaljadeja added needs-review Valid issue-linked PR awaiting review and removed needs-review Valid issue-linked PR awaiting review labels Feb 28, 2026
@Yashvi29-power Yashvi29-power force-pushed the feat/safe-state-persistence branch from db2d91d to 4b6530f Compare February 28, 2026 13:31
@krishnapaljadeja krishnapaljadeja added needs-review Valid issue-linked PR awaiting review and removed needs-review Valid issue-linked PR awaiting review labels Feb 28, 2026
@aaleya5
Copy link
Copy Markdown
Contributor

aaleya5 commented Feb 28, 2026

hey @Yashvi29-power please resolve conflicts.
make sure you have the latest code in your main.
therafter merge your branch and resolve errors and then commit.

@aaleya5
Copy link
Copy Markdown
Contributor

aaleya5 commented Mar 1, 2026

@Yashvi29-power if you dont commit within the next hour, i will close this pr

@Yashvi29-power
Copy link
Copy Markdown
Contributor Author

@aaleya5 I am unable to solve the issues

@aaleya5 aaleya5 closed this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Valid issue-linked PR awaiting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add Safe State Persistence & Recovery Mechanism for Critical Views

3 participants