aarongustafson / pwa-widgets

Playing with some ideas around widget definitions for PWAs
24 stars 0 forks source link

Initial Thoughts #3

Open Snugug opened 2 years ago

Snugug commented 2 years ago

Thanks for sharing this w/me @aarongustafson! Here are my initial thoughts! I think the real tl;dr takeaway of these is that I think there should be a separation between defining widgets and configuring widgets, and given that separation.

Basic definition thoughts

Overall thoughts

aarongustafson commented 2 years ago

Thanks for this @Snugug!

I'm having a little trouble understanding exactly what this is for based on the descriptions here. Would this allow an installed PWA to offer like and Android or iOS homescreen widget? A Mac sidebar widget? A Windows gadget? The Adaptive Card system mentioned at the end seems like a specific usecase, but one I'm not super familiar with (and I'd imagine others may not be). More concrete examples up-front, maybe with low-res wireframes, would help contextualize this a bit more IMO.

Fair point. I had some explainer text over on this thread in WICG but have not brought it back over to this yet. I’ll update accordingly.

update feels like maybe it should be something like keywords for frequency instead of seconds? I'm a bit torn here, but saying I want this to update every 900 seconds and then having the definition of update be "thanks for your request, we'll get to it when we see fit" feels worse to me than more vague keywords.

That’s totally fair. Are you thinking something that is somewhat time-based like "hourly" or totally vague like "often" and "very often"? I also wonder if there should be a "user configurable" option with an initial preference.

While both "widgets", I actually think that host-provided widgets and user-defined widgets should be entirely separate entities. A host-provided widget, to me, is conceptually a host-provided component, like in a style guide, that has properties and needs specific to that component.

I agree to some degree, but also think it becomes super redundant to create multiple bespoke widget definitions for each independent platform. My hope is to create an upgrade path from templated widget to rich widget (should the developer so desire) but also platform enable customization through the inherent extensibility of the Manifest. That way you have a widget that progressively enhances into whatever container.

FWIW, I have an analogous idea of providing a feeds or data array in the Manifest to enable a web app to become a provider of that data within the host OS. Examples include calendars, contacts, weather, etc. I’ll likely noodle on that separately.

Why use tag instead of id given that tag is defined as client.id? tag isn't clear to me on first glance as the ID for the widget.

Totally fair point. I was planning on id initially, but then was thinking about it in relation to Notifications where tag is the key for some reason. I prefer id to be honest as I find the Notification tag confusing too.

Is it widget (as in sample) or template (as in Templated Widgets) to define what widget template to use?

That was my typo. I originally had it as widget and then changed it to template in the sample JSON file. I just missed that instance.

aarongustafson commented 2 years ago

The "feeds" concept is in the sample manifest file (lines 92-103).

aarongustafson commented 2 years ago

@Snugug I just made a ton of additions to the proposal to (hopefully) clarify things a bit more. Would love your thoughts.

Snugug commented 2 years ago

Thanks for the ping! Here are my thoughts on this new read.

Overall, I generally like this new direction. I think I'd really like to see an example of a rich widget (how do MPA transitions work, or does it need to be an SPA? How can I reuse the same rich widget definition multiple times?) and there are still a few things not connecting for me w/r/t data and actions, but the rest of the lifecycle stuff, and the intent, is all much clearer now.