JonyEpsilon / gorilla-repl

A rich REPL for Clojure in the notebook style.
http://gorilla-repl.org
MIT License
888 stars 104 forks source link

Add window.onbeforeunload to warn on unsaved worksheet #236

Open rauhs opened 8 years ago

rauhs commented 8 years ago

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

JonyEpsilon commented 8 years ago

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:

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 ...

rauhs commented 8 years ago

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

JonyEpsilon commented 8 years ago

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

rqcy commented 8 years ago

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!