fix: Windows test of 1.1.0 — job log local time, Jobs Type column, stale screen tests (1.1.1) (#71)
CI / Build and test (push) Successful in 12m32s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 19s
Release / Build, test and publish (push) Successful in 17m13s
CI / PostgreSQL 16 integration (push) Successful in 9m1s
CI / PostgreSQL 17 integration (push) Successful in 9m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m49s
CI / Build and test (push) Successful in 12m32s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 19s
Release / Build, test and publish (push) Successful in 17m13s
CI / PostgreSQL 16 integration (push) Successful in 9m1s
CI / PostgreSQL 17 integration (push) Successful in 9m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m49s
The Windows hands-on test of v1.1.0 on the development PC (#70). - The App suite runs whole on Windows again. Five stale screen smoke tests are brought up to date. - The Reorganize capture gives the sample sidecars. - Forget fits in the Bulgarian certificate rows. - The job log shows local time. It stays UTC on disk, and lines are dated backwards from the job's end. - The Jobs and Server › Jobs Type column takes a 1* share (90–170 px). - Builds without a tag say 1.1.1. Closes #70 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #71.
This commit is contained in:
1 parent
20d64af4a4
commit
43719bb5c5
24 files changed
+240
-13
No files matched your search
@@ -20,6 +20,8 @@ public static class ArchiveScenes
|
||||
await archive.LoadAsync();
|
||||
var db = shell.Services.Database ?? throw new InvalidOperationException("The sample index is not open.");
|
||||
var locations = archive.SelectedArchive is { } selected ? await db.Sequences.ListLocationsAsync(selected.Id) : [];
|
||||
// What the Reorganize view wrote leaves with it, so the sample's sizes stay the same for the views after it.
|
||||
RemoveSampleFiles();
|
||||
switch (view)
|
||||
{
|
||||
case "overview":
|
||||
@@ -35,6 +37,9 @@ public static class ArchiveScenes
|
||||
break;
|
||||
case "reorganize":
|
||||
archive.ViewIndex = 0;
|
||||
// The dry run reads each sequence's sidecar, which the sample index has none of: without them every
|
||||
// sequence would show "cannot be read" and Apply would stay off.
|
||||
if (archive.SelectedArchive is { } reorganized) await WriteSampleSidecarsAsync(db, reorganized.RootPath, locations);
|
||||
await archive.OpenReorganizeDialogAsync();
|
||||
if (archive.Dialog is ReorganizeDialogViewModel reorganize)
|
||||
{
|
||||
@@ -60,4 +65,60 @@ public static class ArchiveScenes
|
||||
throw new ArgumentOutOfRangeException(nameof(view), view, "Unknown Archive view.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A minimal sidecar for each sample sequence that has none yet: its id, title and camera, and one small stand-in photo in
|
||||
/// its originals taken at its first capture, which the templates' dates and file names come from.
|
||||
/// </summary>
|
||||
private static async Task WriteSampleSidecarsAsync(Data.ChronosDatabase db, string root, IReadOnlyList<Data.Repositories.SequenceLocation> locations)
|
||||
{
|
||||
// A file is recorded before it is written, so one half written goes too.
|
||||
var paths = new Core.Archiving.ArchivePaths(root);
|
||||
byte[] photo = [0xFF, 0xD8, 0xFF, 0xD9];
|
||||
var sha256 = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(photo));
|
||||
foreach (var location in locations)
|
||||
{
|
||||
var folder = paths.Sequence(location.Folder);
|
||||
if (System.IO.File.Exists(folder.ManifestPath) || await db.Sequences.GetAsync(location.Id) is not { } sequence) continue;
|
||||
System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(folder.ManifestPath)!);
|
||||
const string file = Core.Archiving.ArchiveLayout.OriginalsFolder + "/IMG_0001.JPG";
|
||||
var frames = new List<Core.Archiving.SidecarFrame>();
|
||||
if (sequence.FirstCapture is { } first)
|
||||
{
|
||||
var onDisk = System.IO.Path.Combine(folder.Folder, file);
|
||||
System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(onDisk)!);
|
||||
SampleFiles.Add(onDisk);
|
||||
System.IO.File.WriteAllBytes(onDisk, photo);
|
||||
frames.Add(new Core.Archiving.SidecarFrame { Id = Guid.CreateVersion7(), File = file, Size = photo.Length, Sha256 = sha256, CapturedAt = first });
|
||||
}
|
||||
SampleFiles.Add(folder.ManifestPath);
|
||||
Core.Archiving.ManifestStore.WriteSequence(folder.ManifestPath, new Core.Archiving.SequenceManifest
|
||||
{
|
||||
Id = sequence.Id,
|
||||
Title = sequence.Title,
|
||||
Camera = new Core.Archiving.SidecarCamera { Make = sequence.CameraMake, Model = sequence.CameraModel },
|
||||
Frames = frames,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The files <see cref="WriteSampleSidecarsAsync"/> wrote that are still on disk.</summary>
|
||||
private static readonly List<string> SampleFiles = [];
|
||||
|
||||
/// <summary>Deletes the files the Reorganize view wrote for its dry run.</summary>
|
||||
private static void RemoveSampleFiles()
|
||||
{
|
||||
foreach (var path in SampleFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(path);
|
||||
}
|
||||
catch (Exception ex) when (ex is System.IO.IOException or UnauthorizedAccessException)
|
||||
{
|
||||
Core.Diagnostics.Log.Warning("capture", $"{path} of the sample stays", ex);
|
||||
}
|
||||
}
|
||||
SampleFiles.Clear();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public sealed class SampleData
|
||||
/// <summary>
|
||||
/// The sample's "now": every time it stores (jobs, transfers, renders, cards, the trash) is set from it, never from
|
||||
/// the computer's clock, and <c>--capture</c> freezes <see cref="AppClock"/> at it, so the screenshots are the same
|
||||
/// on any day (the running render's log reads 10:14 to 10:15).
|
||||
/// on any day (the running render's log stores 10:14 to 10:15 UTC and shows them in local time, as the rows).
|
||||
/// </summary>
|
||||
public static readonly DateTimeOffset Now = new(2026, 10, 2, 10, 18, 0, TimeSpan.Zero);
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// The job log stores each line's time of day in UTC (<c>"12:35:04 Copying…"</c>), the same on the server and the desktop.
|
||||
/// The Jobs table shows its times in local time, so the log's are shown in local time too (#70).
|
||||
/// </summary>
|
||||
public static class JobLogTimes
|
||||
{
|
||||
/// <summary>
|
||||
/// <paramref name="tail"/> with each leading <c>HH:mm:ss</c> turned from UTC into <paramref name="zone"/>'s time.
|
||||
/// The log keeps no dates, so they are worked out backwards from <paramref name="reference"/> (when the job finished, or
|
||||
/// now): each line is the latest instant at or before the line after it, so a run that goes past midnight UTC, or lasts
|
||||
/// days, dates its lines right and a daylight-saving change in between converts each side with its own offset. A pause
|
||||
/// of a day or more between two lines cannot be seen, and those lines keep the later day's date. Lines without a time
|
||||
/// stay as they are.
|
||||
/// </summary>
|
||||
public static string ToLocal(string tail, DateTimeOffset reference, TimeZoneInfo zone)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(tail);
|
||||
ArgumentNullException.ThrowIfNull(zone);
|
||||
if (tail.Length == 0) return tail;
|
||||
// A minute of slack: the reference may be read a little before the last line's clock (another machine's).
|
||||
var next = reference.UtcDateTime.AddMinutes(1);
|
||||
var lines = tail.Split('\n');
|
||||
for (var i = lines.Length - 1; i >= 0; i--)
|
||||
{
|
||||
var line = lines[i];
|
||||
if (line.Length < 9 || line[8] != ' ' ||
|
||||
!TimeSpan.TryParseExact(line.AsSpan(0, 8), @"hh\:mm\:ss", CultureInfo.InvariantCulture, out var time)) continue;
|
||||
var utc = DateTime.SpecifyKind(next.Date + time, DateTimeKind.Utc);
|
||||
if (utc > next) utc = utc.AddDays(-1);
|
||||
next = utc;
|
||||
var local = TimeZoneInfo.ConvertTimeFromUtc(utc, zone);
|
||||
lines[i] = local.ToString("HH:mm:ss", CultureInfo.InvariantCulture) + line[8..];
|
||||
}
|
||||
return string.Join('\n', lines);
|
||||
}
|
||||
}
|
||||
@@ -115,12 +115,12 @@ public sealed class JobRowViewModel : ObservableObject
|
||||
/// <summary>"Show log: Render · Harbour sunset": the expander names its row.</summary>
|
||||
public string ToggleName => Loc.L("Jobs.ActionFor", Loc.L(_isExpanded ? "Jobs.Log.Hide" : "Jobs.Log.Show"), AccessibleName);
|
||||
|
||||
/// <summary>The last lines of the job log, plus the live message while it runs.</summary>
|
||||
/// <summary>The last lines of the job log in local time, plus the live message while it runs.</summary>
|
||||
public string LogText
|
||||
{
|
||||
get
|
||||
{
|
||||
var tail = _logTail ?? _entry.Job.LogTail ?? string.Empty;
|
||||
var tail = JobLogTimes.ToLocal(_logTail ?? _entry.Job.LogTail ?? string.Empty, _entry.Job.Finished ?? AppClock.Shown(DateTimeOffset.UtcNow), TimeZoneInfo.Local);
|
||||
if (_entry.State == JobState.Running && _entry.Message is { Length: > 0 } message && !tail.EndsWith(message, StringComparison.Ordinal))
|
||||
tail = tail.Length == 0 ? message : tail + "\n" + message;
|
||||
return tail.Length == 0 ? Loc.L("Jobs.Log.Empty") : tail;
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
windows Kind, Where and State stop growing and Target takes the rest (Jobs.html). -->
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="28" />
|
||||
<ColumnDefinition Width="0.7*" MinWidth="90" MaxWidth="140" />
|
||||
<ColumnDefinition Width="*" MinWidth="90" MaxWidth="170" />
|
||||
<ColumnDefinition Width="1.6*" MinWidth="84" />
|
||||
<ColumnDefinition Width="*" MinWidth="104" MaxWidth="240" />
|
||||
<ColumnDefinition Width="90" />
|
||||
@@ -174,7 +174,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="28" />
|
||||
<ColumnDefinition Width="0.7*" MinWidth="90" MaxWidth="140" />
|
||||
<ColumnDefinition Width="*" MinWidth="90" MaxWidth="170" />
|
||||
<ColumnDefinition Width="1.6*" MinWidth="84" />
|
||||
<ColumnDefinition Width="*" MinWidth="104" MaxWidth="240" />
|
||||
<ColumnDefinition Width="90" />
|
||||
|
||||
@@ -694,7 +694,7 @@
|
||||
<Grid Height="36">
|
||||
<!-- The server name gives way first (it ends in an ellipsis), so Forget fits at 1200 px in longer languages. -->
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="120" />
|
||||
<ColumnDefinition Width="*" MinWidth="100" />
|
||||
<ColumnDefinition Width="170" />
|
||||
<ColumnDefinition Width="110" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<Border Grid.Row="1" BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="0,1,0,1" Padding="14,8,24,8">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.7*" MinWidth="90" MaxWidth="140" />
|
||||
<ColumnDefinition Width="*" MinWidth="90" MaxWidth="170" />
|
||||
<ColumnDefinition Width="1.6*" MinWidth="120" />
|
||||
<ColumnDefinition Width="*" MinWidth="104" MaxWidth="240" />
|
||||
<ColumnDefinition Width="90" />
|
||||
@@ -72,7 +72,7 @@
|
||||
<Border Height="38" Background="Transparent" Padding="14,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.7*" MinWidth="90" MaxWidth="140" />
|
||||
<ColumnDefinition Width="*" MinWidth="90" MaxWidth="170" />
|
||||
<ColumnDefinition Width="1.6*" MinWidth="120" />
|
||||
<ColumnDefinition Width="*" MinWidth="104" MaxWidth="240" />
|
||||
<ColumnDefinition Width="90" />
|
||||
|
||||
Reference in new issue
Block a user