From 9aa818ed470c532767e2971cc26b6245e4da2201 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 27 Oct 2026 15:08:39 +0100 Subject: [PATCH] feat: owner review 2 phase 3: Library on the web panel, photo trash and web upload (#11) - Web panel Library: browse, view, delete sequences and photos, mass operations (analyse, proxies, thumbnails, verify, retag, delete, CSV). It never edits the video. - Photo trash with tombstones (migration 0008): crash-safe delete and restore, hash-checked restore with reasons, and emptying only by an explicit fingerprinted job. Sync and uploads keep deleted photos deleted; an explicit "Upload again" brings one back. - Upload from the web panel: in-house SHA-256 in a worker with a fail-closed self-test, capture time from EXIF, chunked, resumable; no folders. - Desktop trash dialog with photo entries and Empty. - Admin files are revalidated (no-cache + ETag). Co-Authored-By: Claude Opus 5.5 Co-authored-by: Alberto Balbo --- branding/ui-icons/icons.py | 15 +- docs/ARCHITECTURE.md | 13 +- docs/BRIEF.md | 297 +++- docs/CHANGELOG.md | 53 + docs/DECISIONS.md | 24 + docs/STATUS.md | 39 +- docs/requests/2026-10-26-owner-review-2.md | 6 +- i18n/ar/Admin.ar.resx | 368 +++++ i18n/ar/Archive.ar.resx | 49 +- i18n/ar/Jobs.ar.resx | 1 + i18n/ar/Server.ar.resx | 6 + i18n/ar/Tooltips.ar.resx | 10 +- i18n/bg/Admin.bg.resx | 322 +++++ i18n/bg/Archive.bg.resx | 31 +- i18n/bg/Jobs.bg.resx | 1 + i18n/bg/Server.bg.resx | 6 + i18n/bg/Tooltips.bg.resx | 8 +- i18n/cs/Admin.cs.resx | 345 +++++ i18n/cs/Archive.cs.resx | 40 +- i18n/cs/Jobs.cs.resx | 1 + i18n/cs/Server.cs.resx | 6 + i18n/cs/Tooltips.cs.resx | 9 +- i18n/da/Admin.da.resx | 322 +++++ i18n/da/Archive.da.resx | 31 +- i18n/da/Jobs.da.resx | 1 + i18n/da/Server.da.resx | 6 + i18n/da/Tooltips.da.resx | 8 +- i18n/de/Admin.de.resx | 322 +++++ i18n/de/Archive.de.resx | 31 +- i18n/de/Jobs.de.resx | 1 + i18n/de/Server.de.resx | 6 + i18n/de/Tooltips.de.resx | 8 +- i18n/el/Admin.el.resx | 322 +++++ i18n/el/Archive.el.resx | 31 +- i18n/el/Jobs.el.resx | 1 + i18n/el/Server.el.resx | 6 + i18n/el/Tooltips.el.resx | 8 +- i18n/en/Admin.resx | 324 +++++ i18n/en/Archive.resx | 31 +- i18n/en/Jobs.resx | 1 + i18n/en/Server.resx | 6 + i18n/en/Tooltips.resx | 8 +- i18n/es/Admin.es.resx | 322 +++++ i18n/es/Archive.es.resx | 31 +- i18n/es/Jobs.es.resx | 1 + i18n/es/Server.es.resx | 6 + i18n/es/Tooltips.es.resx | 8 +- i18n/et/Admin.et.resx | 322 +++++ i18n/et/Archive.et.resx | 31 +- i18n/et/Jobs.et.resx | 1 + i18n/et/Server.et.resx | 6 + i18n/et/Tooltips.et.resx | 8 +- i18n/fi/Admin.fi.resx | 322 +++++ i18n/fi/Archive.fi.resx | 31 +- i18n/fi/Jobs.fi.resx | 1 + i18n/fi/Server.fi.resx | 6 + i18n/fi/Tooltips.fi.resx | 8 +- i18n/fr/Admin.fr.resx | 322 +++++ i18n/fr/Archive.fr.resx | 31 +- i18n/fr/Jobs.fr.resx | 1 + i18n/fr/Server.fr.resx | 6 + i18n/fr/Tooltips.fr.resx | 8 +- i18n/he/Admin.he.resx | 345 +++++ i18n/he/Archive.he.resx | 40 +- i18n/he/Jobs.he.resx | 1 + i18n/he/Server.he.resx | 6 + i18n/he/Tooltips.he.resx | 9 +- i18n/hi/Admin.hi.resx | 322 +++++ i18n/hi/Archive.hi.resx | 31 +- i18n/hi/Jobs.hi.resx | 1 + i18n/hi/Server.hi.resx | 6 + i18n/hi/Tooltips.hi.resx | 8 +- i18n/hr/Admin.hr.resx | 345 +++++ i18n/hr/Archive.hr.resx | 40 +- i18n/hr/Jobs.hr.resx | 1 + i18n/hr/Server.hr.resx | 6 + i18n/hr/Tooltips.hr.resx | 9 +- i18n/hu/Admin.hu.resx | 322 +++++ i18n/hu/Archive.hu.resx | 31 +- i18n/hu/Jobs.hu.resx | 1 + i18n/hu/Server.hu.resx | 6 + i18n/hu/Tooltips.hu.resx | 8 +- i18n/id/Admin.id.resx | 322 +++++ i18n/id/Archive.id.resx | 31 +- i18n/id/Jobs.id.resx | 1 + i18n/id/Server.id.resx | 6 + i18n/id/Tooltips.id.resx | 8 +- i18n/it/Admin.it.resx | 322 +++++ i18n/it/Archive.it.resx | 31 +- i18n/it/Jobs.it.resx | 1 + i18n/it/Server.it.resx | 6 + i18n/it/Tooltips.it.resx | 8 +- i18n/ja/Admin.ja.resx | 322 +++++ i18n/ja/Archive.ja.resx | 31 +- i18n/ja/Jobs.ja.resx | 1 + i18n/ja/Server.ja.resx | 6 + i18n/ja/Tooltips.ja.resx | 8 +- i18n/ko/Admin.ko.resx | 322 +++++ i18n/ko/Archive.ko.resx | 31 +- i18n/ko/Jobs.ko.resx | 1 + i18n/ko/Server.ko.resx | 6 + i18n/ko/Tooltips.ko.resx | 8 +- i18n/lt/Admin.lt.resx | 345 +++++ i18n/lt/Archive.lt.resx | 40 +- i18n/lt/Jobs.lt.resx | 1 + i18n/lt/Server.lt.resx | 6 + i18n/lt/Tooltips.lt.resx | 9 +- i18n/lv/Admin.lv.resx | 345 +++++ i18n/lv/Archive.lv.resx | 40 +- i18n/lv/Jobs.lv.resx | 1 + i18n/lv/Server.lv.resx | 6 + i18n/lv/Tooltips.lv.resx | 9 +- i18n/ms/Admin.ms.resx | 322 +++++ i18n/ms/Archive.ms.resx | 31 +- i18n/ms/Jobs.ms.resx | 1 + i18n/ms/Server.ms.resx | 6 + i18n/ms/Tooltips.ms.resx | 8 +- i18n/nb/Admin.nb.resx | 322 +++++ i18n/nb/Archive.nb.resx | 31 +- i18n/nb/Jobs.nb.resx | 1 + i18n/nb/Server.nb.resx | 6 + i18n/nb/Tooltips.nb.resx | 8 +- i18n/nl/Admin.nl.resx | 322 +++++ i18n/nl/Archive.nl.resx | 31 +- i18n/nl/Jobs.nl.resx | 1 + i18n/nl/Server.nl.resx | 6 + i18n/nl/Tooltips.nl.resx | 8 +- i18n/pl/Admin.pl.resx | 368 +++++ i18n/pl/Archive.pl.resx | 49 +- i18n/pl/Jobs.pl.resx | 1 + i18n/pl/Server.pl.resx | 6 + i18n/pl/Tooltips.pl.resx | 10 +- i18n/pt-BR/Admin.pt-BR.resx | 322 +++++ i18n/pt-BR/Archive.pt-BR.resx | 31 +- i18n/pt-BR/Jobs.pt-BR.resx | 1 + i18n/pt-BR/Server.pt-BR.resx | 6 + i18n/pt-BR/Tooltips.pt-BR.resx | 8 +- i18n/pt-PT/Admin.pt-PT.resx | 322 +++++ i18n/pt-PT/Archive.pt-PT.resx | 31 +- i18n/pt-PT/Jobs.pt-PT.resx | 1 + i18n/pt-PT/Server.pt-PT.resx | 6 + i18n/pt-PT/Tooltips.pt-PT.resx | 8 +- i18n/ro/Admin.ro.resx | 345 +++++ i18n/ro/Archive.ro.resx | 40 +- i18n/ro/Jobs.ro.resx | 1 + i18n/ro/Server.ro.resx | 6 + i18n/ro/Tooltips.ro.resx | 9 +- i18n/ru/Admin.ru.resx | 368 +++++ i18n/ru/Archive.ru.resx | 49 +- i18n/ru/Jobs.ru.resx | 1 + i18n/ru/Server.ru.resx | 6 + i18n/ru/Tooltips.ru.resx | 10 +- i18n/sk/Admin.sk.resx | 345 +++++ i18n/sk/Archive.sk.resx | 40 +- i18n/sk/Jobs.sk.resx | 1 + i18n/sk/Server.sk.resx | 6 + i18n/sk/Tooltips.sk.resx | 9 +- i18n/sl/Admin.sl.resx | 345 +++++ i18n/sl/Archive.sl.resx | 40 +- i18n/sl/Jobs.sl.resx | 1 + i18n/sl/Server.sl.resx | 6 + i18n/sl/Tooltips.sl.resx | 9 +- i18n/sv/Admin.sv.resx | 322 +++++ i18n/sv/Archive.sv.resx | 31 +- i18n/sv/Jobs.sv.resx | 1 + i18n/sv/Server.sv.resx | 6 + i18n/sv/Tooltips.sv.resx | 8 +- i18n/th/Admin.th.resx | 322 +++++ i18n/th/Archive.th.resx | 31 +- i18n/th/Jobs.th.resx | 1 + i18n/th/Server.th.resx | 6 + i18n/th/Tooltips.th.resx | 8 +- i18n/tr/Admin.tr.resx | 322 +++++ i18n/tr/Archive.tr.resx | 31 +- i18n/tr/Jobs.tr.resx | 1 + i18n/tr/Server.tr.resx | 6 + i18n/tr/Tooltips.tr.resx | 8 +- i18n/uk/Admin.uk.resx | 368 +++++ i18n/uk/Archive.uk.resx | 49 +- i18n/uk/Jobs.uk.resx | 1 + i18n/uk/Server.uk.resx | 6 + i18n/uk/Tooltips.uk.resx | 10 +- i18n/vi/Admin.vi.resx | 322 +++++ i18n/vi/Archive.vi.resx | 31 +- i18n/vi/Jobs.vi.resx | 1 + i18n/vi/Server.vi.resx | 6 + i18n/vi/Tooltips.vi.resx | 8 +- i18n/zh-Hans/Admin.zh-Hans.resx | 322 +++++ i18n/zh-Hans/Archive.zh-Hans.resx | 31 +- i18n/zh-Hans/Jobs.zh-Hans.resx | 1 + i18n/zh-Hans/Server.zh-Hans.resx | 6 + i18n/zh-Hans/Tooltips.zh-Hans.resx | 8 +- i18n/zh-Hant/Admin.zh-Hant.resx | 322 +++++ i18n/zh-Hant/Archive.zh-Hant.resx | 31 +- i18n/zh-Hant/Jobs.zh-Hant.resx | 1 + i18n/zh-Hant/Server.zh-Hant.resx | 6 + i18n/zh-Hant/Tooltips.zh-Hant.resx | 8 +- .../Archive/ArchiveDialogViewModels.cs | 19 +- src/Chronos.App/Archive/ArchiveDialogs.xaml | 7 +- src/Chronos.App/Archive/ArchiveFailures.cs | 6 +- src/Chronos.App/Archive/SampleReports.cs | 11 +- .../Archive/TrashDialogViewModel.cs | 157 ++- src/Chronos.App/Jobs/JobNotices.cs | 2 +- src/Chronos.App/Sections/ArchiveViewModel.cs | 7 +- src/Chronos.App/Sections/SettingsViewModel.cs | 2 +- src/Chronos.Core/Archiving/ArchiveJson.cs | 1 + src/Chronos.Core/Archiving/ArchiveLayout.cs | 12 + .../Archiving/FrameRemovalJournal.cs | 117 ++ src/Chronos.Core/Archiving/LeaseFile.cs | 3 + .../Archiving/SequenceManifest.cs | 54 + src/Chronos.Core/Archiving/ThumbPack.cs | 24 + src/Chronos.Core/Model/Entities.cs | 7 + src/Chronos.Core/Model/Enums.cs | 16 + src/Chronos.Data/Archiving/ArchiveIndexer.cs | 26 +- src/Chronos.Data/Archiving/ArchiveIngest.cs | 37 +- src/Chronos.Data/Archiving/ArchiveService.cs | 59 +- .../Archiving/FrameTrash.Restore.cs | 638 +++++++++ src/Chronos.Data/Archiving/FrameTrash.cs | 717 ++++++++++ src/Chronos.Data/Archiving/IArchiveIngest.cs | 17 +- .../Archiving/Jobs/ArchiveJobParameters.cs | 10 + .../Archiving/Jobs/EmptyTrashJobHandler.cs | 37 + .../Archiving/ProjectPositions.cs | 38 +- src/Chronos.Data/Archiving/SequenceMapping.cs | 16 + .../Archiving/SequenceTrash.Empty.cs | 227 +++ src/Chronos.Data/Archiving/SequenceTrash.cs | 87 +- src/Chronos.Data/Archiving/SequenceWriter.cs | 9 +- src/Chronos.Data/ChronosDatabase.cs | 4 + .../postgres/0008_frame_removals.sql | 14 + .../Migrations/sqlite/0008_frame_removals.sql | 14 + .../Repositories/FrameRemovalRepository.cs | 71 + .../Repositories/SequenceRepository.cs | 36 + src/Chronos.Data/Sync/SyncPositions.cs | 17 +- src/Chronos.Data/Sync/SyncRules.cs | 22 + src/Chronos.Data/Sync/SyncService.cs | 4 +- src/Chronos.Data/Sync/SyncTombstones.cs | 81 ++ src/Chronos.Data/Sync/SyncTransfers.cs | 55 +- src/Chronos.Protocol/Client/ChronosClient.cs | 14 +- src/Chronos.Protocol/Dtos.cs | 7 +- src/Chronos.Protocol/Library.cs | 83 ++ src/Chronos.Protocol/ProtocolJson.cs | 14 + src/Chronos.Protocol/Sequences.cs | 13 +- src/Chronos.Protocol/Uploads.cs | 18 +- src/Chronos.Server/Admin/web/admin.css | 129 ++ src/Chronos.Server/Admin/web/api.js | 30 +- src/Chronos.Server/Admin/web/app.js | 5 +- src/Chronos.Server/Admin/web/audit.js | 13 + src/Chronos.Server/Admin/web/capture-time.js | 91 ++ src/Chronos.Server/Admin/web/hash-worker.js | 42 + src/Chronos.Server/Admin/web/icons.js | 19 +- src/Chronos.Server/Admin/web/pages/archive.js | 6 +- src/Chronos.Server/Admin/web/pages/library.js | 578 ++++++++ .../Admin/web/pages/library/sequence.js | 613 +++++++++ .../Admin/web/pages/library/shared.js | 322 +++++ .../Admin/web/pages/library/trash.js | 217 +++ src/Chronos.Server/Admin/web/sha256.js | 185 +++ src/Chronos.Server/Admin/web/ui.js | 83 +- src/Chronos.Server/Admin/web/upload.js | 795 +++++++++++ src/Chronos.Server/Api/JobEndpoints.cs | 8 + src/Chronos.Server/Api/LibraryEndpoints.cs | 452 ++++++ src/Chronos.Server/Api/SequenceEndpoints.cs | 20 +- src/Chronos.Server/Api/SystemEndpoints.cs | 7 +- src/Chronos.Server/Api/TrashEndpoints.cs | 160 +++ src/Chronos.Server/Api/UploadEndpoints.cs | 5 +- .../Configuration/ServerSettingsStore.cs | 1 + .../Hosting/EmbeddedStaticFiles.cs | 30 +- src/Chronos.Server/Hosting/ServerHost.cs | 2 + .../Storage/ArchiveAssetLocator.cs | 3 +- src/Chronos.Server/Storage/UploadRules.cs | 19 + src/Chronos.Server/Storage/UploadService.cs | 51 +- .../Archive/TrashDialogTests.cs | 327 +++++ .../Library/LibraryScreenSmokeTests.cs | 2 +- .../Archiving/ManifestStoreTests.cs | 37 + .../Archiving/ThumbPackTests.cs | 35 + .../Archiving/FrameTrashTests.cs | 1225 +++++++++++++++++ .../Migrations/MigrationTests.cs | 2 +- .../Repositories/CatalogRepositoryTests.cs | 28 + .../Chronos.Data.Tests/Sync/FakeSyncRemote.cs | 5 +- .../Chronos.Data.Tests/Sync/SyncRulesTests.cs | 51 + .../Sync/SyncTransferTests.cs | 133 ++ .../Chronos.Server.Tests/Api/LibraryTests.cs | 662 +++++++++ .../Hosting/SystemEndpointTests.cs | 447 +++++- .../Storage/ArchiveModuleTests.cs | 84 ++ .../Storage/BrowserUploadTests.cs | 500 +++++++ 283 files changed, 24922 insertions(+), 293 deletions(-) create mode 100644 src/Chronos.Core/Archiving/FrameRemovalJournal.cs create mode 100644 src/Chronos.Data/Archiving/FrameTrash.Restore.cs create mode 100644 src/Chronos.Data/Archiving/FrameTrash.cs create mode 100644 src/Chronos.Data/Archiving/Jobs/EmptyTrashJobHandler.cs create mode 100644 src/Chronos.Data/Archiving/SequenceTrash.Empty.cs create mode 100644 src/Chronos.Data/Migrations/postgres/0008_frame_removals.sql create mode 100644 src/Chronos.Data/Migrations/sqlite/0008_frame_removals.sql create mode 100644 src/Chronos.Data/Repositories/FrameRemovalRepository.cs create mode 100644 src/Chronos.Data/Sync/SyncTombstones.cs create mode 100644 src/Chronos.Protocol/Library.cs create mode 100644 src/Chronos.Server/Admin/web/capture-time.js create mode 100644 src/Chronos.Server/Admin/web/hash-worker.js create mode 100644 src/Chronos.Server/Admin/web/pages/library.js create mode 100644 src/Chronos.Server/Admin/web/pages/library/sequence.js create mode 100644 src/Chronos.Server/Admin/web/pages/library/shared.js create mode 100644 src/Chronos.Server/Admin/web/pages/library/trash.js create mode 100644 src/Chronos.Server/Admin/web/sha256.js create mode 100644 src/Chronos.Server/Admin/web/upload.js create mode 100644 src/Chronos.Server/Api/LibraryEndpoints.cs create mode 100644 src/Chronos.Server/Api/TrashEndpoints.cs create mode 100644 tests/Chronos.App.Tests/Archive/TrashDialogTests.cs create mode 100644 tests/Chronos.Data.Tests/Archiving/FrameTrashTests.cs create mode 100644 tests/Chronos.Server.Tests/Api/LibraryTests.cs create mode 100644 tests/Chronos.Server.Tests/Storage/BrowserUploadTests.cs diff --git a/branding/ui-icons/icons.py b/branding/ui-icons/icons.py index c10a1875..d135e731 100644 --- a/branding/ui-icons/icons.py +++ b/branding/ui-icons/icons.py @@ -176,17 +176,22 @@ svg.append('') with write(os.path.join(here, "icons.svg")) as f: f.write("\n".join(svg)) -# The web admin's icons (its own names -> this set's), as inline SVG strings for app.js and the pages. -WEB = {"dashboard": "Library", "users": "Users", "archive": "Archive", "jobs": "Jobs", "settings": "Settings", "logs": "Logs", - "menu": "Menu", "power": "Power", "moon": "Moon", "refresh": "Refresh", "close": "Close", "plus": "Plus", "copy": "Copy", - "search": "Search"} +# The web admin's icons (its own names -> this set's), as inline SVG strings for app.js and the pages. The dashboard keeps +# the four tiles of mockup Admin.html, so the panel's Library (owner review 2, R6) is drawn as a photo. +WEB = {"dashboard": "Library", "library": "Image", "users": "Users", "archive": "Archive", "jobs": "Jobs", "settings": "Settings", + "logs": "Logs", "menu": "Menu", "power": "Power", "moon": "Moon", "refresh": "Refresh", "close": "Close", "plus": "Plus", + "copy": "Copy", "search": "Search", "grid": "ViewGrid", "list": "ViewList", "trash": "Delete", "upload": "Upload", + "download": "Download", "back": "Back", "previous": "ChevronLeft", "next": "ChevronRight", "star": "Star", + "starFilled": "StarFilled", "hero": "Hero", "image": "Image", "warning": "Warning"} STROKE = 'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"' with write(os.path.join(here, "..", "..", "src", "Chronos.Server", "Admin", "web", "icons.js")) as f: f.write("// Generated by branding/ui-icons/icons.py (same 16-px set as the desktop apps). Do not edit by hand.\n") + f.write("// Glyphs that point along the reading direction carry class=\"directional\" (mirrored in right-to-left pages, admin.css).\n") f.write("export const icons = {\n") for key, name in WEB.items(): stroke, fill = I[name] paths = (f'' if fill else "") + (f'' if stroke else "") - f.write(f' {key}: ``,\n') + mirror = ' class="directional"' if name in DIRECTIONAL else "" + f.write(f' {key}: `