feat(webui): add completion notification sound preference

When a turn finishes while the user is watching the page there is no
audible cue; the existing browser notifications only cover the
background case. Add a `notificationSound` local preference (off by
default, next to `browserNotifications`) and play a short bundled
chime from the `turn_end` handler only while the page is visible, so
background tabs stay silent.

- webui/src/lib/notification-sound.ts: visibility- and preference-gated
  playback of the bundled /notification.wav, one reused Audio element
- Overview settings toggle with localized copy in all 10 locales
- Tests cover the default-off, visible, hidden, reuse and
  playback-rejection paths
This commit is contained in:
Li Fengmin authored and chengyongru committed 2026-09-24 17:34:33 +08:00
1 parent 3ecc3d3556
commit 7c2bf8949c
17 files changed
+156

No files matched your search

+2
View File
@@ -516,6 +516,7 @@
"codeWrap": "Code wrapping",
"brandLogos": "Brand logos",
"browserNotifications": "Task notifications",
"notificationSound": "Completion sound",
"maxResults": "Max results",
"timeout": "Timeout",
"jinaReader": "Jina reader",
@@ -561,6 +562,7 @@
"codeWrap": "Keep long code lines readable on smaller screens.",
"brandLogos": "Show third-party provider and CLI logos in Settings.",
"browserNotifications": "Notify only when this page is in the background. Off by default.",
"notificationSound": "Play a short chime when a turn finishes while this page is in the foreground. Off by default.",
"maxResults": "Maximum number of results returned by each web search.",
"timeout": "How long to wait for a search request to finish.",
"jinaReader": "Use Jina Reader to read web pages when available.",