Tracked by: bug 251296
The primary objectives of this project are to:
- Allow the user to make better use of screen real estate by choosing which folders to see in the folder pane.
Many users, especially power users, have a large number of accounts and/or folders. Adding saved searches adds to the number of folders in the folder pane. Having a lot of folders forces users to scroll to see which folders have new mail, and to open folders.
Also, if you have limited screen real estate, using the "wide view" layout, which has a short folder pane, can increase the amount of the screen used to display messages. The wide view layout puts a premium on displaying a limited number of folders.
Microsoft Outlook has the concept of favorite folders, where you designate folders as "favorites" and they show up in a group at the top of the folder pane. We would like to give the user more flexibility.
Front End Design
Currently, by clicking on the folder name column, you can cycle between four different folder views:
- All Folders (the only view available in 1.5)
- Folders With Unread Messages
- Favorite Folders
- Most Recently Used folders
The three new folder views are all flat - there's no hierarchy structure, since the point is to have a simplified view.
The views are dynamic, so for example, if new mail arrives in a folder, the folder will appear in the MRU folder view, and the Folders with Unread view.
We sort the special folders to the top, just like we do within an individual account in the "All Folders" view. If two folders have the same name, we distinguish them using the account name, e.g., Inbox - email@example.com
A folder's "favorite" status is set/cleared via the folder context menu.
The MRU view consists of recently used folders, and folders with new messages. Opening or copying a message into a folder updates the most recent use date of a folder.
I would like to see a folder drop down menu to choose between folder views, instead of having to cycle through the views.
Scott has proposed just having two views, All Folders, and Smart Folders. Smart Folders would be a combination of the Favorites, MRU folders, and Folders with unread, plus some automatically created virtual folders that might appear based on some context, e.g., if you tag a message, we might create a virtual folder of all the messages with that tag.
Back End Implementation
The new folder views are implemented as datasources, sub-classes of nsMsgFolderDataSource, which implements the standard all folders view. The three special views are sub-classes of nsMsgFlatFolderDataSource: http://lxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgFolderDataSource.h#304
Each sub-class overrides a virtual method, WantsThisFolder, which is called when building up the datasources. A few nsMsgFolderDataSource methods are overridden to handle things like adding folders to a view when the folder changes, e.g., adding a folder that has a new unread message to the unread folders view, and the mru view.