Skip to content

Handle transient notifications (#541)#582

Open
grmat wants to merge 2 commits intoemersion:masterfrom
grmat:#541
Open

Handle transient notifications (#541)#582
grmat wants to merge 2 commits intoemersion:masterfrom
grmat:#541

Conversation

@grmat
Copy link
Copy Markdown

@grmat grmat commented Apr 21, 2025

Draft implementation for #541, implements handling of the "transient" hint according to the Desktop Notifications Specification.

The -e/--transient flag of notify-send (libnotify) allows a simple test:

notify-send -ea mailer -i email "from <test@example.org>" "Subject"

While users are still able to explicitly put notifications in the history when calling makoctl dismiss (without --no-history) or using the according binding (MAKO_BINDING_DISMISS instead of MAKO_BINDING_DISMISS_NO_HISTORY).


Second commit is some kind of a clean-up, as it doesn't make much sense, IMHO to maintain both, a transient member and a (no-)history parameter.

@emersion
Copy link
Copy Markdown
Owner

Hm, the way I've read the spec, the "transient" bit meant that the notification is not stored on disk (and restored), but history sounded unrelated.

@balsoft
Copy link
Copy Markdown

balsoft commented Apr 24, 2026

@emersion the spec is as follows:

transient: When set the server will treat the notification as transient and by-pass the server's persistence capability, if it should exist.

Where the persistence capability is defined as follows:

persistence: The server supports persistence of notifications. Notifications will be retained until they are acknowledged or removed by the user or recalled by the sender. The presence of this capability allows clients to depend on the server to ensure a notification is seen and eliminate the need for the client to display a reminding function (such as a status icon) of its own.

I don't think it has anything to do with storing it on disk.

The way this persistence is usually implemented is that there's a pop-up when the notification is first emitted, and then if it times out the notification is visible when the user accesses the "notification drawer", where they can be dismissed or actioned on. resident notifications are those which don't disappear even if the user does some action to them while they are in the pop-up state, and need to be dismissed explicitly from the drawer. transient notifications are those which appear once as a pop-up and don't show up in the drawer at all.

Since mako doesn't have a "notification drawer" per se, the closest analogue we can come up with is that the usual notification display is the "pop-up", and the notification history is the "drawer". It seems like this PR implements this behavior perfectly (at least for transient notifications).

From my experience this is also how the hint is usually used by applications: to signal notifications which are simply pop-ups and don't need to be recalled later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants