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
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
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
Expected Behavior
When a video export is in progress:
Proposed Solution
Add a
beforeunloadevent listener inuseVideoEditor.tsthat:status === "loading-engine"status === "exporting"Files to Modify
useVideoEditor.tsAcceptance Criteria