Bug 336111

Summary: Message editor should prompt to save on ANY change, not only body
Product: [Unmaintained] trojita Reporter: James Harkins <biz>
Component: Message ComposerAssignee: Trojita default assignee <trojita-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 0.4.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description James Harkins 2014-06-12 07:58:31 UTC
I just spent several minutes individually pasting about 30 e-mail addresses into a message, which I intended to save as a draft for later reuse. Because I made several changes (adding several To fields and editing the subject line), I expected that clicking Cancel would ask if I wanted to save the draft.

Instead, Trojita sees the empty message body, assumes there is nothing to save, and then throws away the last few minutes of my work.

I don't know any other program that regards some edits within a window as being disposable. Users may reasonably expect that ANY change in the message composer would be enough to prompt to save a draft. Users may reasonably expect to be able to save a message draft with an empty body.

Reproducible: Always

Steps to Reproduce:
1. New message
2. Add a recipient
3. Cancel
Actual Results:  
The change to message headers will be discarded

Expected Results:  
Trojita should ask if you really want to throw away the changes, or save as a draft
Comment 1 Jan Kundrát 2014-06-12 09:57:15 UTC
Indeed, that's a rather annoying bug -- sorry for wasting your time.

As usual, patches are welcome.
Comment 2 Thomas Lübking 2014-06-12 19:24:32 UTC
the button should probably not say "cancel" when about to offer to send as draft. being asked back when you accidentally close the window is a nice surprise, but the "cancel" button should also sell you the good feeling that you're not dropping this mail.
"Drop or Draft", but that only works in english (could be too much text in other langs)
-> should we have an explicit "Save draft" button (and keep the dialog for cancel/close?)



semi-related mass mailing tasks:
---------------------------------------
1) improve mailing/addressing from addressbook, eg. DnD an account onto a composer (and in doubt ask which address to use)
2) support mail groups in the addressbook (so you mail "family" and send them your latest boring pictures of your napping baby...)
3) address splitting ...

I'll certainly find the time for 1&2 this WE, but 3 will require me to look up the spec again - hope for rainy weather ;-)
Comment 3 Jan Kundrát 2014-06-13 17:27:20 UTC
(In reply to comment #2)
> the button should probably not say "cancel" when about to offer to send as
> draft. being asked back when you accidentally close the window is a nice
> surprise, but the "cancel" button should also sell you the good feeling that
> you're not dropping this mail.
> "Drop or Draft", but that only works in english (could be too much text in
> other langs)

What about just "close"?

> -> should we have an explicit "Save draft" button (and keep the dialog for
> cancel/close?)

Wouldn't that be too many buttons already?

> 1) improve mailing/addressing from addressbook, eg. DnD an account onto a
> composer (and in doubt ask which address to use)

Please think about the other AddressBook implementations when designing this -- see Pali's (unmerged, unfortunately) GSoC work from last year.

> 2) support mail groups in the addressbook (so you mail "family" and send
> them your latest boring pictures of your napping baby...)

In my opinion the current abook address book is something of a limited use -- unlike the mail data which can easily be shared between multiple devices, this is limited to a single machine. What I would love to see, long-term, is a CardDAV implementation :).

-> Just saying that I won't be putting much of my time into the current implementation, but I'll of course be happy to review patches.

> 3) address splitting ...

Like splitting "Mama <foo@example.org>, My sweet daddy <bar@example.org>" into two entries? Someone requested that earlier, IIRC. Just beware of the RFC5322 addressing mess so that we never screw up here.

> I'll certainly find the time for 1&2 this WE, but 3 will require me to look
> up the spec again - hope for rainy weather ;-)

Good news!

James, there's a patch at https://git.reviewboard.kde.org/r/118727/ which is waiting for Karan to wake up and apply it.
Comment 4 Karan Luthra 2014-06-13 21:43:06 UTC
Git commit 23db0d537a29b79139f11111737ef162c5f0969d by Karan Luthra.
Committed on 12/06/2014 at 19:40.
Pushed by karanluthra into branch 'master'.

Show save draft dialog on change of recipients or subject as well

Treat changes to the recipients or subject line as changes to
message. Previously, only changes to the Composer TextEdit and
Sender field counted as "Message Updated"
REVIEW: 118727

M  +3    -1    src/Gui/ComposeWidget.cpp

http://commits.kde.org/trojita/23db0d537a29b79139f11111737ef162c5f0969d