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 <noreply@anthropic.com> (cherry picked from commit 029cf334f66cb6fa1265b96a6f8faff2964c11ea)
This commit is contained in:
1 parent
51782a3ada
commit
aa1d4913a3
23 files changed
+2540
-31
No files matched your search
@@ -230,6 +230,34 @@ public abstract class CatalogRepositoryTests(TestContext context) : RepositoryTe
|
||||
Assert.Equal(2023, everything.ByYear[0].Year);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task FacetsListTheYearsCamerasAndTagsOfOneArchive()
|
||||
{
|
||||
// The admin panel's Library filters (owner review 2, R6): what one archive has, with counts, as the listing filters take it.
|
||||
var db = await OpenChronosAsync();
|
||||
var main = TestData.Archive();
|
||||
var other = TestData.Archive("Other");
|
||||
await db.Archives.UpsertAsync(main, Ct);
|
||||
await db.Archives.UpsertAsync(other, Ct);
|
||||
var seqs = new[]
|
||||
{
|
||||
TestData.Sequence(main.Id, new DateTime(2024, 3, 10), camera: "EOS R5") with { Tags = ["Night", "roof"] },
|
||||
TestData.Sequence(main.Id, new DateTime(2025, 7, 1), camera: "EOS R5") with { Tags = ["night"] },
|
||||
TestData.Sequence(main.Id, new DateTime(2025, 1, 2), camera: "Z 8") with { CameraMake = "NIKON CORPORATION" },
|
||||
TestData.Sequence(main.Id, null, camera: "") with { CameraMake = null },
|
||||
TestData.Sequence(other.Id, new DateTime(2023, 1, 1), camera: "X-T5") with { Tags = ["elsewhere"] },
|
||||
};
|
||||
foreach (var s in seqs) await db.Sequences.UpsertAsync(s, Ct);
|
||||
|
||||
var facets = await db.Sequences.GetFacetsAsync(main.Id, Ct);
|
||||
Assert.SequenceEqual([new ArchiveFacet("2025", 2), new ArchiveFacet("2024", 1)], facets.Years);
|
||||
Assert.SequenceEqual([new ArchiveFacet("EOS R5", 2, "Canon"), new ArchiveFacet("Z 8", 1, "NIKON CORPORATION")], facets.Cameras);
|
||||
Assert.SequenceEqual([new ArchiveFacet("Night", 2), new ArchiveFacet("roof", 1)], facets.Tags);
|
||||
foreach (var facet in facets.Cameras)
|
||||
Assert.Equal(facet.Sequences, await db.Sequences.CountAsync(new SequenceQuery { ArchiveId = main.Id, Camera = facet.Value }, Ct));
|
||||
Assert.Equal(2, await db.Sequences.CountAsync(new SequenceQuery { ArchiveId = main.Id, Tag = facets.Tags[0].Value }, Ct));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task FramesBulkInsertPageAndFindDuplicates()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user