Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add small icon to Notification and NotificationOptions #65

Closed
mvano opened this issue Mar 10, 2016 · 8 comments
Closed

Add small icon to Notification and NotificationOptions #65

mvano opened this issue Mar 10, 2016 · 8 comments

Comments

@mvano
Copy link
Contributor

mvano commented Mar 10, 2016

I'd like to split off the small icon discussion from issue #28 where it was first suggested for this specification, but it was not the main topic of that issue.

If it is provided a small icon may be used, if supported by the platform, to represent the notification when there is not enough space to display the notification itself. It may also be displayed inside the notification.

A site might use the same small icon for each notification, in that case it is simply a site identifier. Alternatively, different icons may be used by a site to distinguish types of notifications, like text messages and picture messages. Or, it could be used to express that there is only one piece of information vs multiple.

This concept exists on multiple platforms:

  • For Android notifications it is actually a required part of a notification, so that the notification can be represented in the status bar. There, user agents must fall back to a default icon when no small icon is provided by the site.
  • It is used in the Windows lock screen on both desktop and mobile.
  • There may be more? Please let me know!

In various contexts this icon may be referred to as "small icon", "app icon", or "notification badge". I suggest calling it "small icon" in general, and "smallIcon" in IDL:

dictionary NotificationOptions {
  USVString smallIcon;
};
interface Notification {
  readonly attribute USVString smallIcon;
};

I think this also raises the priority of committing to a solution for multiple image definitions as discussed in issue #28.

@annevk
Copy link
Member

annevk commented Mar 10, 2016

We need a better name since "llI" is extremely tough to read well.

@beverloo
Copy link
Member

I like badge.

@mvano
Copy link
Contributor Author

mvano commented Mar 10, 2016

It does have more meaning to it, and lacks camelCasing, ftw.

@mvano
Copy link
Contributor Author

mvano commented Mar 16, 2016

Alright, so the updated API would look like this:

dictionary NotificationOptions {
  USVString badge;
};

interface Notification {
  readonly attribute USVString badge;
};

@marco-c I'm looking for a bit more of Mozilla's perspective on this. Does this proposal sound ok?

mvano added a commit to mvano/notifications that referenced this issue Mar 16, 2016
@beverloo
Copy link
Member

Focusing on Android a bit, it looks like Firefox is always using R.drawable.ic_status_logo, which is the Firefox logo.

@mfinkle, perhaps you could comment on whether allowing the developer to specify their own icon instead is something you'd support? This is possible in Android M and beyond.

mvano added a commit to mvano/notifications that referenced this issue Mar 17, 2016
mvano added a commit to mvano/notifications that referenced this issue Mar 18, 2016
@mvano
Copy link
Contributor Author

mvano commented Mar 21, 2016

@annevk do you still want to block merging PR #67 on additional Mozilla feedback?

@marco-c
Copy link

marco-c commented Mar 21, 2016

@marco-c I'm looking for a bit more of Mozilla's perspective on this. Does this proposal sound ok?

It makes sense to me, I like the badge name instead of smallIcon, which is less self-explanatory.

@mvano
Copy link
Contributor Author

mvano commented Mar 21, 2016

Thanks Marco!

@annevk annevk closed this as completed in 6ff593f Mar 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants