Duplicate Alert before leaving unsaved draft

Discussion in 'Suggestions' started by KingBrowser, May 19, 2020.

  1. KingBrowser

    KingBrowser Virgin

    I just accidentally refreshed on an in-progress draft on CHYOA and lost a ton of changes.

    Javascript provides the event beforeunload which CHYOA could hook into on editing screens and show a dialog when a user is about to leave without saving changes.

    This would hopefully save future poor souls in my position :)
     
    insertnamehere and Haoro like this.
  2. Haoro

    Haoro Really Really Experienced CHYOA Backer

    Yep, that's happened to me as well. Very frustrating!
     
  3. brevdravis

    brevdravis Really Really Experienced

    Might be nice... similar to that normal pop up that some websites trigger with the "Warning, information you have entered will not be sent" nag screen.

    Of course, It also reminds me a bit of the old school adventure games the way it is now. Remember! Save EARLY! SAVE OFTEN!
     
  4. gene.sis

    gene.sis CHYOA Guru

    Duplicate of Prompt before improperly leaving the edit page
    and Confirmation before exiting tab/browser when typing chapter.

    Some people might need the ability to close the browser as quickly as possible, so a feature like might get them into trouble longterm.

    There are browser extensions that create a popup when you try to close the browser or browser tab. (You can choose what sites should be affected by the extension, so you can use it for other sites as well.)
    See here.
    I guess there are similar browser extensions for all common browsers.
     
    brevdravis likes this.
  5. insertnamehere

    insertnamehere Really Really Experienced

    Unless you are implying something else I'm missing, I would suggest that potentially saving an hour's work might take precedence over protecting a 14-year-old from his mother's snooping, at least on average.
     
    KingBrowser likes this.
  6. gene.sis

    gene.sis CHYOA Guru

    The minimum age for the site is 18 but these users still can have important reasons to be able to close their browsers quickly.

    As already said on the other threads, automatically saving as draft from time to time might be a good solution. (Though it is not that easy to implement as you should still be able to discard changes for existing chapters.)

    And as written above, it is possible to create that confirmation popup and set it up only on the browsers/devices where you want to use it.
     
  7. KingBrowser

    KingBrowser Virgin

    As a web developer by trade, I must say I highly disagree!

    Showing those dialogs is a web standard and an expected UX. Because of that, people (like myself) will only find out that they need an extension to provide it after losing a draft.

    Plus, there are shortcuts on all platforms to advance the prompt and close the tab. It's typically just Ctrl/Cmd-W, Enter. Those concerned with closing ASAP can simply press those two key sequences in quick succession.

    Simplifying that to a single key sequence and thereby allowing people to lose in-progress work is casting the baby out with the bathwater in a big way IMO. Heck, if we're absolutely concerned with having a single hotkey escape hatch for users we can add that as an checkbox to the preferences.

    Auto-saving would be a great upgrade as well, but I would similarly still expect this JS hook to be present if the user closes in between the saving periods.
     
    insertnamehere likes this.