Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-13320

Prompt before closing forms with unsaved changes

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2023-11-13
    • None
    • Editing interface
    • None

      I frequently accidentally close the artist editor by hitting Ctrl+W instead of Ctrl+V (they're next to each other in my keyboard layout). When I do this, I can restore the tab in Chrome with Ctrl+Shift+T, but any values that I entered in JavaScript-heavy fields (Area, Relationships, External Links) are lost.

      The release editor (MBS-5530) and relationship editor (MBS-5364) both use beforeunload to prompt the user if they have any unsaved edits. I think that the relevant code for the release editor is at https://github.com/metabrainz/musicbrainz-server/blob/ef9817a85c7cae102aaf3ce8277ca78dbf48fe0a/root/static/scripts/release-editor/init.js#L260-L277.

      It would be nice if the same approach could also be used in all other forms:

      • Add/Edit Artist
      • Add/Edit Label
      • Add/Edit Release Group
      • Add Standalone Recording
      • Add/Edit Work
      • Add/Edit Place
      • Add/Edit Series
      • Add/Edit Event
      • Edit Recording

      (I'm sure that I missed some!)

            derat derat
            derat derat
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2023-11-13