feat(admin): Reorganize dialog in the Library and after the archive templates change

Owner review 2, R7 asks to rename and move sequences after import, on the web panel too.
The Library's mass bar gets Reorganize… for the selection (every sequence after Select all
without a filter, else at most a thousand ids), and saving a changed folder or file template
on the Archive page offers it for all sequences in the save toast.

The dialog (reorganize.js) has a switch and a field for the folder, file and title templates,
prefilled from the archive settings; each change asks POST /archive/reorganize for a dry run,
one request at a time, and the table shows every step before and after (title, folder, renamed
files with samples, photos that keep their names and why). Apply confirms with the counts of
sequences, folders and photos, sends the shown plan's fingerprint back, and the toast links to
the queued job; a plan_changed refusal plans again. Server refusals land on the field they name.
Toasts can carry an action; the audit entry archive_reorganized reads as a sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 13939dff9a1e8a23ce7802ac38f2ded7fdbc2a74)
This commit is contained in:
Alby96 committed 2026-10-27 14:04:34 +01:00
1 parent eb2395d9b0
commit 17efb50e11
11 files changed
+802 -17

No files matched your search

@@ -184,8 +184,9 @@ public sealed partial class SystemEndpointTests(TestContext context)
var seen = await ModulesAsync(server);
Assert.True(seen.Count >= 20, string.Join(", ", seen.Keys));
// The Library's views (owner review 2, R6) are modules of their own under pages/library; the web upload (R3) is the
// dialog, its hash worker and the in-house SHA-256 the worker imports.
foreach (var module in new[] { "pages/library.js", "pages/library/sequence.js", "pages/library/trash.js", "pages/library/shared.js", "upload.js", "hash-worker.js", "sha256.js" })
// dialog, its hash worker and the in-house SHA-256 the worker imports; Reorganize (R7) is the dialog the Library and
// the Archive page import.
foreach (var module in new[] { "pages/library.js", "pages/library/sequence.js", "pages/library/trash.js", "pages/library/shared.js", "upload.js", "hash-worker.js", "sha256.js", "reorganize.js" })
Assert.True(seen.ContainsKey(module), module);
}