Make "Copies and Folders" settings page produce consistent results
Categories
(MailNews Core :: General, enhancement)
Tracking
(Not tracked)
People
(Reporter: gds, Assigned: gds)
References
Details
Attachments
(1 file)
First, this is in objection to the changes implemented in bug 2047462. As I reported in bug 2047462 comment 9, at bug 2047462 comment 12 and at https://phabricator.services.mozilla.com/D306647, you can end up with multiple folders having the "Sent" icon. This would also be true of the other special folder types handled by the "Copies and Folders" config page.
My proposed changes here are based on the assumption that changes for bug 2047462 never landed and makes some modification to the changes made by bug 2039958 and implements the idea I proposed here at bug 2047462 comment 4:
Maybe there needs to be a new "permanent" flag for only the folder that the server says is sent folder called maybe \SentPerServer while using the current \SentMail flag for the folder currently selected as sent folder. The single folder, if any, having the new \SentPerServer flag should be selected for sent when the 1st radio selection is used and it also has the \SentMail flag. Otherwise, the \SentMail flag is added to the newly selected sent folder and removed from the old sent folder as it currently is. This avoids ending up with more than one folder marked with sent icon that become un-deleteable and can't be renamed and this should avoid creating a new/incorrect/unwanted "Sent" folder as I observed without your patch.
My proposed change extends this to all the special folder types shown on "Copies and Folders" and to Trash and Junk special folders. Instead of a assigning a currently unused bit to each of the special folder types, to conserve bits I use a group of 3 contiguous currently unused bits and assign a value to each folder type like this in mailnews/base/public/nsMsgFolderFlags.idl:
// This now uses Used4, Used7 and Used6 above, so no longer unused.
// Values get set when imap server list/xlist returns the folder usage.
// Here "Per" is short for "according to".
const nsMsgFolderFlagType TrashPerServer = 1 << 16;
const nsMsgFolderFlagType SentPerServer = 2 << 16;
const nsMsgFolderFlagType DraftsPerServer = 3 << 16;
const nsMsgFolderFlagType ArchivePerServer = 4 << 16;
const nsMsgFolderFlagType JunkPerServer = 5 << 16;
const nsMsgFolderFlagType PerServerMask = 7 << 16;
const nsMsgFolderFlagType NoPerServer = 0 << 16; // E.g., Templates
So now with these flag values set permanently for a folder when the server reports it as "special" and with some additions to the changes at bug 2039958, the observed problem of multiple folders having the same special folder icon no longer occurs.
Problem 2: When an account is set up and Sent, Drafts or Templates don't already exist on the server they will be created in the selected account after a message is sent or a draft or template is saved, which is Ok. However, if folder Archives doesn't exist on the server, it will be created in Local Folders when a message is archived and not in the selected account. This appears to be a regression since it worked correctly on an old laptop still running TB 68.10.1 (archive and subfolders created inside the account on 1st archive attempt and NOT in Local Folders). Looking closer, I also found that this also worked before the fix for bug 1958106 landed, so actually this seems to be a fairly recent regression.
My fix for this seems to work but not sure it is "correct" since it is doing async folder creation on imap server in a function that seems to be mainly intended for sync folder creation to Local Folders and pop3 folders.
For now I'm just attaching the raw "diff" which needs some clean-up before putting it in moz-phab. It also includes a change I made to allow the special folder folder flags to be reset. This allows a folder with special folder icon to be reset back to a normal folder (in folder properties dialog) so it can be deleted or renamed. It's a useful feature that I use a lot for testing but, currently not part of this proposal.
Updated•4 months ago
|
Comment 1•4 months ago
|
||
Hi Gene,
Thanks very much for this and sticking with the issue - there certainly is some potential for confusion in what we had previously, what we have now, and possibly even what you have proposed. You have thought this through and presented it extremely clearly which is very much appreciated.
Your solution changes the folder flag model substantially which feels like a larger architectural change than what we were trying to accomplish with bug 2047462 so am hoping to hold this until our senior team is back from PTO.
I suspect that for now, the team will want to keep the fixes from bug 2047462 so we retain the servers' special-use info, and have more in-depth discussions about the UX involved in your proposal (and potentially others) after some research into usage patterns in this area. Introducing new paradigms to distinguish between server-designated and user-designated special folders isn't simple so we'll loop in our UX team and perhaps discuss this in a mailing list so we can agree on the design before jumping into implementation.
Updated•4 months ago
|
Comment 2•4 months ago
|
||
I had added regression for comment 0 "Problem 2:". Perhaps it should be filed as its own bug?
Comment 3•4 months ago
|
||
Oh yes please can you do that Magnus and add to bug 2052233?
Comment 4•4 months ago
|
||
Gene, can you handle it as you have the first hand knowledge?
| Assignee | ||
Comment 5•4 months ago
|
||
(In reply to Magnus Melin [:mkmelin] (away until Aug 10) from comment #4)
Gene, can you handle it as you have the first hand knowledge?
Add new bug 2055743 for "problem 2".
Re: comment 3:
please ... add to bug 2052233
Not sure what to add for this, or if you want me to.
Description
•