feat(app)!: move About into Settings as its last page

The owner asked to fold the About section into Settings to save room in the
side rail (owner review 2, R5). The rail now docks Settings alone at the
bottom; About is the last Settings page with this copy's identity: version,
build, runtime, system, licence link, third-party notice and, outside English,
the machine-translation notice with its review link.

Nothing is offered twice inside Settings: the update check, its notice and the
releases link live on Updates, the data folder and the diagnostics bundle on
Advanced, so About's duplicate buttons and its own diagnostics code are gone.
AboutViewModel stays as a plain helper owned by the shell (Chronos.App.About),
which keeps every Shell.About binding and the update check on start.

SectionKey.About, AboutView and the rail strings are removed (orphans pruned
from every culture, which also re-sorts two Setup tooltip keys); the capture,
the smoke tests, DESIGN, ARCHITECTURE, the desktop mockups and the docs that
pointed at About follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-26 22:48:27 +01:00
1 parent 5209579631
commit 8886e075b9
143 files changed
+187 -498

No files matched your search

+130
View File
@@ -0,0 +1,130 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows.Input;
using Chronos.App.Infrastructure;
using Chronos.App.Shell;
using Chronos.Core.Localization;
using Chronos.Ui.Controls;
using Chronos.Ui.Mvvm;
namespace Chronos.App.About;
/// <summary>
/// What Settings › About (BRIEF §12.9: version and build, licence link, third-party notice, translation notice) and
/// Settings › Updates (the releases page and the update notice of <see cref="UpdateFlow"/>, BRIEF §18) show. The shell
/// owns it, so the update check on start runs whatever screen is open; it is no section of the rail (owner review 2, R5).
/// </summary>
public sealed class AboutViewModel : LocalizedViewModel
{
private readonly UpdateFlow _update;
public AboutViewModel(ShellViewModel shell)
{
Shell = shell;
var environment = shell.Services.Environment;
_update = new UpdateFlow(new UpdateHost(UpdateCheck.RunningVersion(Version), environment.IsCapture, environment.IsPortable,
ct => Shell.Services.CheckForUpdateAsync(ct), (release, progress, ct) => Shell.Services.DownloadUpdateAsync(release, progress, ct),
ShellActions.OpenUrl, ShellActions.Reveal)
{ RunningIsPrerelease = UpdateCheck.IsPrerelease(Version) });
_update.Changed += RaiseUpdate;
ShowPackageCommand = new RelayCommand(() =>
{
if (_update.PackagePath is { } path) ShellActions.Reveal(path);
}, () => _update.PackagePath is not null);
CancelDownloadCommand = new RelayCommand(_update.CancelDownload, () => IsDownloading);
OpenReleasesCommand = new RelayCommand(() => ShellActions.OpenUrl(ProductLinks.Releases));
OpenLicenceCommand = new RelayCommand(() => ShellActions.OpenUrl(ProductLinks.Licence));
ReviewTranslationCommand = new RelayCommand(() => ShellActions.OpenUrl(ProductLinks.Issues));
}
public ShellViewModel Shell { get; }
public string Version => AppServices.VersionText;
/// <summary>File version and processor architecture.</summary>
public string Build =>
(typeof(App).Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>()?.Version ?? Version) + Loc.Separator + RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
public string Runtime => RuntimeInformation.FrameworkDescription;
public string OperatingSystem => RuntimeInformation.OSDescription;
/// <summary>Every language but English is machine-translated and open to review (BRIEF §16).</summary>
public bool IsTranslated => !Loc.Culture.TwoLetterISOLanguageName.Equals("en", StringComparison.OrdinalIgnoreCase);
public ICommand CheckCommand => _update.Check;
public ICommand DownloadCommand => _update.Download;
public ICommand ShowPackageCommand { get; }
public ICommand CancelDownloadCommand { get; }
public ICommand OpenReleasesCommand { get; }
public ICommand OpenLicenceCommand { get; }
public ICommand ReviewTranslationCommand { get; }
/// <summary>"Up to date", "Chronos 0.2.0 available", …; null before the first check.</summary>
public string? UpdateText => _update.State switch
{
UpdateState.Checking => Loc.L("About.Update.Checking"),
UpdateState.UpToDate => Loc.L("About.Update.Current"),
UpdateState.Available when _update.Release is { } r => Loc.L("About.Update.Available", UpdateCheck.Display(r.Version)),
UpdateState.Failed => Loc.L("About.Update.Failed"),
UpdateState.Downloading => Loc.L("About.Update.Downloading", _update.Downloaded),
UpdateState.Downloaded when _update.Release is { } r => Loc.L("About.Update.Ready", UpdateCheck.Display(r.Version)),
UpdateState.DownloadFailed => Loc.L("About.Update.DownloadFailed"),
UpdateState.NotVerified => Loc.L("About.Update.NotVerified"),
_ => null,
};
/// <summary>What screen readers announce: each new state, not each percent of a download.</summary>
public string? UpdateAnnouncement => _update.State == UpdateState.Downloading ? Loc.L("About.Update.InProgress") : UpdateText;
public StatusKind UpdateKind => _update.State switch
{
UpdateState.Checking or UpdateState.Downloading => StatusKind.Running,
UpdateState.UpToDate or UpdateState.Downloaded => StatusKind.Done,
UpdateState.Available => StatusKind.Warning,
_ => StatusKind.Error,
};
public bool HasUpdateText => UpdateText is not null;
/// <summary>Download is offered: a newer release exists and no verified package is waiting (a failed download can be retried).</summary>
public bool IsUpdateAvailable => _update.IsDownloadOffered;
/// <summary>The verified setup or portable zip is in the temporary folder.</summary>
public bool IsPackageReady => _update.State == UpdateState.Downloaded;
public bool IsDownloading => _update.State == UpdateState.Downloading;
/// <summary>What Download does here: fetch and verify the setup or the portable zip (with its size), or open the release page.</summary>
public string DownloadToolTip => _update.Package is { } package
? Loc.L(_update.IsPortable ? "Tooltips.About.DownloadPortable" : "Tooltips.About.Download", Formatting.Bytes(package.Size))
: Loc.L("Tooltips.About.DownloadPage");
public string ShowPackageToolTip => Loc.L(_update.IsPortable ? "Tooltips.About.ShowPortable" : "Tooltips.About.ShowSetup");
/// <summary>Starts the update check on start when allowed (opt-out, BRIEF §18); never in a capture run.</summary>
public void Attach() => _ = NotifyAsync();
/// <summary>Sets a result without the network (capture, tests).</summary>
internal void SetResult(ReleaseInfo? release, bool failed = false) => _update.SetResult(release, failed);
private async Task NotifyAsync()
{
if (await _update.CheckOnStartAsync(Shell.Services.Settings.CheckForUpdates) is not { } newer) return;
Shell.Notify(Loc.L("About.Update.Available", UpdateCheck.Display(newer.Version)), actionText: Loc.L("About.Update.Download"),
actionToolTip: DownloadToolTip, action: () => DownloadCommand.Execute(null));
}
private void RaiseUpdate()
{
OnPropertyChanged(nameof(UpdateText));
OnPropertyChanged(nameof(UpdateAnnouncement));
OnPropertyChanged(nameof(UpdateKind));
OnPropertyChanged(nameof(HasUpdateText));
OnPropertyChanged(nameof(IsUpdateAvailable));
OnPropertyChanged(nameof(IsPackageReady));
OnPropertyChanged(nameof(IsDownloading));
OnPropertyChanged(nameof(DownloadToolTip));
CommandManager.InvalidateRequerySuggested();
}
}