Skip to content

fix: persist NotificationSound by stable key, not display text - #42

Merged
shanselman merged 1 commit into
masterfrom
fix/settings-persistence-keys
Mar 17, 2026
Merged

shanselman merged 1 commit into
masterfrom
fix/settings-persistence-keys

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Decouple NotificationSound display text from persisted settings values, fixing a culture-sensitivity bug that would break settings if display strings are ever localized or changed.

Changes

  • SettingsWindow.xaml: Add Tag attributes to ComboBoxItems (stable persistence keys)
  • SettingsWindow.xaml.cs: Load/save by Tag instead of Content
  • SettingsDialog.cs (WinForms): Document that combo items are persistence keys

Follows the Tag attribute pattern already used correctly in ActivityStreamWindow.xaml.

Backward compatible — existing settings.json files are unaffected since current values already match the Tag keys. Unknown values fall back to "Default" (index 0).

Prerequisite for localization work in #40.
Fixes #41

Use Tag attribute on WinUI ComboBoxItems to decouple display text
from persisted settings values. Load and save by Tag instead of
Content in SettingsWindow.xaml.cs.

Add documentation comment in WinForms SettingsDialog.cs making
the persistence contract explicit.

Backward compatible — existing settings.json values already match
the Tag keys. Worst case for unknown values: falls back to Default.

Fixes #41
@shanselman
shanselman merged commit b6b6239 into master Mar 17, 2026
14 checks passed
@shanselman
shanselman deleted the fix/settings-persistence-keys branch March 17, 2026 02:21
@clawsweeper clawsweeper Bot mentioned this pull request Aug 28, 2026
7 of 16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: NotificationSound persisted by display text instead of stable key

1 participant