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:
co-authored by
Claude Opus 4.8
parent
1e5030b08f
commit
e95fc36926
@@ -69,6 +69,7 @@ internal static class SelfTest
|
||||
RunStep(results, "Service network presence (reachable + shell teardown)", ServiceNetworkPresenceReachable);
|
||||
RunStep(results, "Service reachability-gated sending (drop dead peers, re-arm recovered)", ServiceReachabilityGating);
|
||||
RunStep(results, "Send-app capture change-detection (catch an app the instant it opens)", SendAppCaptureChangeDetection);
|
||||
RunStep(results, "Remembered applications list is global + clearable", RememberedApplicationsGlobal);
|
||||
RunStep(results, "Service registration args", ServiceRegistrationArgs);
|
||||
RunStep(results, "Recording engine (all formats + source gate + mono)", RecordingEngine);
|
||||
RunStep(results, "Recording split tracks (per-peer + own)", RecordingSplitTracks);
|
||||
@@ -1116,7 +1117,7 @@ internal static class SelfTest
|
||||
("Recording settings", () => new RecordingSettingsDialog(new RecordingSettings())),
|
||||
("Preferences", () => new PreferencesDialog(
|
||||
new RemSoundSettingsStore("RemSound"), null,
|
||||
() => false, _ => { }, () => { }, () => 0, () => { }, () => { }, () => { }, _ => { },
|
||||
() => false, _ => { }, () => { }, () => 0, () => { }, () => { }, () => { }, () => { }, () => { }, _ => { },
|
||||
() => (default(RouterMappingStatus), (IPEndPoint?)null, ""),
|
||||
_ => { }, _ => { })),
|
||||
("Service profile", () => new ServiceProfileDialog(RemSound.Core.Profile.NewBlank(), false)),
|
||||
@@ -1551,6 +1552,27 @@ internal static class SelfTest
|
||||
return "signature stable when unchanged; changes when a ticked app opens/closes (drives instant capture)";
|
||||
}
|
||||
|
||||
/// <summary>Remembered applications are a GLOBAL, machine-wide list (like remembered peers), not
|
||||
/// per-profile — a shared "apps I send" address book — and can be cleared (the Preferences button).
|
||||
/// Verifies the store round-trips, dedupes case-insensitively to lower-case, and clears.</summary>
|
||||
private static string? RememberedApplicationsGlobal()
|
||||
{
|
||||
var store = new RemSoundSettingsStore("RemSound");
|
||||
var original = store.LoadRememberedApplications().ToList();
|
||||
try
|
||||
{
|
||||
store.SaveRememberedApplications(new[] { "VLC", "Firefox", "vlc" });
|
||||
var loaded = store.LoadRememberedApplications();
|
||||
Check(loaded.Count == 2, $"remembered apps must dedupe case-insensitively (got {loaded.Count})");
|
||||
Check(loaded.All(a => a == a.ToLowerInvariant()), "remembered app names must be stored lower-case");
|
||||
|
||||
store.SaveRememberedApplications(Array.Empty<string>());
|
||||
Check(store.LoadRememberedApplications().Count == 0, "clearing must empty the remembered applications list");
|
||||
return "global remembered applications: round-trip, case-insensitive dedupe, and clear";
|
||||
}
|
||||
finally { store.SaveRememberedApplications(original); }
|
||||
}
|
||||
|
||||
private static int FreeUdpPort()
|
||||
{
|
||||
using var s = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork,
|
||||
|
||||
Reference in New Issue
Block a user