From aa1d4913a325b53b9c7613decc8b6094305c2134 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 27 Oct 2026 09:53:38 +0100 Subject: [PATCH] feat(admin): Library pages on the web panel (owner review 2, R6) The web panel now manages the library without editing it: the owner can browse and view sequences and photos, delete sequences and photos into the archive's trash, restore or empty the trash and run mass operations, as R6 asks, on top of the engine endpoints of the previous commit. - Library page right after the Dashboard: search, Year/Camera/Status/Tag filters fed by a new GET /api/v1/sequences/facets, sort, cards or list (remembered per browser), lazy cover thumbnails, Load more by cursor, multi-select with Shift ranges and "Select all N" of the filter, and a sticky bar for the selection: Analyse, Proxies, Thumbnails, Verify, Tags (add/remove), Export CSV (client-side) and Delete (dry run, list of what moves to the trash, then the move). Filters live in the address, so Back from a sequence finds them again. - Sequence view (#/library?id=): inline title, tags, rating and notes, facts, photos in pages of 500 with content-visibility, a photo viewer (proxy, arrows, Esc, Exif facts), Set cover, Download original, Delete photos (typing the count above 20 photos), Delete sequence, renders to download. No video editing controls. - Trash view (#/library?view=trash, also linked from Archive): entries, Restore, and Empty (dry run, list, the localised word typed, the plan's fingerprint sent back, the job followed to its end). - Live updates from sequenceChanged and jobState; keyboard grid (one tab stop, arrows, Space, Shift+Space, Enter, Ctrl+A, Esc); RTL, dark theme. - GET /sequences takes rendered=true|false for the Status filter. - ui.js: confirmDialog's typed confirmation by name, word or count, with a list of what the action concerns; formDialog. api.js: putBytes for the web upload, which the Library imports on demand (upload.js, optional). - New web icons from icons.py (Image for the Library, trash, grid/list, arrows, stars, cover); directional glyphs mirror in right-to-left pages. - Strings in en and it; tests for the facets (both dialects), the rendered filter, the menu, the modules and the on-demand upload import. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 029cf334f66cb6fa1265b96a6f8faff2964c11ea) --- branding/ui-icons/icons.py | 15 +- docs/ARCHITECTURE.md | 4 +- i18n/en/Admin.resx | 267 ++++++++ i18n/it/Admin.it.resx | 265 ++++++++ .../Repositories/SequenceRepository.cs | 36 ++ src/Chronos.Protocol/Library.cs | 12 + src/Chronos.Protocol/ProtocolJson.cs | 1 + src/Chronos.Server/Admin/web/admin.css | 111 ++++ src/Chronos.Server/Admin/web/api.js | 16 +- src/Chronos.Server/Admin/web/app.js | 5 +- src/Chronos.Server/Admin/web/audit.js | 13 + 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 | 555 +++++++++++++++++ .../Admin/web/pages/library/sequence.js | 569 ++++++++++++++++++ .../Admin/web/pages/library/shared.js | 283 +++++++++ .../Admin/web/pages/library/trash.js | 156 +++++ src/Chronos.Server/Admin/web/ui.js | 77 ++- src/Chronos.Server/Api/LibraryEndpoints.cs | 16 + src/Chronos.Server/Api/SequenceEndpoints.cs | 8 +- .../Repositories/CatalogRepositoryTests.cs | 28 + .../Chronos.Server.Tests/Api/LibraryTests.cs | 51 ++ .../Hosting/SystemEndpointTests.cs | 58 +- 23 files changed, 2540 insertions(+), 31 deletions(-) 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 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}: `