gorilla-repl icon indicating copy to clipboard operation
gorilla-repl copied to clipboard

Add window.onbeforeunload to warn on unsaved worksheet

Open rauhs opened this issue 9 years ago • 4 comments

I just tried out gorilla-repl for the first time. Super smooth, easy and had a plot within 5min. :+1: & Thanks.

One thing hit me quickly: I accidentally pressed CTRL-W (which expands selection in Cursive) and closed all my work.

Therefore, I'd suggest to add something like this if the work is not saved:

http://stackoverflow.com/questions/1119289/how-to-show-the-are-you-sure-you-want-to-navigate-away-from-this-page-when-ch

rauhs avatar Nov 23 '15 13:11 rauhs

Glad you're enjoying it :-)

I've got mixed feelings about this feature, and have thought about implementing it before but then backed off. The trade off I see is:

  • it's really annoying to lose unsaved work like that;
  • but, for me at least, it's arguably more annoying when I have to dismiss those damned dialog boxes when I want to close a tab that I already know that I don't care to save!

I've found that a bit of "user training" goes on, and I pretty much never accidentally close (or reload, which is equally annoying) the windows any more! Not sure that's great software design though ...

JonyEpsilon avatar Nov 24 '15 11:11 JonyEpsilon

Or how about and auto-save into /tmp and allowing CTRL+SHIFT+T to work?

rauhs avatar Nov 24 '15 12:11 rauhs

Yeah, that would be a nice approach. Mentioning issue #48 to keep things tied together.

JonyEpsilon avatar Nov 26 '15 14:11 JonyEpsilon

Hi! I had a similar (novice/smooth/easy :D and frustrating :/) experience. I want to add one more point to support the pop-up when closing unsaved tab: it's an expected UX behavior and virtually all software out there prevents you from discarding unsaved changes without asking. Therefore, I live in an constant anxiety when working with Gorilla being afraid of doing something that would accidentally close my tab ;) .

Auto-save is a great idea, but it doesn't solve the problem.

Thanks!

rqcy avatar Mar 03 '16 20:03 rqcy