Skip to content

[FEATURE] Add Warning Before Closing Tab During Export #740

@CodeSrushti-3105

Description

@CodeSrushti-3105

Description

Problem

Currently, when a user is exporting a video and accidentally refreshes the page or closes the browser tab, the export process is immediately cancelled without any warning. This creates a frustrating experience, especially for large video exports that take several minutes to complete.

Users may unintentionally lose all export progress and be forced to restart the process from the beginning.


Current Behavior

  • User starts video export
  • User accidentally refreshes the page or closes the browser tab
  • Export process is cancelled instantly
  • No warning or confirmation is shown
  • User loses all export progress

Expected Behavior

When a video export is in progress:

  • Attempting to refresh or close the page should trigger a browser warning dialog
  • Users should receive a message indicating that an export is currently running
  • Users should be able to choose whether to stay on the page or leave

Proposed Solution

Add a beforeunload event listener in useVideoEditor.ts that:

  • Activates when:
    • status === "loading-engine"
    • status === "exporting"
  • Displays the browser’s native warning dialog
  • Prevents accidental navigation during export
  • Automatically removes the listener once export is completed or cancelled

Files to Modify

  • useVideoEditor.ts

Acceptance Criteria

  • Browser warning appears during active export
  • Warning is triggered on refresh, tab close, or page navigation
  • Warning only appears while export is in progress
  • Event listener is removed properly after export completion/cancellation
  • Existing export workflow continues working correctly

Metadata

Metadata

Assignees

Labels

enhancementImprovement to existing functionalityfeatureNew feature requesttype:featureNew feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions