Note that the if (message.handled) return; // already handled is only meant to be used if the code does something like e.g. displaying the message, widgets just always show an icon for new messages.
Some things I ran into:
Depending on GUI apps/widgets as "module" seems a bit of a mismatch (right now the sanitychecker complains it expects e.g. a messagewidgetfile to exist if an app provides a messagewidget module. We could work around that I guess, but it seems Wrong...)
What should we do about the settings? I guess split the menus out into e.g. "Message GUI", "Message Widget", "Message Behaviour" settings, but maybe we should still save them all in messages.settings.json? Even for custom apps, and just accept that it might pollute the file a bit?
The messages app (and notify icon) was an easy way to get to music though...
Yeah, probably best to leave it in, and custom music apps can catch the event before it leaves the default GUI.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I made a draft PR.
How it works now:
Note that the
if (message.handled) return; // already handled
is only meant to be used if the code does something like e.g. displaying the message, widgets just always show an icon for new messages.Some things I ran into:
messagewidget
file to exist if an app provides amessagewidget
module. We could work around that I guess, but it seems Wrong...)messages.settings.json
? Even for custom apps, and just accept that it might pollute the file a bit?Yeah, probably best to leave it in, and custom music apps can catch the event before it leaves the default GUI.