Page MenuHomePhabricator

Migrate warning prompt before closing the recording window and pending uploads from Common.js to RecordWizard's code
Closed, ResolvedPublicFeature

Description

Several users have brought up the issue over the past few months on Discord. Unlike other websites which prompts the user a confirmation if they try to close the window "without saving", Lingua Libre does not. This sometimes leads to the loss of dozens or hundreds of recordings which were inadvertently not uploaded.

The RecordWizard (in its Vue.js component) should prompt the user to confirm leaving the page in the event they have any "unsaved" progress. This includes, but might not be limited to:

  • when there is one word or more in the word list
  • while recording words
  • while listening to the recordings
  • while uploading the recordings to Commons

Event Timeline

Pamputt changed the subtype of this task from "Task" to "Feature Request".Feb 16 2021, 4:47 PM

Suggestion of JS snippet, tested and approved by @Poslovitch:

window.onbeforeunload = function() {
  return "A warning message about losing the unsent data";
}
WikiLucas00 changed the task status from Open to In Progress.Oct 11 2021, 12:04 PM

Per this patch to Common.js, the alert is sent to the user on the Record Wizard page. This should be integrated into the Record Wizard's code in the future though.

Yug renamed this task from Prompt users before closing the window when recordings are pending upload to Migrate warning prompt before closing the recording window and pending uploads from Common.js to RecordWizard's code.Jan 30 2022, 4:44 PM
Yug subscribed.

We have the prompt alert : it's working. The migration of the code is something else.

0x010C claimed this task.
0x010C subscribed.

This feature was already implemented in an early version of the RecordWizard, but was somehow lost in 2019-2020 during the migration to VueJs.

Done in commit 8f4adbc4.
The prompt to confirm leaving will be displayed as long as there is at least one audio/video file recorded but not fully published.