feat(settings): make every Settings row real; archive settings, index backups and restore

Settings (UI-01, UI-02, UI-03, UI-09, RF-4):
- New Import, Analysis and Formats pages, in the order of Settings.html. Import holds
  the defaults of new cards (session rules, subfolders, verification, duplicates,
  after-import actions); Analysis the deep-analysis width cap, night and star-field
  thresholds and deep analysis after import or scan; Formats the decode tier of every
  format on this PC with a notice and Store install link per missing codec extension.
- Archive gains thumbnail size and rescan interval; its templates, proxy size and
  thumbnail size are the open archive's own (archive.json) and new archives' defaults.
- Rendering quality, parallelism and background priority now drive the jobs: quality
  maps to preparation size, read-ahead and default flow quality; parallelism sets the
  engine's workers live and caps per-job threads; background priority raises the UI
  thread while Titano is in front.
- Advanced gains Restore (daily backups, dry-run summary, destructive confirmation,
  staged for the next start) and Reset all.
- The naming preview's sample title is a catalog string.

Engine (ENG-03, ENG-04, ENG-06):
- ArchiveService.GetSettingsAsync/UpdateSettingsAsync rewrite archive.json atomically
  under a lease, then the index row; the server endpoint and the desktop use them, and
  the desktop creates archives with Settings › Archive. ThumbnailPolicy in archive.json
  sizes the thumbnails.
- DatabaseBackups: daily VACUUM INTO copies kept x3 on the desktop and on a server on
  SQLite (DatabaseBackupService), staged restore checked and preceded by a fresh copy.
- Maintenance vacuums the SQLite index when 10 % or more is free (dry run reports it).
- JobEngine.SetWorkers; ProcessingOptions.Tune applies host tuning per job.

Archive setup toasts say why in a localized sentence (RF-1).

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 10:06:34 +00:00
1 parent c11c996bc6
commit 3e146c9f9f
91 files changed
+2864 -357

No files matched your search

@@ -154,4 +154,29 @@ public sealed class ManifestStoreTests(TestContext context)
Assert.Contains("syncPolicy", File.ReadAllText(path));
Assert.Equal("Studio", ManifestStore.ReadArchive(path).Name);
}
[Test]
public void TheThumbnailSizeIsTheArchivesOwnAndDefaultsTo320()
{
// An archive.json written before the thumbnail policy existed reads with the BRIEF §8.5 default.
var path = Path.Combine(context.CreateTempDirectory(), "archive.json");
File.WriteAllText(path, $$"""
{ "schemaVersion": 1, "id": "{{Guid.CreateVersion7()}}", "name": "Main", "created": "2026-10-02T09:00:00+00:00" }
""");
var read = ManifestStore.ReadArchive(path);
Assert.Equal((320, 80), (read.ThumbnailPolicy.LongEdge, read.ThumbnailPolicy.Quality));
ManifestStore.WriteArchive(path, read with { ThumbnailPolicy = read.ThumbnailPolicy with { LongEdge = 480 } });
Assert.Contains("\"thumbnailPolicy\"", File.ReadAllText(path));
Assert.Equal(480, ManifestStore.ReadArchive(path).ThumbnailPolicy.LongEdge);
File.WriteAllText(path, $$"""
{ "schemaVersion": 1, "id": "{{Guid.CreateVersion7()}}", "name": "Main", "thumbnailPolicy": { "longEdge": 240 } }
""");
Assert.Equal((240, 80), (ManifestStore.ReadArchive(path).ThumbnailPolicy.LongEdge, ManifestStore.ReadArchive(path).ThumbnailPolicy.Quality));
Assert.True(ThumbnailPolicy.IsValidLongEdge(160) && ThumbnailPolicy.IsValidLongEdge(1024));
Assert.False(ThumbnailPolicy.IsValidLongEdge(100) || ThumbnailPolicy.IsValidLongEdge(2048));
Assert.True(ProxyPolicy.IsValidLongEdge(ProxyPolicy.Disabled) && ProxyPolicy.IsValidLongEdge(ProxyPolicy.FullSize) && ProxyPolicy.IsValidLongEdge(1920));
Assert.False(ProxyPolicy.IsValidLongEdge(100) || ProxyPolicy.IsValidLongEdge(10_000));
}
}