Abandoning draft with Esc is not reliable.



    1. Go to a topic.
    2. Start writing a reply.
    3. Decide your reply sucks, delete it with Ctrl+A, Backspace and cancel the window with Esc.
    4. Observe that the reply window disappears completely and isn't just lurking at the bottom of the screen generally getting in the way, consistent with an abandoned draft.
    5. Navigate elsewhere.
    6. Come back to the original topic (maybe an hour or so later, when you've completely forgotten about it).
    7. Observe that the text you deleted has reappeared in the reply window.

    Happens often enough that it's a nuisance but today's the first time I was able to repro it consistently. Probably something between 50-75% probability.



  • There is probably 100% probability

    Pressing Esc on a draft that was saved previously with some content
    and then cleared by the user (ctrl+aBackspace)

    Result:

    1. A draft is saved on the server
    2. There is no trigger to save when the composer is emptied.
    3. If the composer is empty and Esc was clicked, it will "hide" it instead of minimize it. giving you the false sense that it silently discarded it.

    That is bad UX

    Technically you are not abandoning the draft. abandon only occur when you see the prompt.

    A nice feature will be to be prompted to abandon for this scenario.


  • I survived the hour long Uno hand

    Doesn't need to escape. I get it when I change threads: I am writing something, cancel it, go post something else, come back to the original thread, my draft is still there.


  • area_deu

    There's a cancel button, though ...



  • @aliceif said:

    There's a cancel button, though ...

    I just have a 'cancel' link... :(

    But there ought to be a keyboard shortcut to the cancel function— Ctrl+Enter works for reply. It's discoursisent to have one but not the other...


  • BINNED

    @Yamikuronue said:

    Doesn't need to escape. I get it when I change threads: I am writing something, cancel it, go post something else, come back to the original thread, my draft is still there.

    Also, I always get it when commenting in the SOTD comment thread.

    Since onebox kills the embedded content I always hit reply, quote, then navigate to the comment thread and post there when asked. Next time I return to the SOTD thread the draft is still there.



  • @Monarch said:

    There is no trigger to save when the composer is emptied.

    Ummm...yeah, but... :worried:

    Isn't emptying the composer a text change? Under what other circumstances does the composer decide that it just doesn't need to be bothered save a change to the text? Or is this just a special feature to keep the user from deleting what the user meant to delete?



  • It's probably just written as a "avoid extra work" thing - if (!isEmpty(text)) saveDraft()



  • Wouldn't it make more sense to do if (oldText !⩵ text) { saveDraft(); }?



  • I think saving is actually on a timer after the last keypress (that being either delete or esc in this case). Once that timer hits, jQuery can't find the text box*, so it leaves it as the saved version.

    * Type $('#wmd-input').val() in your browser's javascript console with the composer open and something in the text box, then press esc and try it again.



  • I'm going to get on my high UX horse and declare that using Esc to mean 'hide my in-progress draft' is wrong, and at the very least they should add a checkbox:

    :fa_check_square_o: Esc means Cancel like in any normal application

    to the user preferences. Giving Esc non-standard semantics in the first place is The Real WTF™

    (They should probably have used something like Ctrl+H for 'hide window' instead. Anyway, they'll never change it now, so I guess we're stuck with it...)



  • @hungrier said:

    I think saving is actually on a timer after the last keypress (that being either delete or esc in this case). Once that timer hits, jQuery can't find the text box*, so it leaves it as the saved version.

    Oh. I see. It's just a bug.



  • If you prefer that Esc will always Cancel(discard), Puts this in Tampermonkey, it will prompt you to discard.

    Though you will miss the quick discard when the message was initially empty or didn't change. (it will take an extra step Enter to confirm)

    $(document).ready(function(){Discourse.ComposerController.prototype._actions.hitEsc=function(){var a=this;Em.run.later(function(){a.cancelComposer()},300)}});
    

Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.