Saving drafts of edited messages
There are two scenarios where a user can lose their input ATM:
- closing TMF when writing a message to the input box
- closing the message edit box without submitting the edited message (both TMF and MMF)
- this is even easier on mobile where we close the message edit on lost focus
Example solution
Main message feed input box is currently using drafty
utility.
- https://gitlab.com/gitlab-org/gitter/webapp/blob/ccc5b34c5c51d07fc6126fdb19f39e2442cc010b/public/js/views/chat/chat-input-box-view.js#L76
- https://gitlab.com/gitlab-org/gitter/webapp/blob/ccc5b34c5c51d07fc6126fdb19f39e2442cc010b/public/js/components/drafty.js
This utility stores the draft into window.localStorage
based on a unique id.