notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Support inline replies

Open nsatragno opened this issue 9 years ago • 8 comments
trafficstars

Android N and Windows 10 support showing a text input in a notification. This feature would allow users to quickly write a reply without launching a new browser window. The benefits are more evident in low resource devices, where the cost of doing so is non trivial.

I suggest adding a boolean requestReply attribute to NotificationAction. If it's true, the user agent should provide a way to let the user activate the action with a text response. Naturally, this means a new attribute DOMString reply is added to Notification, conveying the reply text (which may be empty) or null if no reply was requested.

What do you think?

nsatragno avatar Mar 23 '16 12:03 nsatragno

FYI: OS X and iOS also have this so compatibility with their APIs should also be taken into account.

mnoorenberghe avatar Mar 23 '16 17:03 mnoorenberghe

Paging @hober and @dwsinger for input from Apple.

annevk avatar Mar 24 '16 10:03 annevk

I'm still looking into this, but one thing comes to mind. As actions are only supported on persistent notifications, the nullable text reply could be more narrowly scoped by setting it on the event for onnotificationclick instead of the notification object.

mvano avatar Mar 24 '16 14:03 mvano

I'm probably missing something obvious. If a notification has been created, there's already a browser window somewhere with the page open. Do you want a way for the page to say "call this js function with the string entered in the quick reply field"?

hober avatar Mar 24 '16 21:03 hober

@hober This is for persistent notifications, which are generated from service workers, and those may run in the background without any browser window being open.

mvano avatar Mar 24 '16 21:03 mvano

Ahh. That's not how notifications work on OS X, so I'm not sure what kind of input I can provide here then.

hober avatar Mar 25 '16 18:03 hober

PR in progress at https://github.com/whatwg/notifications/pull/132

anitawoodruff avatar May 31 '18 10:05 anitawoodruff

What is the status on this? I've looked at the PR which hasn't gotten updated since last year but surprisingly found this chromium issue to be already closed and marked as fixed. Can I already be using inline replies but they will only work in chrome? If yes, where can I read more about the API?

CodingDive avatar Jul 05 '20 18:07 CodingDive