fix(app): offer the usage counts consent only in builds with TitanoAdsEnabled

RF-3: the anonymous usage counts checkbox (Welcome and Settings › General) promised a
daily ping that does not exist; BRIEF §21 puts that consent inside monetization, which
ships disabled until the human flips TitanoAdsEnabled=true. Directory.Build.props now
defines the property (default false) and stamps it into every assembly as metadata;
ProductFeatures.AdsEnabled reads it, and both checkboxes and the Settings search
keyword follow it. The unused Shell.Welcome.Consent sentence is removed from every
culture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 09:30:42 +00:00
1 parent e4bbf11da9
commit ec297914db
45 files changed
+42 -42

No files matched your search

@@ -56,7 +56,10 @@ public sealed class AppSettings
public string? Language { get; set; }
public AppTheme Theme { get; set; } = AppTheme.Dark;
public bool RailCollapsed { get; set; }
/// <summary>The first-run consent of BRIEF §21; offered only by builds with <see cref="ProductFeatures.AdsEnabled"/>.</summary>
public bool AnonymousUsageCounts { get; set; }
public WindowPlacement? Window { get; set; }
/// <summary>The first-run choice (local archive, adopted folder or server) was made.</summary>
@@ -0,0 +1,17 @@
using System.Reflection;
namespace Titano.App.Infrastructure;
/// <summary>Features a build switches on through MSBuild properties (Directory.Build.props), read from the assembly metadata.</summary>
public static class ProductFeatures
{
/// <summary>
/// Monetization (BRIEF §21: ads, the anonymous usage counts consent, the licence) ships disabled until a build sets
/// <c>TitanoAdsEnabled=true</c>; until then nothing of it shows.
/// </summary>
public static bool AdsEnabled { get; } = Flag("TitanoAdsEnabled");
private static bool Flag(string key) =>
typeof(ProductFeatures).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().FirstOrDefault(a => a.Key == key)?.Value is { } value
&& bool.TryParse(value, out var on) && on;
}
+3 -1
View File
@@ -134,7 +134,9 @@
<RadioButton Content="{l:Loc Settings.General.Theme.System}" IsChecked="{Binding IsSystemTheme}" ToolTip="{l:Loc Tooltips.Settings.ThemeSystem}" />
</WrapPanel>
</HeaderedContentControl>
<HeaderedContentControl Style="{StaticResource Setting.Row}" Header="{l:Loc Settings.General.Usage}">
<!-- Monetization consent (BRIEF §21): only in builds made with TitanoAdsEnabled=true. -->
<HeaderedContentControl Style="{StaticResource Setting.Row}" Header="{l:Loc Settings.General.Usage}"
Visibility="{Binding ShowsUsageCounts, Converter={StaticResource BoolToVisibility}}">
<CheckBox Content="{l:Loc Settings.General.UsageCounts}" IsChecked="{Binding UsageCounts}" ToolTip="{l:Loc Tooltips.Settings.UsageCounts}" Margin="0,4,0,0" />
</HeaderedContentControl>
</StackPanel>
+4 -1
View File
@@ -43,7 +43,7 @@ public sealed class SettingsViewModel : SectionViewModel
_s = shell.Services.Settings;
AllPages =
[
new(SettingsPage.General, ["Settings.General.Language", "Settings.General.Theme", "Settings.General.Usage"]),
new(SettingsPage.General, ["Settings.General.Language", "Settings.General.Theme", .. ProductFeatures.AdsEnabled ? (string[])["Settings.General.Usage"] : []]),
new(SettingsPage.Archive, ["Settings.Archive.Root", "Settings.Archive.Folders", "Settings.Archive.Files", "Settings.Archive.Proxies"]),
new(SettingsPage.Rendering, ["Settings.Rendering.Quality", "Settings.Rendering.Memory", "Settings.Rendering.Parallelism", "Settings.Rendering.Hardware", "Settings.Rendering.Encoders"]),
new(SettingsPage.Storage, ["Settings.Storage.Folder", "Settings.Storage.Thumbnails", "Settings.Storage.Limit"]),
@@ -247,6 +247,9 @@ public sealed class SettingsViewModel : SectionViewModel
}
}
/// <summary>The usage counts consent belongs to monetization (BRIEF §21): only builds with it enabled offer it.</summary>
public bool ShowsUsageCounts => ProductFeatures.AdsEnabled;
public bool UsageCounts
{
get => _s.AnonymousUsageCounts;
+4 -2
View File
@@ -106,14 +106,16 @@
</RadioButton>
</StackPanel>
<!-- Consent, then Continue (visual and Tab order); the consent has the same label as in Settings. -->
<!-- Consent, then Continue (visual and Tab order); the consent has the same label as in Settings and, like all of
monetization (BRIEF §21), shows only in builds made with TitanoAdsEnabled=true. -->
<Grid Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<CheckBox Content="{l:Loc Settings.General.UsageCounts}" IsChecked="{Binding UsageCounts}" ToolTip="{l:Loc Tooltips.Settings.UsageCounts}" VerticalAlignment="Center"
HorizontalAlignment="Left" Foreground="{DynamicResource Brush.TextMuted}" />
HorizontalAlignment="Left" Foreground="{DynamicResource Brush.TextMuted}"
Visibility="{Binding ShowsUsageCounts, Converter={StaticResource BoolToVisibility}}" />
<Button Grid.Column="1" Style="{StaticResource Button.Primary}" Height="36" Padding="22,0" Margin="12,0,0,0" Content="{l:Loc Shell.Welcome.Continue}"
Command="{Binding ContinueCommand}" ToolTip="{l:Loc Tooltips.Welcome.Continue}" IsDefault="True" />
</Grid>
@@ -139,6 +139,9 @@ public sealed class WelcomeViewModel : LocalizedViewModel
}
}
/// <summary>The usage counts consent belongs to monetization (BRIEF §21): only builds with it enabled offer it.</summary>
public bool ShowsUsageCounts => ProductFeatures.AdsEnabled;
public bool UsageCounts
{
get => _shell.Services.Settings.AnonymousUsageCounts;