notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Multiple icon definitions

Open mvano opened this issue 9 years ago • 7 comments

I think the initial patch has the general shape of what I want to do for #28.

I did find there's two ways we could go with the attribute getters on a notification, for example for the icon. To me it's not clear whether we need a single icon getter that reflects the selected url, or both icon and icons which reflect the exact input from options.

Previously icon reflected a serialization of the options icon input that was parsed with baseURL, not the exact original input. That means, for example, that if parsing fails, the getter returns the empty string. The implications for NotificationIcon are not clear to me: would invalid input such as for type or sizes need to be dropped in the same way? That might surprise developers.


Preview | Diff

mvano avatar Jun 01 '16 14:06 mvano

I think it would be nicer if icon/badge simply reflected the selected URL.

annevk avatar Jun 07 '16 11:06 annevk

(And we'd do away with icons/badges.)

annevk avatar Jun 07 '16 11:06 annevk

Thanks Anne, I've cleaned it up a bit as discussed. Of note:

  • Just return the selected URL, do not expose getters for the multiple inputs.
  • As input and output are now more obviously asymmetrical (the missing getters on the output) I had to split NotificationAction into a NotificationActionOptions dictionary and a NotificationAction interface.
  • Afaict using an interface with readonly attributes for the output has the happy side effect of not needing to explicitly freeze the action, so I deleted that wrinkle.

mvano avatar Jun 08 '16 13:06 mvano

This looks pretty good I think. Who else should we ask for review?

annevk avatar Jun 08 '16 13:06 annevk

CC @beverloo @foolip @mounirlamouri @xxyzzzq in case there's something really crazy in here. If necessary we can probably align a detail or two as needed in a followup change.

mvano avatar Jun 08 '16 14:06 mvano

I'll aim to land this Friday (maybe ping me during the day just in case) unless someone has major concerns.

annevk avatar Jun 08 '16 14:06 annevk

There's definitely some similarity here with https://github.com/whatwg/mediasession/pull/129

Feedback on that PR appreciated, and is there a good place to put the common bits? Looks to me at first glace like the whole "list of images" concept that uses the [{src:'foo'}] syntax can and should be shared.

foolip avatar Jun 08 '16 14:06 foolip

Closing this due to lack of activity. If there's still interest let's discuss in #28.

annevk avatar Oct 11 '22 07:10 annevk