-
Notifications
You must be signed in to change notification settings - Fork 49
Description
π€ This is an automated contribution from Repo Assist.
Fixes #71 β the Sound setting (Default / None / Subtle) was persisted and displayed correctly but never applied when firing toast notifications. Every toast always played the system default sound regardless of user preference.
Root cause
SettingsManager.NotificationSound was read in SettingsWindow but no toast call site in App.xaml.cs consulted it. All 14 ToastContentBuilder chains called .Show() directly.
Fix
Adds a ShowToast(ToastContentBuilder builder) helper that:
- None β
builder.AddAudio(silent: true)(silent toast) - Subtle β
builder.AddAudio(new Uri("ms-winsoundevent:Notification.IM")) - Default β no-op, existing behaviour preserved
All 14 toast call sites are updated to use ShowToast(...) instead of .Show() directly.
Trade-offs
- Minimal surface area: one helper, 14 call sites updated mechanically.
- No new dependencies.
- The
ShowToastmethod is private and instance-level, so it has access to_settingswithout any parameter threading.
Test Status
WinUI build requires Windows (XAML compiler is Windows-only) β infrastructure limitation, not a code error. The OpenClaw.Shared project compiled successfully on Linux. All tests pass:
Passed! - Failed: 0, Passed: 93, Skipped: 0, Total: 93 (OpenClaw.Tray.Tests)
Passed! - Failed: 0, Passed: 503, Skipped: 18, Total: 521 (OpenClaw.Shared.Tests)
CI runs on windows-latest and will perform a full build verification.
Closes #71
Generated by Repo Assist Β· β·
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch repo-assist/fix-issue-71-notification-sound-399f71b1abb9e069-33213a77271fa5eb-cf09787bf056700d.
To fix the permissions issue, go to Settings β Actions β General and enable Allow GitHub Actions to create and approve pull requests.
Show patch preview (237 of 237 lines)
From 9d8589b16c8faffcf5d64f841ad383832b101b39 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Thu, 19 Mar 2026 12:52:13 +0000
Subject: [PATCH] fix: apply NotificationSound setting to all toast
notifications
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The NotificationSound setting (Default / None / Subtle) was saved and
restored correctly by SettingsWindow but never applied when building
toast notifications. Every toast always fired with the system default
sound regardless of user preference.
Adds a ShowToast(ToastContentBuilder) helper that applies the audio
preference before calling .Show(), and updates all 14 toast call sites
in App.xaml.cs to use it:
- 'None' β silent toast (AddAudio(silent: true))
- 'Subtle' β ms-winsoundevent:Notification.IM
- 'Default' β system default (no-op, existing behaviour)
Closes #71
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
src/OpenClaw.Tray.WinUI/App.xaml.cs | 83 +++++++++++++++--------------
1 file changed, 43 insertions(+), 40 deletions(-)
diff --git a/src/OpenClaw.Tray.WinUI/App.xaml.cs b/src/OpenClaw.Tray.WinUI/App.xaml.cs
index de0780f..55910b3 100644
--- a/src/OpenClaw.Tray.WinUI/App.xaml.cs
+++ b/src/OpenClaw.Tray.WinUI/App.xaml.cs
@@ -568,10 +568,9 @@ public partial class App : Application
global::Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dataPackage);
// Show toast confirming copy
- new ToastContentBuilder()
+ ShowToast(new ToastContentBuilder()
.AddText(LocalizationHelper.GetString("Toast_DeviceIdCopied"))
- .AddText(string.Format(LocalizationHelper.GetString("Toast_DeviceIdCopiedDetail"), _nodeService.ShortDeviceId))
- .Show();
+ .AddText(string.Format(LocalizationHelper.GetString("Toast_DeviceIdCopiedDetail"), _nodeService.ShortDeviceId))
... (truncated)