google / material-design-lite

Material Design Components in HTML/CSS/JS
https://getmdl.io
Apache License 2.0
32.27k stars 5.04k forks source link

request for notifications UI #4101

Open rj33 opened 8 years ago

rj33 commented 8 years ago

The snackbar/toast seem explicitly designed as a 'only one on screen at a time'. It would be nice if we could get library support for this part of the MD spec: https://www.google.com/design/spec/patterns/notifications.html

Which requires multiple toast/snackbar like panels to be present on screen at once.

futurliberta commented 8 years ago

You may take a look at what I did : http://codepen.io/jfily/pen/Bjvxyp

Garbee commented 8 years ago

The notification spec is unrelated to toasts and snackbars. The Snackbar spec states specifically to only show one at a time.

The notification MD spec is talking about OS level notifications. This is not something web sites are capable of building on their own. However, the web itself offers a notification API that fulfills this need (however with limited browser support.) It also is not something we are capable of re-styling or manipulating.

We could look into doing a site-level notification UI. Guidance from the MD team would be required for positioning of notifications since the spec currently provides no guidance on that for web apps.

rj33 commented 8 years ago

Thanks @jfily , that looks like a good starting point.

@garbee, yes. I also hadn't noticed it was labeled 'Android only' (not sure how, it was fairly prominent at the top of the page!). It is interesting that this form of notification is seen as android only given I think that type of multiple stacked notification probably works best on desktop, and can be a little cumbersome on mobile (which I guess is why we have the 'one per page' toast and snackbar components). It would be great if this could be considered part of the library at some point, on desktop, I think the 'allow multiple notifications' use case is probably quite common.

Garbee commented 8 years ago

Well, notifications are OS-level so cross-apps. So they want to provide consistency there for those developers looking into how to build their stuff to look good with other peoples stuff. App-level notifications, that is what Snackbar is for. Nice simple alerts that something has happened.

rj33 commented 8 years ago

Not wanting to nitpick, and perhaps I'm mis-interpreting , but I don't really read that section of the MD spec as OS-level only stuff. In fact they open with 'Notifications inform your app’s users about relevant and timely events in your app.' 'timely events in your app' makes it sound like that section is also addressing app-level notifications, but of a different type (or a different way) than that addressed by Snackbar/Toast. In fact the Snackbar component's section of the spec suggests Toast's themselves are primarily for system level messaging (which I assume is equivalent to OS-level?) with "Android also provides a toast, primarily used for system messaging."

futurliberta commented 7 years ago

Updated for Android N notifications

=> https://codepen.io/jfily/pen/eBEYmZ

No real specs but followed this : https://material.google.com/patterns/notifications.html#notifications-anatomy-of-a-notification

thebiltheory commented 6 years ago

@jfily Can't find any specs for MD desktop app notifications either. Your CP looks good tho !

ZanderBrown commented 6 years ago

Just use the Notifications API