Skip to content

feat: persist editor settings to localStorage (#656)#838

Merged
magic-peach merged 1 commit into
magic-peach:mainfrom
Pranav-IIITM:feat/persist-editor-settings-localstorage
May 21, 2026
Merged

feat: persist editor settings to localStorage (#656)#838
magic-peach merged 1 commit into
magic-peach:mainfrom
Pranav-IIITM:feat/persist-editor-settings-localstorage

Conversation

@Pranav-IIITM
Copy link
Copy Markdown
Contributor

@Pranav-IIITM Pranav-IIITM commented May 21, 2026

Description

Saves the current EditRecipe to localStorage whenever it changes and restores it on page load so settings survive page refreshes.

  • Storage key: reframe:recipe
  • Save: debounced useEffect (500ms) on recipe changes to avoid thrashing
  • Restore: reads and validates shape + version on mount, falls back to DEFAULT_RECIPE if invalid/missing
  • Reset: clears both state and localStorage

Files changed:

  • src/lib/types.ts — added RECIPE_VERSION, version field to EditRecipe, isValidRecipe() type guard
  • src/lib/constants.ts — added version: RECIPE_VERSION to DEFAULT_RECIPE
  • src/hooks/useVideoEditor.ts — restore on mount, debounced save, clear on reset

Related Issue

Closes #656

Type of Contribution

  • Bug fix
  • New feature
  • Documentation update
  • GSSoC contribution

Participant Info

  • GitHub username: Pranav-IIITM
  • Contribution level: Intermediate

Screen Recording

persist.editor.settings.to.localStorage.656.mp4

Checklist

  • I have read the contribution guidelines
  • My changes follow the project structure
  • I have tested my changes in Chrome, Firefox, and Safari
  • bun run lint passes (no ESLint errors)
  • bunx tsc --noEmit passes (no TypeScript errors)
  • New interactive elements have aria-label / accessible names
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached above (required for UI/feature/design changes)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@Pranav-IIITM is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

✅ PR Format Check Passed — @Pranav-IIITM

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions github-actions Bot added level:intermediate Intermediate level - 35 pts type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature labels May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Pranav-IIITM!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added the gssoc'26 GirlScript Summer of Code 2026 label May 21, 2026
@magic-peach magic-peach added quality:clean Well-implemented, clean code gssoc:approved Approved for GSSoC'26 labels May 21, 2026
@magic-peach magic-peach merged commit 44b259d into magic-peach:main May 21, 2026
10 of 13 checks passed
Ayush-kathil pushed a commit to Ayush-kathil/reframe that referenced this pull request May 21, 2026
…agic-peach#838)

Saves the complete recipe to localStorage on every change (debounced 500ms) and restores it on page load. Validates shape with isValidRecipe() including a version check so stale/incompatible saved data is gracefully ignored. resetSettings() and reset() both clear the stored recipe. Closes magic-peach#656.
Pravallika21-nama pushed a commit to Pravallika21-nama/reframe that referenced this pull request May 22, 2026
…agic-peach#838)

Saves the complete recipe to localStorage on every change (debounced 500ms) and restores it on page load. Validates shape with isValidRecipe() including a version check so stale/incompatible saved data is gracefully ignored. resetSettings() and reset() both clear the stored recipe. Closes magic-peach#656.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GSSoC'26 gssoc'26 GirlScript Summer of Code 2026 level:intermediate Intermediate level - 35 pts quality:clean Well-implemented, clean code type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: persist editor settings to localStorage — remember last-used recipe

2 participants