Skip to content

Conversation

@vtushar06
Copy link

What kind of change does this PR introduce?
Feature enhancement

Issue Number:

Screenshots/videos:

tour.mp4

If relevant, did you update the documentation?
No documentation updates required for this feature.

Summary
This pull request addresses a critical UX issue by implementing persistent client-side storage of validation results and user code using localStorage with namespaced keys (validation-{chapterIndex}-{stepIndex}). The solution enhances state management through Zustand integration, enabling seamless data restoration and mutation across component lifecycles.
Technical Implementation:

  • Asynchronous validation pipeline utilizing hyperjump JSON Schema validation with robust error handling and Redux-style dispatching
  • Custom React hook (useValidationRestore) orchestrating state restoration via useEffect with SSR compatibility checks

Does this PR introduce a breaking change?
No

@JeelRajodiya
Copy link
Member

Hi @vtushar06, Can you please move all the custom hooks in the Editor component (and from the whole codebase) to a new file called ./utils/hooks.ts. Moreover, could you please add comments in your code explaining what it does? why it was needed, why it was removed etc. It will make reviewing lot faster, Thanks!

Try to have PRs with has less file diff, so it becomes easier to review.

@vtushar06
Copy link
Author

Hi @JeelRajodiya, thank you for the feedback! I was waiting for your suggestions before proceeding further. I’ll go ahead and refactor all the custom hooks into a new ./utils/hooks.ts file as recommended and add detailed comments explaining the purpose and changes made in the code.

I’ll update the PR shortly.

@vtushar06 vtushar06 force-pushed the preserve-validate-result branch from 17f5333 to 54f4305 Compare November 4, 2025 07:54
@vtushar06
Copy link
Author

Hii @JeelRajodiya, I have pushed the necessary changes which you suggested can you please have a look into that. Thanks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve the Validation Results When Revisiting a Lesson

2 participants