Remembered lists are global; add Clear buttons in Preferences

Remembered peers were already machine-wide for the main app; remembered apps are
now global too (a shared address book across all profiles), so it doesn't confuse
the user with a different list per profile.

- RemSoundSettingsStore.Load/SaveRememberedApplications (global, NOT written into
  profile files) mirrors remembered peers. Removed the per-profile
  Profile.RememberedSendApplications. Ticking an app in any profile adds it to the
  global list (RememberCheckedApps); the per-profile SelectedSendApplications
  (the active/ticked subset) is unchanged.
- Preferences -> General now has two buttons at the end, under a 'Remembered
  lists (shared across all profiles)' header: 'Clear remembered peers list...'
  and 'Clear remembered applications list...', each with a Yes/No confirmation.
  Clearing peers refreshes the main window; clearing apps empties the global list.
- Self-test 'Remembered applications list is global + clearable' (round-trip,
  case-insensitive dedupe, clear); the dialog accessibility audit covers the two
  new buttons (names + mnemonics, no clash). Gate 37/37.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ednunp
2026-07-15 22:54:55 +01:00
co-authored by Claude Opus 4.8
parent 1e5030b08f
commit e95fc36926
5 changed files with 113 additions and 9 deletions
@@ -222,6 +222,24 @@ public sealed class RemSoundSettingsStore
Save(s);
}
/// <summary>GLOBAL remembered application names (lower-case process names) — the shared "apps I send"
/// list, machine-wide like <see cref="LoadRememberedPeers"/>, not per-profile.</summary>
public IReadOnlyList<string> LoadRememberedApplications() =>
Try(() => Load()?.RememberedApplications?
.Where(static value => !string.IsNullOrWhiteSpace(value))
.Distinct(StringComparer.OrdinalIgnoreCase).ToList())
?? [];
public void SaveRememberedApplications(IEnumerable<string> apps)
{
var s = Load() ?? new Settings();
s.RememberedApplications = apps
.Where(static value => !string.IsNullOrWhiteSpace(value))
.Select(static value => value.Trim().ToLowerInvariant())
.Distinct(StringComparer.OrdinalIgnoreCase).ToList();
Save(s);
}
// LoggingEnabled lives in AppConfig now — it's a machine-local debug knob, not a
// per-profile setting. LoadLoggingEnabled / SaveLoggingEnabled were retired here;
// callers go to AppConfig.LoggingEnabled directly.
@@ -639,6 +657,10 @@ public sealed class RemSoundSettingsStore
public int? MaxLatencyMsAsio { get; set; }
public bool? ContinuousAutoTuneAsioEnabled { get; set; }
public List<string>? RememberedPeers { get; set; }
// GLOBAL (machine-wide) remembered application names, like RememberedPeers — deliberately NOT
// per-profile and NOT copied into profile files (see ExportProfile/ImportProfile, which don't
// touch it), so one shared "apps I send" address book serves every profile. 2026-07-15.
public List<string>? RememberedApplications { get; set; }
public string? AsioDriverName { get; set; }
// AudioMode and BothModeWarningSuppressed both retired from this cache. Mode is
// derived from AsioDriverName via LoadAudioMode; the Both-mode warning popup is gone.