Skip to content

[Repo Assist] fix: apply NotificationSound setting to all toast notifications #92

@github-actions

Description

@github-actions

🤖 This is an automated contribution from Repo Assist.

Root Cause

The NotificationSound setting in tray settings was never applied to toast notifications. All toast calls in App.xaml.cs called new ToastContentBuilder()...Show() directly, bypassing any sound preference.

Fix

Introduces a ShowToast(ToastContentBuilder) helper in App.xaml.cs that checks _settings.Settings.NotificationSound before calling .Show(). When sound is disabled, the builder's AddAudio with Silent = true is applied before showing.

All 13 direct .Show() call sites in App.xaml.cs are routed through ShowToast(...) instead.

Test Status

Tests could not be run in the Linux CI environment (project targets Windows). The logic is straightforward: one helper method added, all call sites updated to use it.

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-ec8ced57a23fcfe3.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests.

Show patch preview (237 of 237 lines)
From 9dbfb49a86acff407ab5e88312409bc213ca5efe 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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions