Skip to content

fix: NotificationSound persisted by display text instead of stable key #41

Closed

Description

@shanselman

Problem

NotificationSound is persisted to settings.json using ComboBox display text (e.g. "Default", "None", "Subtle"). If display text is ever localized, renamed, or changed, settings silently break — falling back to index 0.

Both the WinUI and WinForms tray apps share the same settings.json file, so they must agree on stable persistence keys.

Found during review of #30 (Chinese localization PR).

Fix

Use the Tag attribute pattern (already used correctly in ActivityStreamWindow.xaml) to decouple display text from persisted values:

WinUI SettingsWindow.xaml:

<ComboBoxItem Content="Default" Tag="Default"/>
<ComboBoxItem Content="None" Tag="None"/>
<ComboBoxItem Content="Subtle" Tag="Subtle"/>

SettingsWindow.xaml.cs: Load/save by Tag instead of Content.

Backward compatible — current persisted values already match the Tag keys.

Scope

  • SettingsWindow.xaml + SettingsWindow.xaml.cs (WinUI)
  • SettingsDialog.cs (WinForms) — document stable keys
  • Add settings round-trip tests

Prerequisite for localization work in #40.

Activity

  1. added
    bug
    on Mar 17, 2026
  2. added a commit that references this issue on Mar 17, 2026
    df045b3
  3. added a commit that references this issue on Mar 17, 2026
    b6b6239
  4. locked as resolved and limited conversation to collaborators on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions