mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 23:47:54 +08:00
core/cli: keep a prompt notification on screen
A prompt notification went out with the library defaults: the notification server's own expiry. A desktop server drops such a notification after a few seconds, so the announcement of a blocked turn had usually slid into the notification tray by the time the human looked back. It now goes out without expiry (`timeout=0`, the freedesktop value for "until dismissed"). Urgency is left alone: measured on KDE Plasma, `critical` keeps the notification up just the same, but paints it as urgent and asks the platform's Focus mode to let it through — decoration a prompt does not need. Dismissing is already the prompt's own job once it is answered, so nothing lingers.
This commit is contained in:
@@ -22,6 +22,11 @@ class Capability(Enum):
|
||||
THREAD = ...
|
||||
TIMEOUT = ...
|
||||
|
||||
class Urgency(Enum):
|
||||
Critical = ...
|
||||
Normal = ...
|
||||
Low = ...
|
||||
|
||||
class Button:
|
||||
def __init__(
|
||||
self,
|
||||
@@ -50,7 +55,7 @@ class DesktopNotifier:
|
||||
self,
|
||||
title: str,
|
||||
message: str,
|
||||
urgency: Any = ...,
|
||||
urgency: Urgency = ...,
|
||||
icon: Any = ...,
|
||||
buttons: Sequence[Button] = ...,
|
||||
reply_field: ReplyField | None = None,
|
||||
|
||||
Reference in New Issue
Block a user