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
@@ -288,6 +288,7 @@
"currentModel": "目前設定",
"brandLogos": "品牌圖示",
"browserNotifications": "任務通知",
"notificationSound": "完成提示音",
"cliAppsCatalog": "應用程式清單",
"cliAppsFilter": "篩選",
"engine": "引擎",
@@ -331,6 +332,7 @@
"selectedModelValue": "由選取的模型決定。",
"brandLogos": "在設定中顯示第三方供應商與 CLI 圖示。",
"browserNotifications": "僅在頁面位於背景時通知,預設關閉。",
"notificationSound": "回合結束且頁面處於前景時播放短促提示音,預設關閉。",
"cliAppsCatalog": "安裝供 nanobot 使用的命令列工具,不會安裝或修改對應的桌面應用程式。",
"cliAppsFilter": "依應用程式、類別或功能搜尋。",
"logs": "開啟原生引擎日誌資料夾。",