feat(P5): Render menu with grouped presets, Save frame and a fixed-width header

The editor header's button now reads "Render" whatever the preset, so its
width stays the same in every language, and the tooltip carries the preset,
size, codec, fps and estimates (owner review 1, R3, decisions 1, 2 and 12).
Its menu is rebuilt every time it opens. Top to bottom it lists:
- Recommended, the batch and up to three recent presets (taken from the
  render history);
- Other presets, grouped by Video, Social, Intermediate, Sequence and Web,
  each entry with a details line;
- Render batch, Add to queue, Save frame (PNG, JPEG or TIFF 16-bit) and
  Videos.
SplitButton learns hierarchical, two-line menu entries.

Still jobs come from EditorSession.StillRequests and carry the frame index
and the photo hash. Save frame stays disabled, with the reason in its
tooltip, in these cases:
- the sequence is read-only;
- there is no renderable frame;
- the server is older than settings format 3;
- the project is a workspace one, which has no still route yet (the
  IProjectStills hook is left for it).
A playback render is now gated on the format of the job's own export.
The project menu gains "Save project file".

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 02:18:24 +01:00
1 parent d472dfdec1
commit 7701fcac3e
9 files changed
+1137 -29

No files matched your search

+21
View File
@@ -5,8 +5,11 @@ using System.Text.Json;
using Chronos.Core.Diagnostics;
using Chronos.Core.Localization;
using Chronos.Core.Model;
using Chronos.Core.Project;
using Chronos.Core.Render;
using Chronos.Data.Archiving.Jobs;
using Chronos.Data.Jobs;
using Chronos.Data.Processing;
using Chronos.Protocol;
using Chronos.Protocol.Client;
@@ -63,6 +66,24 @@ internal sealed class ServerJobs : IAsyncDisposable
/// </summary>
public static string? NeedsNewerServer(int required, int serverFormat) => required > serverFormat ? Loc.L("Tooltips.Server.NeedsNewerServer") : null;
/// <summary>
/// Why a render of <paramref name="export"/> with <paramref name="settings"/> cannot go to a server that reads
/// <paramref name="serverFormat"/> (owner review 1, phase 5: playback needs format 3); null when it can. The format is the
/// one of the job's own export, its playback included, never the project's export alone (<see cref="ProcessingJobs.RequiredFormat"/>).
/// </summary>
public static string? RenderNeedsNewerServer(ProjectSettings settings, ExportSettings export, int sourceWidth, int sourceHeight, int serverFormat)
{
ArgumentNullException.ThrowIfNull(settings);
ArgumentNullException.ThrowIfNull(export);
return NeedsNewerServer(ProcessingJobs.RequiredFormat(settings with { Export = export }, export, sourceWidth, sourceHeight), serverFormat);
}
/// <summary>
/// Why "Save frame" cannot go to a server that reads <paramref name="serverFormat"/>: a still job needs
/// <see cref="RenderRules.StillFormat"/>, which an older server's nodes would render as a whole video; null when it can.
/// </summary>
public static string? StillNeedsNewerServer(int serverFormat) => NeedsNewerServer(RenderRules.StillFormat, serverFormat);
/// <summary>Queues <paramref name="request"/> on the server (its priority set after, when it is not the user's); returns the job id.</summary>
/// <exception cref="EditorException">The sequence is gone from the server.</exception>
public async Task<Guid> SubmitAsync(ArchiveJobRequest request, CancellationToken cancellationToken)