notifications
notifications copied to clipboard
Add support for inline replies
This change adds support for notifications that accept text input within their UI, aka 'inline replies'.
Explainer: https://github.com/anitawoodruff/inline-notification-replies
Requesting TAG review shortly, will link to it below.
TAG review now requested at: https://github.com/w3ctag/design-reviews/issues/284
Go for it, any time is fine - from my perspective the changes are done aside from your comments :)
I addressed some of the formatting issues. There's still at least one outstanding issue though. Review from @beverloo would also be good.
What we need beyond this:
- Implementer interest beyond Chrome.
- Bugs filed against browsers as per https://github.com/whatwg/meta/blob/master/MAINTAINERS.md#handling-pull-requests
Filed the following implementation bugs against the other browsers:
-
Edge: https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/34442866-implement-inline-replies-for-web-notifications
-
Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1466499
-
Safari: https://bugs.webkit.org/show_bug.cgi?id=186265
(Chrome bug is at https://crbug.com/599859 )
@aliams, @hober, @annevk - Please can you comment on whether your respective browsers would be interested in implementing this feature.
Since the native notification centers on Mac, Android, iOS and Windows now all provide this functionality, we think it would make a great addition to the spec.
See the explainer for more details.
@anitawoodruff the main input I got at https://github.com/mozilla/standards-positions/issues/91#issuecomment-394271102 from @martinthomson was that it was unclear how to deploy this in a backwards compatible fashion. That is, how can a website use this feature in a way that doesn't make things weird in browsers that don't support it?
Open a window with a view that allows them to send a response, as that's clearly the user's intention by activating that button? The website would want to do something similar if the user doesn't enter an inline reply, i.e. just clicks on the button.
It was more about feature detection I think, but it seems that should be doable with "reply" in NotificationEvent.prototype or some such.
FWIW, @jakearchibald offered to help with rebasing this. I think the main thing lacking here is explicit interest from one more browser. And perhaps some non-IDL tests.
Maybe it would be useful to expand the API to allow the reply to be prefilled with some value?
Use-case:
- User
Asends a message to userB:@b how are you? - User
Bwants to reply to the message.
It is common in some platforms (such as Mastodon and Twitter) for B's reply to start with @a, and when replying to such a message the input field is prepopulated with @a.
This is not possible to achieve with the current API.
Just as a note from us all the way over here in user-land, I was just wondering about this particular feature today (whether it was possible with the Notification API):
https://twitter.com/karlhorky/status/1167778767542128643
Use Case: It came up as part of a discussion about whether a Slack PWA could hold its own against an Electron app:
https://twitter.com/karlhorky/status/1167777816466866177
Thanks for listening!
Ah, I guess this feature is already (partially) implemented in Chrome:
https://twitter.com/beverloo/status/1167824727009832960
However, they are disabled on macOS due to deficiencies in the macOS notification system (extra buttons for "Site Settings" are not allowed):
https://twitter.com/beverloo/status/1167847717361639425
This is a valid user concern, so I have proposed a few ways of dealing with that, including an extra permissions prompt (1) and requiring an installed PWA (2 and 3).
- https://twitter.com/karlhorky/status/1167843843238219777
- https://twitter.com/karlhorky/status/1167848030718046208
- https://bugs.chromium.org/p/chromium/issues/detail?id=999838
cc @beverloo
So this been live in Chrome for Windows/ChromeOS/Android for over 6 years, but the update for the spec has been forgot on this PR?
Can we merge this so it will trigger the necessary updates in affects specs like https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#protocol that still doesn't have support for the type attribute in the NotificationAction class ?