Skip to content

fix: prevent accidental navigation during video export#745

Open
Ram-sah19 wants to merge 1 commit into
magic-peach:mainfrom
Ram-sah19:fix-video-export-warning
Open

fix: prevent accidental navigation during video export#745
Ram-sah19 wants to merge 1 commit into
magic-peach:mainfrom
Ram-sah19:fix-video-export-warning

Conversation

@Ram-sah19
Copy link
Copy Markdown

Description

This PR fixes the issue where refreshing or closing the browser tab during an active video export would immediately cancel the export process without warning.

Changes Made

  • Updated the beforeunload event listener in useVideoEditor.ts

  • Added e.returnValue = "" to ensure modern browsers trigger the native confirmation dialog

  • Refined the shouldWarn condition to activate only during:

    • loading-engine
    • exporting
  • Removed the done status from the warning condition so the event listener detaches correctly after a successful export

These changes improve export reliability and help prevent accidental interruption during long-running video exports.


Related Issue

Closes #740


Type of Contribution

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

Participant Info

  • GitHub username: @Ram-sah19
  • Contribution level: Intermediate

Screenshot

image image

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@Ram-sah19 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 github-actions Bot added the level:beginner Beginner level - 20 pts label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @Ram-sah19

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
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Ram-sah19!

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 type:bug Bug fix type:docs Documentation type:feature New feature gssoc'26 GirlScript Summer of Code 2026 labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts type:bug Bug fix type:docs Documentation type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Warning Before Closing Tab During Export

1 participant