Closed Bug 312940 Opened 19 years ago Closed 18 years ago

Improve the alert notification for new mail

Categories

(Thunderbird :: Mail Window Front End, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird2.0

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: fixed1.8.1)

Attachments

(11 files)

Right now we show the account and the number of new messages in our alert window.

We can do something more interesting than that. Here's my first take on that:

-----------------------------------------
-            *Sender's Name*            -
-  XXXXX     *Subject*                  -
-  XXXXX     Message Text               -
-  XXXXX     More Message Text          -
-   (2)                                 -  
-----------------------------------------

XXX -- the new mail image

(2) -- total number of unread messages (maybe we don't show this text at all if
there is only one unread message)

Sender's Name and Subject in bold
Message Text - the first n characters of the message body, mabye this would span
               two lines in the alert popup.

We'd make the dialog a lot taller and probably wider than it is today to
accomodate this information.

Additional comments:

* How do we present multiple new messages? I think we show just the first one
* Clicking on the message text takes you to the unread message we are showing you?
* Show the alert even if we are already in the system tray from a previous biff
(currently we only show biff once until you read new mail).
Target Milestone: --- → Thunderbird2.0
this comment was attached to the wrong bug: 

We know the msg hdr for the first new message in a folder, it's a property on
nsIMsgfolder:

readonly attribute nsIMsgDBHdr firstNewMessage;

that should help.

Also, you can open the db and ask it for all the new messages as well, from
nsIMsgDatabase.idl:

  [noscript]
  readonly attribute nsMsgKeyArrayPtr newList;


if we need access from js, we can change this to something scriptable.
I strongly dislike displaying the message text or subject in the popup; I don't 
want the popup to get large, and there are privacy concerns.  e.g.: My boss is 
sitting with me at my system going over work, and suddenly a romantic message 
from my sweetie pops up at the bottom of the screen... no, thanks.  In fact, in 
this case, even the *name* of the mail source could cause problems: suppose in 
the same situation, I get a message from "Human Resources @ Competitor.Org"?

At the very least, if you're going to make changes like this, have the foresight 
to make it configurable, since you *know* that everybody wants something 
different in their notifications.


And before setting out on changes like these, how about fixing the popup so the 
information is correct?  See bug 138631.  As for:

> (currently we only show biff once until you read new mail).

This is bug 210148.  Both of these bugs, altho filed under "suite" (because 
there is no Core Notification category), apply to TB as well.

There are also a couple of notification bugs about wrong information in the tray 
icon's tooltip.
Severity: normal → enhancement
OS: Windows XP → All
Hardware: PC → All
it might be helpful to have access to the list of new messages from js, so I've made this scriptable, and fixed the c++ callers.
Attachment #200914 - Flags: superreview?(mscott)
Comment on attachment 200914 [details] [diff] [review]
make new list available in js

don't forget to bump the interface id.
Attachment #200914 - Flags: superreview?(mscott) → superreview+
Attached patch work in progressSplinter Review
very functional work in progress.
Comment on attachment 203293 [details] [diff] [review]
work in progress

This doesn't work very well for imap users who filter mail to other folders (the alert comes up blank), but I'd like to start landing this so you can start testing it with me. 

I'll change the thunderbird ifdef in nsMessengerWinIntegration.cpp to a #if 0.

There are some things we can still do here:

1) Create an alertUtils.js file in toolkit\alerts so we can share a couple of JS methods with the old toolkit alert service instead of copying them

2) I created a new XBL widget, a folderSummary and made the old popup widget use it. This allows the alert code and the popup code to use the  same XBL.

3) the alert shows up for a second in the middle of your screeen and then moves off screen. This is due to the timeout I'm firing in the folderSummary-message as I have to wait for the xbl properties to get bound to my dynamically created object. Still trying to figure out away around that.
Comment on attachment 203293 [details] [diff] [review]
work in progress

see my review summary in the comment above this one.
Attachment #203293 - Flags: superreview?(bienvenu)
Attachment #203293 - Flags: superreview?(bienvenu) → superreview+
This patch also fixes the alert for filtered pop3 messages, and cleans up some duplicated/unneeded imap code.

With this patch, you won't get preview text for imap message bodies because fetching those is async. Not sure how you want to deal with that, Scott.
Attachment #203593 - Flags: superreview?(mscott)
I'll ask a silly question, how is it I see the preview text today on my inbox with the new alert? It was just messages that were getting moved to another folder that didn't have the preview text. 
remember that mail analyzed for junk status will have preview text if that analysis causes the message to get into the memory cache (I whitelist, so most mail doesn't get analyzed, because it's from people I know).

w/o this patch, I think you wouldn't even see the subject or sender of messages filtered to other folders in imap, never mind the preview text.
Will there be option for transparency like in outlook?
Attachment #203593 - Flags: superreview?(mscott) → superreview+
Attached patch more workSplinter Review
I was able to remove some setTimeout hackery by setting string attributes on the message popup xbl widget instead of using an init method. The init method wasn't  getting bound to the xbl widget in time for the JS to call init unless I used a timeout. 

By getting rid of the timeout, I was then able to get rid of the delayedOnload method (which was waiting for the xbl timeout to fire). And this in turn fixes the problem where the alert briefly flashes in the middle of the screen before moving to the right location in the lower right hand corner.
Attachment #203852 - Flags: superreview?(bienvenu)
Comment on attachment 203852 [details] [diff] [review]
more work

great - I was seeing the alert in the upper left hand corner of my screen first :-)
Attachment #203852 - Flags: superreview?(bienvenu) → superreview+
Is displaying message text in the alert a potential security risk in the same way that having the 'preview pane' open can be?

It is often recommended to keep the preview pane closed to avoid opening mail before one has approved it. Are you providing the option to still show alerts but to not display message text in them?

Best regards, RDL
And is it possible to make an option to choose how long the new mail notification will appear? Because I would like to have sth like this, that when new mail comes and the new mail notification appears, it will last until I click it. And when I click it, Thunderbird which was minimized, will maximize. Is it possible?
Delay the new mail alert animation until after all of our asynchronous fetch preview text urls have completed loading.

1) Make the imap method for fetching preview text return true for the aAsync out parameter if the fetch is going to be async

2) parseFolder method now takes a url listener and an out parameter for async so the alert service can pass in a url listener

3) For each folder that has new mail, the alert service passes in a url listener object to parseFolder. As each fetch finishes, we call parseFolder again to fill in the fields for that folder on the alert. It also keeps track of the # of pending async urls being run. When that number hits zero we start the animation for the alert.

David, it might be good to double check what I'm doing in the first half of parseFolder in mailWidgets.xml. We'll be executing that stuff twice now for imap (once to kick off the async load and a second time to fill in the value when the data is available). This means calling msgDatabase.getNewList, calling fetchPreviewText, and setMsgDatabase(null) two times on each folder. I think that's all safe to do.
Attachment #204075 - Flags: superreview?(bienvenu)
Attachment #204075 - Flags: superreview?(bienvenu) → superreview+
Attached image updated screen shot
Scott, have you seen GTalk's new messages biff? A similar approach could be made in Thunderbird, if there is more than one new e-mail.
I *think* this will fix the new msg handling - it seems to work for both imap and pop3 for me. Let me know if this helps with the problem you're seeing. It also handles mime boundary detection for content types like multipart/signed
Attachment #204755 - Flags: superreview?(mscott)
Attachment #204755 - Flags: superreview?(mscott) → superreview+
While your playing around with the alert, you might come accross the oportunity to fix it so that if mail arrives for two+ accounts at the same time, the primary (top) acount is displayed (first).

If your going to pop a huge alert on peoples' screens, please add UI in the alert to *quickly* close it (e.g., red X in top-right corner).

The current alert behaves very well with full-screen (Direct-x & OpenGL) games (often alert even appears in-game, sometimes even legible, then slides out - very cool). Hopefully, the new (larger) alert wil not crash games!

Scott: What are your thoughts/plans regarding comment #2 (privacy issue)?

Will there be a pref to configure/disable the alert?

Ziga: could you please attach a screeshot of Google Talk's alert?
*** Bug 264196 has been marked as a duplicate of this bug. ***
*** Bug 324094 has been marked as a duplicate of this bug. ***
Is the core piece of this functionality ready for landing such that we should create separate bugs for enhancements to the approach? It seems like the last patches were positively reviewed.
Hi, please see the screenshot fastcheck_exampl.png. 
The fastcheck (http://www.fastcheck.org) program is the most functional notification popup I have found.
It only works with fastmail.fm account, but I thought showing it might help
in the desing of the thunderbird/mozilla mail notification popup.

The key features I like about this poup is that:
1) It popups up and stays on top.
2) It supports multiple accounts with the same program.
3) It lets you choose which folders to monitors. (Fastmail.fm lets
you create folders and message filters to auto filter mail to different
folders. Similar to what thunderbird lets you do.)
4) When there are multiple mails from the same sender, it groups them
together.  See the example for sender "Circ Email Notices" and "SparkPeople Communicty Highlight Newletter".
5) If you auto-filter messages to different folders and auto-mark some messages as read, fastcheck handles that with zero problems.
6) You can drag the notification window around the desktop so you can choose where you want it to appear, e.g. topleft corner, bottom left, center, etc.

It's not flashy looking, but I find it very functional and has all the features I want.  Hopefully the thunderbird/mozilla mail notification can do something similar.

I also agree with comments above that you should have option to not show the subject and/or not show the message text.
The previous code had lots of problems when showing messages that had long subjects and summary text. The text cropped cleanly but the alert window itself was still way to wide due to some bugs in sizeToContent.

I've worked around that by doing the resizing by hand and adding a few more max width style rules. This seems to work quite well so far on my test cases.

This was the last issue that was keeping me from turning this on, so flip the pref switch.
Attachment #213947 - Flags: superreview?(bienvenu)
Comment on attachment 213947 [details] [diff] [review]
properly size the window for long subjects / preview text

cool.
Attachment #213947 - Flags: superreview?(bienvenu) → superreview+
David landed most of this stuff already on the 1.8.1 branch.

This last patch is now there too. Closing this bug out now we can file new bugs for  new issues.
Status: NEW → RESOLVED
Closed: 18 years ago
Flags: blocking-thunderbird2+
Keywords: fixed1.8.1
Resolution: --- → FIXED
my last patch to handle long subjects isn't working right. I'm seeing some mail alerts that are only a few pixels tall. I think this is happening because sometimes biff goes off and we aren't getting any value back from the subject or summary text and that's throwing the height calculation off. 
Status: RESOLVED → REOPENED
Keywords: fixed1.8.1
Resolution: FIXED → ---
*** Bug 329427 has been marked as a duplicate of this bug. ***
With 0305 branch build, clicking on the alern notification (anywhere) does not bring up Thunderbird, or the newly-received message
Depends on: 329552
Depends on: 329553
This bug has gotten large enough. Let's start filing new bugs for issues with the new alert dialog. I just filed Bug 329522 and 329553.
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Depends on: 329555
Keywords: fixed1.8.1
Depends on: 329954
Depends on: 330523
I really don't like the notification box being this big.
[bug 314124 comment 30]
Agree on that. and it isn't flush against the right of the screen.
Depends on: 331265
I would really like the popup to disappear only on a user-action.
Click > Focus on Tb, first new mail opened.
RightClick > Dismiss the pop-up, but keep an icon in the tray as usual.
(In reply to comment #20)
> Created an attachment (id=204755) [details]
> fix new msg handling, and multipart/signed message body extraction

Is an indication of the signature status planned?
It would be useful to prioritize mail that is signed and verified (bypassing SPAM filters) and indicate this in the alert dialogue with the appropriate icon.
Furthermore there could be a differentiation (for the alert or being alerted at all) if the sender is found in the private address book.
Jez McKean, you can set option "alerts.totalOpenTime" to some very big value. Popup can be closed during this time by the "close" button. Not very nice solution, maybe some hacking with newmailalert.xul and .js sources can produce a nicer behaviour.
QA Contact: front-end
Blocks: 536390
No longer blocks: 536390
Blocks: 404580
You need to log in before you can comment on or make changes to this bug.