-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle action of type text #179
Comments
is there a application in Linux that sends these kind of notifications?
That is "snc"? |
Chrome does.
Sorry, meant that when using SwayNotificationCenter and sending a notification that contains an action with the "text" type it will render the notification button, but since there is no input, clicking on it will send the action back with a null value. Just tested it on my machine by subscribing to a website that sends those types of notifications. |
Which website? Could you run swaync with all messages enabled (
|
For testing you can use https://tests.peter.sh/notification-generator/ and select "Actions = One action (type text with placeholder)" to trigger it as you want with the "Display Notification" button. If you add a breakpoint to the sw.js file on your Chrome instance DevTools on line 23 and inspect the
Sure, here it is:
|
Out of curiosity, looks like Telegram desktop (native app) also sends those
|
Oh. Looks like the actions only show in Chromium and not Firefox. That's why it didn't work for me... There's no specific hints to indicate that it needs a input. Does it work in Gnome / KDE? My guess is that it's not implemented on Linux browsers due to it not being in the Freedesktop Notification spec |
Yeah, it's still in Firefox backlog per https://bugzilla.mozilla.org/show_bug.cgi?id=1225110
The hint is the action "type", but looks like that isn't being passed down as NotificationAction on the spec is still just a string and ID 😢 My guess is that Freedesktop Notification spec will only update when whatwg/notifications#132 is merged so let's see what happens... |
I've turned on notifications for that PR so I'll return to this when it gets updated :) |
How about native apps like nheko which definitely have inline reply support on KDE? There is a |
there are actions mentions in nheko's implementation but
while dunst does detect the actions. There is also an activation action that raise the correct room as well. |
Maybe adding SwayNotificationCenter/src/notiDaemon/notiDaemon.vala Lines 93 to 105 in c264d44
|
Do you know where the KDE notification daemon source code is located? Haven't been able to find it. Maybe they're doing something different? |
PROGRESS! Adding
|
Now what's missing is the documentation / spec for this 3rd party spec... Edit: Found some relevant links which might be good to have for future reference:
|
|
With the pr? The "inline-reply" action is removed from the output so that would be why. Firefox isn't working but chromium is. Do you get a text field on your notification? |
swaync 0.7.3 (git-1c80c60, branch 'makepkg')
Yes I get a text field with the debug website and on kde_connect fro phone apparently, but I can't type on it or click the reply button. The app `nheko` doesn't get it though.
…On Feb 22 2023, at 5:02 pm, Erik Reider ***@***.***> wrote:
> For some reason I can't replicate this. The action still doesn't seem to get caught. On firefox it doesn't catch anything, while on chrome it parses the placeholder message right but can't edit or reply. With nheko I can't see the action as well.
> category: (null)
> image_data: false
> expire_timeout: -1
> replaces_id: 0
> desktop_entry: chromium
> body: tests.peter.sh
>
> Notification content
> app_icon: file:///tmp/.org.chromium.Chromium.FpxP0S
> action_icons: false
> time: 1677054974
> hints:
> x-kde-reply-placeholder-text: 'Send message'
> urgency: uint32 1
> desktop-entry: 'chromium'
> image_path: data
> image-path: data
> applied_id: 1
> image_path: /tmp/.org.chromium.Chromium.OzEaKr
> app_name: Chromium
> summary: Notification title
> icon_data: false
> resident: false
> default_action: Name: Activate, Id: default
> actions:
> Name: Settings, Id: settings
> urgency: Low
With the pr? The "inline-reply" action is removed from the output so that would be why. Firefox isn't working but chromium is. Do you get a text field on your notification?
—
Reply to this email directly, view it on GitHub (#179 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ADEV7PXMO4HTM7SVHQZMY63WYXI2LANCNFSM6AAAAAAR74UNGU).
You are receiving this because you were mentioned.
|
This is a sway limitation that I'll need to work around... It'll work if you open the control center |
Ah sorry apparently it works... I successfully replied a message on my phone on kde connect. |
Awesome! Now the remaining todos... |
On Windows/Android/ChromeOS, when you send a notification that contains an action of type text, it will allow the user to type some text in a input box and send the action with the typed text as the parameter.
Android:
Windows:
When using snc there is a button for the action with type text, but clicking on it send the notification with a
null
value for the action.This is useful, for example, in chat apps so you can type a quick response without having to open a window of the app.
The text was updated successfully, but these errors were encountered: