merge: rc.14 parcel nousage

This commit is contained in:
Alby96 committed 2026-11-06 17:14:01 +01:00
commit 000eb882b9
88 files changed
+36 -180

No files matched your search

@@ -305,6 +305,20 @@ public sealed class SettingsLogicTests
Assert.Equal((640, 30, 3.5, true), (copy.ThumbnailLongEdge, copy.ScanIntervalMinutes, copy.NightBrightnessPercent, copy.DeepAnalysisAfterScan));
}
[Test]
public void AnOldSettingsFileWithUsageCountsStillLoads()
{
// Chronos sends nothing about its use (owner review 4, R2): the setting is gone, and a file that still carries it loads
// with its other values and is saved without it.
Assert.Null(typeof(AppSettings).GetProperty("AnonymousUsageCounts"));
var path = Path.Combine(_context.CreateTempDirectory("settings"), "settings.json");
File.WriteAllText(path, """{ "Theme": "Light", "AnonymousUsageCounts": true, "OsNotifications": false }""");
var loaded = AppSettings.Load(path);
Assert.Equal((Chronos.Ui.Theming.AppTheme.Light, false), (loaded.Theme, loaded.OsNotifications));
loaded.Save(path);
Assert.False(File.ReadAllText(path).Contains("AnonymousUsageCounts", StringComparison.Ordinal), "saved without the removed member");
}
[Test]
public void BackgroundPriorityRaisesTheInterfaceOnlyInFront()
{
@@ -409,15 +409,16 @@ public sealed class ShellNotificationTests
});
[Test]
public Task GeneralSettingsHoldStartupAndNotificationsButNoConsent() => ScreenHost.RunAsync(async () =>
public Task GeneralSettingsHoldStartupAndNotificationsAndNoUsageCounts() => ScreenHost.RunAsync(async () =>
{
// Monetization (BRIEF §21) ships disabled: the default build offers no usage counts consent.
// Monetization (BRIEF §21) ships disabled.
Assert.False(ProductFeatures.AdsEnabled);
// Chronos sends nothing about its use (owner review 4, R2): the first run asks no consent.
await using var app = await ScreenSmokeTests.SampleApp.StartAsync(firstRun: true);
var shell = app.Shell;
await app.ExpectAsync<WelcomeView>("welcome");
Assert.False(app.FindAll<CheckBox>().Any(c => c.IsVisible && Equals(c.Content, Loc.L("Settings.General.UsageCounts"))), "no consent on the first-run dialog");
Assert.False(app.FindAll<CheckBox>().Any(c => c.IsVisible), "no consent on the first-run dialog");
shell.CompleteWelcome();
var settings = shell.Settings;
@@ -427,7 +428,7 @@ public sealed class ShellNotificationTests
settings.Page = SettingsPage.General;
await app.ExpectAsync<SettingsView>("settings-general");
var boxes = app.FindAll<CheckBox>().Where(c => c.IsVisible).ToList();
Assert.False(boxes.Any(c => Equals(c.Content, Loc.L("Settings.General.UsageCounts"))), "no consent in Settings");
Assert.Equal(2, boxes.Count);
var start = boxes.Single(c => Equals(c.Content, Loc.L("Settings.General.StartWithWindows")));
Assert.Equal(Loc.L("Tooltips.Settings.StartWithWindows"), start.ToolTip);
var notify = boxes.Single(c => Equals(c.Content, Loc.L("Settings.General.OsNotifications")));
@@ -444,11 +445,11 @@ public sealed class ShellNotificationTests
// Reset section also returned the language to the system's.
UiLanguage.Apply("en");
// The search finds General by its new rows, not by the hidden consent.
// The search finds General by its rows, not by the removed usage counts.
settings.SearchText = Loc.L("Settings.General.Startup");
Assert.Contains(settings.VisiblePages, p => p.Page == SettingsPage.General);
settings.SearchText = Loc.L("Settings.General.Usage");
Assert.False(settings.VisiblePages.Any(p => p.Page == SettingsPage.General), "the hidden consent does not match");
settings.SearchText = "Usage counts";
Assert.False(settings.VisiblePages.Any(p => p.Page == SettingsPage.General), "no usage counts row");
settings.SearchText = string.Empty;
});