feat(app): library, jobs, settings, server, welcome and about screens
Local-mode composition root (SQLite index, one JobEngine fed by a single handler registration list), keyset-paged library with thumbnail cache and hover scrub, live job list with throttled updates and the shell job bar, settings with live template validation and encoder self-test, server connection with trust-on-first-use and DPAPI token, first-run welcome, About with update check, and --capture screenshots with synthetic data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
94 files changed
+10130
-374
No files matched your search
@@ -26,9 +26,34 @@ public static class Formatting
|
||||
/// <summary>Compact duration: "2 h 00 m", "5 min", "40 s".</summary>
|
||||
public static string Duration(TimeSpan t)
|
||||
{
|
||||
if (t < TimeSpan.Zero) t = TimeSpan.Zero;
|
||||
if (t.TotalHours >= 24) return Loc.L("Common.Duration.Days", (int)t.TotalDays, t.Hours);
|
||||
if (t.TotalHours >= 1) return Loc.L("Common.Duration.Hours", (int)t.TotalHours, t.Minutes.ToString("00", Loc.Culture));
|
||||
if (t.TotalMinutes >= 1) return Loc.L("Common.Duration.Minutes", (int)Math.Round(t.TotalMinutes));
|
||||
return Loc.L("Common.Duration.Seconds", (int)Math.Round(t.TotalSeconds));
|
||||
}
|
||||
|
||||
/// <summary>Clock-style elapsed time for finished jobs: "2:41", "1:02:41".</summary>
|
||||
public static string Elapsed(TimeSpan t)
|
||||
{
|
||||
if (t < TimeSpan.Zero) t = TimeSpan.Zero;
|
||||
return t.TotalHours >= 1
|
||||
? ((int)t.TotalHours).ToString(Loc.Culture) + ":" + t.Minutes.ToString("00", Loc.Culture) + ":" + t.Seconds.ToString("00", Loc.Culture)
|
||||
: ((int)t.TotalMinutes).ToString(Loc.Culture) + ":" + t.Seconds.ToString("00", Loc.Culture);
|
||||
}
|
||||
|
||||
/// <summary>0.62 → "62 %".</summary>
|
||||
public static string Percent(double fraction) => Loc.L("Common.Percent", Math.Round(Math.Clamp(fraction, 0, 1) * 100).ToString("0", Loc.Culture));
|
||||
|
||||
/// <summary>Items per second with one decimal below 100: "11.3", "118".</summary>
|
||||
public static string Rate(double perSecond) => perSecond.ToString(perSecond < 100 ? "0.#" : "N0", Loc.Culture);
|
||||
|
||||
/// <summary>Local time of day in the culture's short format ("09:12").</summary>
|
||||
public static string TimeOfDay(DateTimeOffset at) => at.ToLocalTime().ToString("t", Loc.Culture);
|
||||
|
||||
/// <summary>Calendar date in the culture's short format.</summary>
|
||||
public static string Date(DateTimeOffset at) => at.ToLocalTime().ToString("d", Loc.Culture);
|
||||
|
||||
/// <summary>Camera wall-clock date in the culture's short format.</summary>
|
||||
public static string Date(DateTime wallClock) => wallClock.ToString("d", Loc.Culture);
|
||||
}
|
||||
Reference in new issue
Block a user