feat: screenshot baselines from the development PC, fixed capture values, ports strings in all languages
The owner chose to capture the baselines on the development PC (owner review 3, R2): 156 screens go to tests/visual/baselines and CI no longer pushes a ci-screenshots branch. While --capture freezes AppClock, free space, a server's latency and the last sync are fixed sample values; they moved the Server and Import screens past the diff tolerance at random. The 22 new or changed Admin strings are translated into the 36 other languages, and the request file records the owner's text and answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2585b5d45f
commit
7273eec2bb
276 files changed
+893
-121
No files matched your search
@@ -98,7 +98,7 @@ public static class ImportPlans
|
||||
plan.Items.Count(i => i.ExistingFrameId is not null),
|
||||
plan.Items.Count(i => i.Action == ImportAction.SkipImported),
|
||||
plan.Problems.Count,
|
||||
plan.AvailableBytes is { } free ? free - plan.CopyBytes : null,
|
||||
Infrastructure.AppClock.ShownFree(plan.AvailableBytes) is { } free ? free - plan.CopyBytes : null,
|
||||
Estimate(plan.CopyBytes, verify));
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,15 +3,31 @@ namespace Chronos.App.Infrastructure;
|
||||
/// <summary>
|
||||
/// Today's date for screens that lay themselves out around it (the Library timeline's years, the months of the
|
||||
/// Archive heatmap). <c>--capture</c> freezes it at the sample's moment, so the screenshots draw the same pixels on
|
||||
/// any day and the pixel diff against their baselines stays meaningful.
|
||||
/// any day and the pixel diff against their baselines stays meaningful. While frozen, what the screens measure on this
|
||||
/// machine (free space, a server's latency, when a comparison ran) is shown as fixed sample values too.
|
||||
/// </summary>
|
||||
public static class AppClock
|
||||
{
|
||||
private static DateTimeOffset? _frozen;
|
||||
|
||||
/// <summary>Free space every volume shows while frozen.</summary>
|
||||
public const long FrozenFreeBytes = 1_200_000_000_000;
|
||||
|
||||
/// <summary>The local date: the frozen moment's while frozen, the computer's otherwise.</summary>
|
||||
public static DateTime Today => (_frozen?.ToLocalTime().DateTime ?? DateTime.Now).Date;
|
||||
|
||||
/// <summary>True while frozen (screenshots).</summary>
|
||||
public static bool IsFrozen => _frozen is not null;
|
||||
|
||||
/// <summary>When something happened, as shown: the frozen moment while frozen.</summary>
|
||||
public static DateTimeOffset Shown(DateTimeOffset moment) => _frozen ?? moment;
|
||||
|
||||
/// <summary>A measured duration as shown: <paramref name="sample"/> while frozen.</summary>
|
||||
public static TimeSpan Shown(TimeSpan measured, TimeSpan sample) => _frozen is null ? measured : sample;
|
||||
|
||||
/// <summary>Measured free bytes as shown: <see cref="FrozenFreeBytes"/> while frozen (unknown stays unknown).</summary>
|
||||
public static long? ShownFree(long? measured) => _frozen is null || measured is null ? measured : FrozenFreeBytes;
|
||||
|
||||
/// <summary>Stops the clock at <paramref name="moment"/> for the rest of the process (screenshots only).</summary>
|
||||
public static void Freeze(DateTimeOffset moment) => _frozen = moment;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public static class ArchiveLocations
|
||||
var root = Path.GetPathRoot(Path.GetFullPath(path));
|
||||
if (string.IsNullOrEmpty(root)) return null;
|
||||
var drive = new DriveInfo(root);
|
||||
return drive.IsReady ? drive.AvailableFreeSpace : null;
|
||||
return AppClock.ShownFree(drive.IsReady ? drive.AvailableFreeSpace : null);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or NotSupportedException)
|
||||
{
|
||||
|
||||
@@ -107,7 +107,8 @@ public sealed class ServerViewModel : SectionViewModel
|
||||
{
|
||||
if (!IsConnected || Session.Flow.Info is not { } info) return null;
|
||||
var parts = new List<string> { info.Name, Loc.L("Server.Version", info.Version) };
|
||||
if (Session.Flow.Latency is { } latency) parts.Add(Loc.L("Server.Latency", Math.Max(1, (int)Math.Round(latency.TotalMilliseconds))));
|
||||
if (Session.Flow.Latency is { } measured && AppClock.Shown(measured, TimeSpan.FromMilliseconds(12)) is var latency)
|
||||
parts.Add(Loc.L("Server.Latency", Math.Max(1, (int)Math.Round(latency.TotalMilliseconds))));
|
||||
return string.Join(Loc.Separator, parts);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,8 @@ public sealed class SyncTableViewModel : ObservableObject, IDisposable
|
||||
|
||||
/// <summary>"Last sync 10:15 · manifest diff 0.4 s"; null before the first comparison.</summary>
|
||||
public string? LastSyncText => Host.Agent?.Snapshot is { } s
|
||||
? Loc.L("Server.Sync.Last", Formatting.TimeOfDay(s.RefreshedAt), s.Duration.TotalSeconds.ToString("0.0", Loc.Culture))
|
||||
? Loc.L("Server.Sync.Last", Formatting.TimeOfDay(AppClock.Shown(s.RefreshedAt)),
|
||||
AppClock.Shown(s.Duration, TimeSpan.FromSeconds(0.4)).TotalSeconds.ToString("0.0", Loc.Culture))
|
||||
: null;
|
||||
|
||||
/// <summary>"Server archive 9.4 TB · 412 sequences".</summary>
|
||||
|
||||
Reference in new issue
Block a user