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:
2026-10-24 01:48:04 +08:00
parent d4485aff7a
commit b7044bbba7
2 changed files with 19 additions and 1 deletions
+6 -1
View File
@@ -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,