After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731623 - GNotification: add support for a priority setting
GNotification: add support for a priority setting
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-06-13 16:06 UTC by Allan Day
Modified: 2014-06-28 18:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GNotification: add priority (10.08 KB, patch)
2014-06-15 13:45 UTC, Lars Karlitski
accepted-commit_now Details | Review
GNotification: add priority (10.03 KB, patch)
2014-06-23 09:51 UTC, Lars Karlitski
none Details | Review
GNotification: add priority (10.30 KB, patch)
2014-06-23 10:36 UTC, Lars Karlitski
committed Details | Review

Description Allan Day 2014-06-13 16:06:09 UTC
A common use case for notifications is to provide background or contextual information. Examples of this kind of notification include weather information, stock prices, currency conversions, travel information, or birthdays of contacts.

The key difference between background and other types of notifications is that attention is that they can be read at a time that suits the user - there is no urgency for them to be attended to immediately.

In the case of GNOME Shell, background notifications would not be shown as a banner, and would only be displayed in the Message Tray.

As a point of reference, the Android notification API allows notifications to be set as background/contextual through their priority setting:

http://developer.android.com/design/patterns/notifications.html

Using a priority setting for this might make the API a little more generic. Being able to set a notification as high-priority could also open interesting possibilities.
Comment 1 Allan Day 2014-06-13 16:29:57 UTC
Having discussed this with Lars on IRC, it seems that there might be a reasonable need to support a priority setting with the following categories:

 * URGENT - eg. calls, emergency alerts.
 * HIGH - eg. chat messages, SMS.
 * NORMAL - the default setting.
 * BACKGROUND - examples described in the original report above.

Urgent would be used for events that require attention to the level where other notifications can be ignored. Examples include incoming calls or emergency alerts.

High priority notifications would be used for time sensitive events, such as chat messages or SMS.
Comment 2 Lars Karlitski 2014-06-15 13:45:25 UTC
Created attachment 278484 [details] [review]
GNotification: add priority

I don't know if we want to keep it the way we discussed, but here's a first
implementation.
Comment 3 Matthias Clasen 2014-06-18 17:30:44 UTC
Review of attachment 278484 [details] [review]:

Looks fine to me.
Comment 4 Allan Day 2014-06-18 17:52:42 UTC
One thing I'm not sure about is the name for the lowest priority, as BACKGROUND seems a bit too tied to the UI we're building. Using a more generic name would give us more flexibility, and could possibly help with cross-platform issues. What if we later decide that we want to bring background notifications into the foreground, for example?

LOW or MINIMUM could be alternatives to BACKGROUND.
Comment 5 Matthias Clasen 2014-06-19 13:18:12 UTC
True. LOW sounds fine to me.
Comment 6 Lars Karlitski 2014-06-23 09:51:34 UTC
Created attachment 278980 [details] [review]
GNotification: add priority

Rename the 'background' priority to 'low' and fix GNotificationPriority's doc
string.

I'm not sure if we still need all four of those priorities. It's getting a bit
hard to explain the difference between them in the documentation string.
Comment 7 Lars Karlitski 2014-06-23 10:36:42 UTC
Created attachment 278982 [details] [review]
GNotification: add priority

Clarify priority documentation. Thanks Allan!
Comment 8 Matthias Clasen 2014-06-25 20:46:08 UTC
Review of attachment 278982 [details] [review]:

Still looks fine to me
Comment 9 Matthias Clasen 2014-06-28 18:07:19 UTC
Attachment 278982 [details] pushed as 01098e3 - GNotification: add priority