Skip to content

Robustness – Lack of Form State Caching for Generator Workspace #44

Description

@MayurKharat0390

Describe the Issue

The "Custom Instructions" panel in the Generator workspace does not persist user inputs.

Problem

If a user takes several minutes writing detailed custom guidelines for their documentation and then accidentally reloads the page, clicks a navigation link, or experiences a micro-disconnection, all their typed configuration text is lost instantly.

Proposed Solution

Save the user's repoUrl and customInstructions in browser sessionStorage or localStorage on input changes, and load them back on component mount.

Proposed Implementation Details

Use React effects to load and store input values:

// On mount:
useEffect(() => {
  const savedInstructions = sessionStorage.getItem('generator_instructions');
  if (savedInstructions) setCustomInstructions(savedInstructions);
}, []);

// On input change:
const handleInstructionsChange = (e) => {
  setCustomInstructions(e.target.value);
  sessionStorage.setItem('generator_instructions', e.target.value);
};

Metadata

Metadata

Labels

Mediumweekend project, need some digging!SSoC26enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions