Re: [whatwg] Add a |transient| mechanism to the notifications API

2014-04-16 Thread Vivien Nicolas



On 15/04/2014 19:46, Anne van Kesteren wrote:

On Tue, Apr 15, 2014 at 5:12 PM, Domenic Denicola
dome...@domenicdenicola.com wrote:

 From my reading of Windows Phone 8.1 reviews, the way they handle this is by 
allowing applications to remove notifications themselves.


We already have this actually:

var = n = new Notification(...)
n.onshow = () = setTimeout(() = n.close(), 7000)


I guess this would be for the case where you close the window before
that timer is able to run. Normally that would leave the notification
in the notification center, but with say a duration member set to
non-zero it would be removed.



It could be done this way as mentioned.
What I'm looking for is a hint for the user agent, so such notifications 
can be displayed differently by the user-agent if it is the one 
rendering notifications, or forwarded to the underlying platform 
notifications API.




[whatwg] Add a |transient| mechanism to the notifications API

2014-04-15 Thread Vivien Nicolas

Hello,

Would it be possible to add a |transient| mechanism to the notifications 
spec ?


In the context of FirefosOS, one of the use case is for example an email 
application. For instance the user can write a message, click the send 
button, and then leave the application to do something else.


It would be useful if the application is able to give the user a 
transient notification that the email has been correctly sent.


This kind of notifications are not particularly useful after a while and 
should dismiss automatically after a small delay.


Looking at what others are doing, it seems related to 'Toasts'.


Here is what I found on google:
 Gnome is using a |transient| hint 
(https://bugzilla.gnome.org/show_bug.cgi?id=633412)


 Windows 8 call those type of notifications Toast and display them for 
7 seconds 
(http://msdn.microsoft.com/en-us/library/windows/apps/hh779727.aspx)


 Android also call that Toasts and let the user specify a duration 
(http://developer.android.com/guide/topics/ui/notifiers/toasts.html)


 iOS: It seems like this is not part of the default UI toolkit.

 Looking at Growl for mac (http://growl.info/) it seems like there is 
no possibility for the notifications to be transient or not. Instead 
everything is customizable by the user, and all notifications ends up 
into the 'Rollup' database (even when you mount/unmount a hard drive).



Regards,
Vivien.


Re: [whatwg] Add a |transient| mechanism to the notifications API

2014-04-15 Thread Domenic Denicola
This seems like a valuable feature. I am hopeful something like it can be added.

From my reading of Windows Phone 8.1 reviews, the way they handle this is by 
allowing applications to remove notifications themselves. This seems like the 
most flexible approach: applications could automatically remove the 
notification after 7 seconds, or e.g. remove them after the email has been 
read on another computer.


Re: [whatwg] Add a |transient| mechanism to the notifications API

2014-04-15 Thread Anne van Kesteren
On Tue, Apr 15, 2014 at 5:12 PM, Domenic Denicola
dome...@domenicdenicola.com wrote:
 From my reading of Windows Phone 8.1 reviews, the way they handle this is by 
 allowing applications to remove notifications themselves.

We already have this actually:

var = n = new Notification(...)
n.onshow = () = setTimeout(() = n.close(), 7000)


I guess this would be for the case where you close the window before
that timer is able to run. Normally that would leave the notification
in the notification center, but with say a duration member set to
non-zero it would be removed.


-- 
http://annevankesteren.nl/