18

If I add a comment but navigate (by mistake) to another page, I lose my unfinished comment (ok, depends on browser etc). On the other hand, when formulating a question, and I click on a link by mistake, I'm asked if I really want to leave.

It would be nice to have this warning for comments as well.

4
  • 3
    Happened to me again just now, I find this quite annoying. Apr 17, 2013 at 16:27
  • 1
    I'm not that sure, if this depends on browsers. I've been using few of them and non of them saves comment edit field's contents upon accidental navigation.
    – trejder
    Dec 18, 2013 at 9:21
  • @trejder: you're right, I remember Opera being particularly good at this. Dec 18, 2013 at 14:05
  • In the meantime, use the Stacks Editor at editor.stackoverflow.design in a new tab (Ctrl+Click) without back and forward history.
    – cachius
    Apr 21 at 16:18

4 Answers 4

17

This has been declined several times 1 2 3 4 with two related arguments:

  • Comments have little content so little is lost, anything significant should be an edit or an answer instead.
  • Comments are not important, so the system shouldn't make them easier to use.

The problem with this argument is that they apply to chatty comments, but that's not all that comments are about. I've been hit several times by this while composing moderation-related comments (both as a diamond moderator and as a user guiding other users). I try to give tailored guidance to users, so I might write a comment like this:

Welcome to Foo Bar Stack Exchange. This is a [questions and answers site](http://foobar.stackexchange.com/tour), not a discussion forum. We've found that [questions about … ](http://meta.foobar.stackexchange.com/questions/98/should-we-have-a-policy-about-questions-about-ellipsis) invariably lead to extended discussion and exchanges of opinion rather than useful advice, which [does not fit in our Q&A format](http://foobar.stackexchange.com/help/dont-ask), so I am voting to close this question. You're welcome to drop in to our [chat room](

*#*(\&\@\T#\%\&\^#( accidentally left-clicked instead of middle-clicked to find the link to the chat room.

Now I can retype this. Or I can just cast a close vote and not offer any guidance.

There are comments with real content, that take several minutes to write. Not all comments are trivial, and these non-trivial comments are the most important ones. Making comments so easy to lose is an incentive to not leaving any constructive guidance — leave a form comment or none at all. It would make sense if the system was geared against form comments, but it's actually geared towards them since specific comments are so brittle to compose.

Please arrange for the system not to hinder constructive comments. Either save the unfinished comment somewhere and recall it on page load, or arrange for the browser to do that (it should work both when clicking on a link and when closing the tab — I wrote this answer after accidentally closing the wrong tab while composing a comment a bit like the one above). Or alternatively display a confirmation warning when navigating out of the page.

I prefer saving and restoring the comment to a navigation warning, because transparent save/restore is seamless and isn't in my way if I just decide to abandon the page. Ideally the comment would be saved on the server side so I can start composing a comment on one machine and finish it on another, but that would be icing on the cake. I can see the advantage to a navigation warning as well — it alerts me that I might have forgotten to send a comment, and if I want to cancel that comment, it's very easy to delete the text from the entry box. But either way, don't make me lose work because of one misclick during normal workflow.

11
+100

Take matters into your own hands with this simple userscript. It saves unsent comments when you leave a page, and restores them when you come back, using HTML5 localStorage. Tested on Chrome and Firefox.

3
  • 1
    If you can see this, then the userscript works. Thank you! Jul 4, 2014 at 11:34
  • I've posted that comment (“If you can see this…”), but its draft still appears when I pull up this page. Let's see what happens if I post a new comment… <edit> No, every time I reopen this page, the “If you can see this…” comment draft reappears. I can edit the draft to something different, but if I make the edit box blank, the last saved draft reappears. Jul 7, 2014 at 18:45
  • @Gilles Hmm, it should clear when you submit, but I may have missed something. I'll check the gist tonight.
    – fredley
    Jul 7, 2014 at 18:55
5

I also don't enjoy the losing comments, especially since I use a dwell clicking software with a head controlled mouse, which makes it more likely to inadvertently click on some links while writing a comment. It is aggravated by the fact that on some Stack Exchange websites the contrast between the links and the text is too low.

Anyway, Stack Overflow Extras (SOX) has an option to give a warning if you click on a link without having sent your comment first.

1
  • 1
    +1, thanks. Personally I used a plain chromebook... which has back/forward as a touchpad gesture which I managed to accidentally trigger.
    – sourcejedi
    Jun 23, 2018 at 9:57
1

Comments are meant to be transitory. Unlike posts, where you might actually put significant effort into writing the text, comments are designed to be throwaway.

That's why there's a warning for posts, but not for comments.

5
  • 3
    Ok, still find it annoying, but I understand that point of view. Jul 22, 2011 at 17:54
  • 3
    Although on the other hand, comments can have 600 characters and basic formatting. If they were as short as twitter messages and without any formatting, then I could understand this better. May 11, 2012 at 8:06
  • 2
    Implementing feature of saving unposted comments (drafts) in cookies and restoring them back (similarly to saving and restoring drafts of uposted question or answer) doesn't seems to be a hard work for dev team and would ease users life really much. So, pity, but I find your decision on not implementing this, like: "We're The Dev Team, we say: no saving to comments, so shut up! If you don't like it, go find yourself a better website". This is, another pity, example how creators of famous website doesn't care for users opinion at all. Feel free to correct me, if I'm wrong.
    – trejder
    Dec 18, 2013 at 9:27
  • 1
    @trejder: luckily there are tools like Greasemonkey and sites like userscripts.org. No one has made a warning-upon-leaving-page-with-unsubmitted-comments script so far (as far as I can see), but it wouldn't be too hard. Dec 18, 2013 at 14:07
  • 2
    If you were going to post some links in your comment, you could have lost 10 minutes of your research. Jan 6, 2014 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .