feat(P8): integrate phase 5 (workspace stills, strings, prune)

Wire the phase 5 parcels into one working whole.

- Save frame works in a workspace project. WorkspaceSequenceSource now
  makes still jobs (IProjectStills) routed like its renders: with the
  originals on this PC, a WorkspaceRender still into exports/; with
  proxies only, the home's still job with the portable settings and the
  project id. The tooltip for a source that saves no frames is now a real
  string.
- The Export footer has Save project file again for library sequences;
  workspace projects keep it in their project menu only.
- Sync render downloads are hashed and compared with the server's
  sha256 (one retry, then the job fails without filing the file), and
  uploads and downloads carry the render kind, so a saved frame no longer
  counts as a recent preset.
- Add the missing en/it strings: still frame out of the sequence
  (Core and both job handlers), keyframes not applicable, workspace
  stills, Videos refresh / clear sequence / play-from-server tips, the
  videos-folder creation error, and the admin panel kind labels, play
  and trash tips.
- Delete the export history, batch and card strings no longer used from
  English and prune them from every culture.
- Videos: the sequence chip clears only the sequence filter (desktop and
  admin panel), the desktop remembers cards or list, and a Refresh button.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-05 03:16:52 +01:00
1 parent c4924c122e
commit 6d87a1bc6d
111 files changed
+459 -754

No files matched your search

@@ -1,4 +1,8 @@
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using Chronos.App.Editor;
using Chronos.App.Shell;
using Chronos.App.Tests.Windows;
@@ -35,10 +39,12 @@ public sealed class ExportTabTests
Assert.True(ExportRules.HasRateControl(VideoCodec.H264));
Assert.True(ExportRules.HasRateControl(VideoCodec.Hevc));
Assert.Null(ExportRules.RateControlBlocked(VideoCodec.Av1));
Assert.Null(ExportRules.KeyframesBlocked(VideoCodec.Hevc));
foreach (var managed in new[] { VideoCodec.Mjpeg, VideoCodec.Gif, VideoCodec.Apng, VideoCodec.PngSequence, VideoCodec.JpegSequence })
{
Assert.False(ExportRules.HasRateControl(managed), $"{managed} has no rate control");
Assert.NotNull(ExportRules.RateControlBlocked(managed), $"{managed}: the tooltip says why");
Assert.Equal(Loc.L("Tooltips.Export.KeyframesNA", Loc.L("Export.Codec." + managed)), ExportRules.KeyframesBlocked(managed), $"{managed}: no keyframe interval");
Assert.NotNull(ExportRules.BFramesBlocked(managed, CodecProfile.Auto), $"{managed} takes no B-frames");
Assert.Empty(ExportRules.Profiles(managed, 8));
Assert.NotNull(ExportRules.ProfileBlocked(managed, 8));
@@ -244,9 +250,35 @@ public sealed class ExportTabTests
Assert.Equal("Batch (1)", export.BatchText);
Assert.Equal(Loc.L("Export.Footer.Videos", content.Renders.Count.ToString("N0", Loc.Culture)), export.VideosText);
Assert.NotNull(export.FooterSummary);
// A library sequence saves its .chronos project file from the footer; a workspace project has it in its project ▾ menu.
var panel = new ContentControl { Content = export };
panel.Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new Uri("pack://application:,,,/Chronos;component/Editor/EditorPanels.xaml", UriKind.Absolute),
});
panel.Measure(new Size(420, 4000));
panel.Arrange(new Rect(0, 0, 420, 4000));
panel.UpdateLayout();
var save = Assert.NotNull(Descendants<Button>(panel).SingleOrDefault(b => ReferenceEquals(b.Command, export.SaveProjectCommand)));
Assert.False(editor.HasProject);
Assert.Equal(Visibility.Visible, save.Visibility);
Assert.Equal("Editor.HasProject", BindingOperations.GetBinding(save, UIElement.VisibilityProperty)?.Path.Path);
Assert.True(export.SaveProjectCommand.CanExecute(null));
}
});
private static IEnumerable<T> Descendants<T>(DependencyObject root)
where T : DependencyObject
{
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(root); i++)
{
var child = VisualTreeHelper.GetChild(root, i);
if (child is T match) yield return match;
foreach (var nested in Descendants<T>(child)) yield return nested;
}
}
/// <summary>A Videos section as the shell would hold it.</summary>
private sealed class FakeVideos() : SectionViewModel(SectionKey.Jobs, "Icon.Jobs"), IVideosSection
{
@@ -131,7 +131,8 @@ public sealed class RenderMenuTests
Assert.Null(ServerJobs.StillNeedsNewerServer(RenderRules.StillFormat), "a format-3 server takes still jobs");
Assert.Equal(older, RenderMenu.SaveFrameBlockedReason(false, "Studio NAS", false, true, true, older, null));
Assert.Equal(Loc.L("Tooltips.Editor.Render.NameError", "bad"), RenderMenu.SaveFrameBlockedReason(false, null, false, true, true, null, "bad"));
Assert.NotNull(RenderMenu.SaveFrameBlockedReason(false, null, false, true, sourceSavesFrames: false, null, null), "a workspace project saves no frame yet");
Assert.Equal(Loc.L("Tooltips.Export.StillWorkspace"), RenderMenu.SaveFrameBlockedReason(false, null, false, true, sourceSavesFrames: false, null, null),
"a source that renders elsewhere without still jobs of its own");
Assert.Null(RenderMenu.SaveFrameBlockedReason(false, null, false, true, true, null, null));
// In the menu: Save frame › and its formats are disabled and say why.
@@ -50,6 +50,11 @@ public sealed class VideoSourcesTests
Assert.True(merged.Single(e => e.Id == server[1].Id) is { IsLocal: false, IsOnServer: true, LocalPath: null });
Assert.True(merged.Single(e => e.Id == local[1].Id) is { IsLocal: true, IsUnsent: false });
Assert.True(merged.Single(e => e.Id == unsent.Id).IsUnsent);
// Play says why it waits: only on the server, or gone from this PC.
Assert.Equal(Loc.L("Tooltips.Videos.Play"), VideoText.PlayToolTip(twin));
Assert.Equal(Loc.L("Tooltips.Videos.PlayServer"), VideoText.PlayToolTip(merged.Single(e => e.Id == server[1].Id)));
Assert.Equal(Loc.L("Tooltips.Videos.Missing"), VideoText.PlayToolTip(local[1] with { Missing = true }));
}
[Test]
@@ -263,6 +268,13 @@ public sealed class VideosSectionTests(TestContext context)
section.SearchText = "comet";
Assert.True(section.Rows[0].IsSelected);
Assert.True(section.HasSelection);
// The chip's × clears the sequence only: the search and the order stay.
Assert.True(section.ClearSequenceCommand.CanExecute(null));
section.ClearSequenceCommand.Execute(null);
Assert.False(section.IsSequenceFiltered);
Assert.Equal("comet", section.SearchText);
Assert.Equal(VideoSorts.Largest, section.SelectedSort.Value);
Assert.False(section.ClearSequenceCommand.CanExecute(null));
});
[Test]
@@ -370,8 +382,12 @@ public sealed class VideosSectionTests(TestContext context)
await section.RefreshAsync();
var view = new VideosView { DataContext = section };
Layout(view);
Assert.Equal(LibraryLayout.Grid, shell.Services.Settings.VideosLayout);
section.LayoutIndex = 1;
Assert.Equal(LibraryLayout.List, shell.Services.Settings.VideosLayout, "the list is kept for the next run");
Assert.Equal(1, new VideosViewModel(shell).LayoutIndex, "and a new section opens on it");
section.Rows[0].IsSelected = true;
Assert.Equal(Loc.L("Tooltips.Videos.Play"), section.PlayToolTip);
Assert.True(section.PlayCommand.CanExecute(null));
section.PlayCommand.Execute(null);
var player = Assert.NotNull(section.Player);
@@ -8,6 +8,7 @@ using Chronos.Core.Imaging.Decoders;
using Chronos.Core.Localization;
using Chronos.Core.Model;
using Chronos.Core.Project;
using Chronos.Core.Video;
using Chronos.Data.Processing;
using Chronos.Data.Workspaces;
using Chronos.Protocol.Client;
@@ -65,6 +66,20 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
var (render, _) = ProcessingJobs.ReadRender(parameters.RenderJson);
Assert.NotNull(render.SettingsJson, "the portable settings travel with the job");
// Save frame: a still job on this PC too, with the frame, its photo and the portable settings.
Assert.True(session.CanSaveFrames, "a workspace project saves frames");
var still = Assert.NotNull(session.StillRequests(Mjpeg, VideoCodec.PngSequence, 1)).Single();
Assert.Equal(JobKind.WorkspaceRender, still.Kind);
var stillJob = Assert.NotNull(WorkspaceJobs.RenderParameters(new Job { Id = Guid.CreateVersion7(), Kind = still.Kind, ParametersJson = still.ParametersJson }));
Assert.Equal((projectId, Server), (stillJob.ProjectId, stillJob.Server));
var (frame, _) = ProcessingJobs.ReadRender(stillJob.RenderJson);
Assert.True(frame.IsStill);
Assert.Equal(1, frame.StillFrame);
Assert.Equal(content.Frames[1].Sha256?.ToLowerInvariant(), frame.StillPhoto);
Assert.Equal(("pngsequence", projectId), (frame.Codec, frame.ProjectId));
Assert.NotNull(frame.SettingsJson, "the portable settings travel with the still");
Assert.Null(frame.ProjectVersionId, "another export than the saved one: no version holds these settings");
// Queued on this PC's engine and listed beside the server's jobs (the render itself is the Data tests': this bed decodes nothing).
var jobId = await source.SubmitAsync(request, bed.Ct);
var queued = Assert.NotNull(await bed.Db.Jobs.GetAsync(jobId, bed.Ct));