feat(videos): board of published and workspace renders; card line starts with the preset
The Videos section and the admin Videos page gain a Board view with two
lanes, newest first, each with a count and the list's filters: Published
(library and server renders, including those sent from a workspace) and
Workspace (workspace exports, unsent ones plus sent ones marked Sent).
Cards show the sequence, project and version when known, preset, kind,
date and state chips, and reuse the existing actions; no new store.
Video cards now start with the preset ("4K archive · HEVC · 0:41 · 1.4 GB")
and Formatting.Bytes keeps number and unit together with a no-break space
(#28). The capture tool adds the videos-board scene in both themes.
Refs #29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe50b87726
commit
5a6efbb72f
27 files changed
+792
-74
No files matched your search
@@ -48,12 +48,16 @@ public sealed partial class AdminVideosTests(TestContext context)
|
||||
var page = await server.Client.GetStringAsync("/admin/pages/videos.js");
|
||||
var calls = ApiCall().Matches(page).Select(m => (Method: m.Groups[1].Value, Target: m.Groups[2].Value)).ToList();
|
||||
Assert.True(calls.Count >= 4, string.Join(", ", calls));
|
||||
// Reads the list, the server's videos folder and a filtered sequence's title; writes only the videos' delete and copy:
|
||||
// no settings, no project, no render, no job of its own.
|
||||
// Reads the list, the server's videos folder, its name (the board's lanes) and a filtered sequence's title; writes only
|
||||
// the videos' delete and copy: no settings, no project, no render, no job of its own.
|
||||
foreach (var (method, target) in calls)
|
||||
{
|
||||
Assert.True(method is "get" or "post", $"api.{method}({target}");
|
||||
if (method == "get") Assert.True(target is "listQuery(" or @"""/api/v1/server/settings""" or "`/api/v1/sequences/${encodeURIComponent(id)}`", target);
|
||||
if (method == "get")
|
||||
{
|
||||
Assert.True(target is "listQuery(" or @"""/api/v1/server/settings""" or @"""/api/v1/server/info""" or "`/api/v1/sequences/${encodeURIComponent(id)}`",
|
||||
target);
|
||||
}
|
||||
else Assert.True(target is @"""/api/v1/videos/copy""" or @"""/api/v1/videos/delete""", target);
|
||||
}
|
||||
Assert.Contains("return `/api/v1/videos?${p}`;", page);
|
||||
@@ -103,6 +107,29 @@ public sealed partial class AdminVideosTests(TestContext context)
|
||||
Assert.Equal("missing", VideoStates.Missing);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TheBoardShowsPublishedAndWorkspaceLanes()
|
||||
{
|
||||
await using var server = await TestServer.StartAsync(context);
|
||||
var page = await server.Client.GetStringAsync("/admin/pages/videos.js");
|
||||
// A third view beside cards and list, kept like them; its icon is the panel's.
|
||||
Assert.Contains(@"data-view=""board"" aria-pressed=""${view === ""board""}"" data-i18n-title=""Admin.Videos.View.Board.Tip""", page);
|
||||
Assert.Contains(@"return stored === ""list"" || stored === ""board"" ? stored : ""cards"";", page);
|
||||
Assert.Contains(" board: `<svg", await server.Client.GetStringAsync("/admin/icons.js"));
|
||||
// Two lanes, newest first whatever the order chosen, each with its count; Workspace holds the renders a PC's workspace
|
||||
// sent here (a project named, produced by a machine other than this server), marked Sent.
|
||||
Assert.Contains("const newest = [...rows].sort((a, b) => (Date.parse(b.created) - Date.parse(a.created))", page);
|
||||
Assert.Contains(@"return lane(""Published"", newest, false) + lane(""Workspace"", sent, true);", page);
|
||||
Assert.Contains(@"<span class=""pill num"">${escapeHtml(formatNumber(items.length))}</span>", page);
|
||||
Assert.Contains("export function boardLane(v, serverName)", page);
|
||||
Assert.Contains(@"return v.projectId && producer && producer !== String(serverName ?? """") ? ""workspace"" : ""published"";", page);
|
||||
Assert.Contains(@"${workspace ? sentChip(v) : """"}${stateChips(v)}", page);
|
||||
// The server's name comes from its public info, the name its own renders carry.
|
||||
Assert.Contains(@"api.get(""/api/v1/server/info"").then((info) => {", page);
|
||||
var css = await server.Client.GetStringAsync("/admin/admin.css");
|
||||
Assert.Contains(".seq-items.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));", css);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TheVideosStringsAreInEnglishAndItalian()
|
||||
{
|
||||
@@ -117,7 +144,8 @@ public sealed partial class AdminVideosTests(TestContext context)
|
||||
// The keys the pages build from a value.
|
||||
keys.AddRange(VideoSorts.All.Select(s => $"Admin.Videos.Sort.{char.ToUpperInvariant(s[0])}{s[1..]}"));
|
||||
keys.AddRange(["Admin.Videos.Kind.Video", "Admin.Videos.Kind.Still", "Admin.Videos.Kind.Sequence", "Admin.Trash.Kind.Videos", "Admin.Nav.Videos", "Admin.Nav.Videos.Tip",
|
||||
"Admin.Settings.VideosPath", "Admin.Settings.VideosPath.Tip", "Admin.Job.Kind.VideoCopy"]);
|
||||
"Admin.Settings.VideosPath", "Admin.Settings.VideosPath.Tip", "Admin.Job.Kind.VideoCopy", "Admin.Videos.Lane.Published", "Admin.Videos.Lane.Published.Tip",
|
||||
"Admin.Videos.Lane.Workspace", "Admin.Videos.Lane.Workspace.Tip"]);
|
||||
keys.AddRange(Regex.Matches(trash + sequence, @"""(Admin\.(?:Trash\.[A-Za-z]*Video[A-Za-z]*|Videos\.[A-Za-z.]+)(?:\.[A-Za-z]+)*)""").Select(m => m.Groups[1].Value));
|
||||
Assert.Contains("Admin.Trash.RestoredVideo", keys);
|
||||
Assert.Contains("Admin.Videos.AllVideos.Tip", keys);
|
||||
|
||||
Reference in new issue
Block a user