feat(editor): visual crop, rotate/mirror/flip/straighten, colour looks (owner review 1 phase 4) (#26)
CI / Build and test (push) Successful in 8m19s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 12m9s
CI / PostgreSQL 16 integration (push) Successful in 7m49s
CI / PostgreSQL 17 integration (push) Successful in 7m19s
CI / Docker image (push) Successful in 46s
Release / Server image (push) Successful in 1m14s

Owner review 1 R5 + R6. Camera rotation, mirror, flip, straighten and crop handles locked to the output; an Exposure Look group; Export output size ("proportions win"); settings format 2 with older-node gates. Also fixes project text and hashes differing between Windows and Linux.

Closes #19
Closes #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #26.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-11-05 01:09:09 +01:00
1 parent db389a54f2
commit 188b2c2e55
355 files changed
+10549 -1061

No files matched your search

+64 -1
View File
@@ -1,6 +1,7 @@
using System.Globalization;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
@@ -13,6 +14,7 @@ using Chronos.App.Library;
using Chronos.App.Server;
using Chronos.App.Settings;
using Chronos.Core.Diagnostics;
using Chronos.Core.Imaging.Geometry;
using Chronos.Ui.Controls;
using Chronos.Ui.Theming;
@@ -249,7 +251,7 @@ public static class ScreenCapture
/// The editor on the synthetic sunset: every step of the Edit path in both themes (<c>edit-&lt;step&gt;-&lt;theme&gt;.png</c>,
/// the Camera step with a keyframe selected, the Export step as Export.html with the crop mask and no compare), then
/// the preview overlays, the waveform, the "what changed" toast of Optimise all, the picker over the open sequence
/// (<c>edit-change</c>), the Export step of the sequence once the server has it (Sync on) with two "Save both" copies
/// (<c>edit-change</c>), the crop box, straighten and look scenes (<see cref="CaptureFramingAsync"/>), the Export step of the sequence once the server has it (Sync on) with two "Save both" copies
/// to restore, and the Analysis step while the analysis runs (<c>edit-busy</c>).
/// </summary>
private static async Task<int> CaptureEditorAsync(MainWindow window, ShellViewModel shell, SampleData sample, string directory)
@@ -295,6 +297,7 @@ public static class ScreenCapture
written += await SaveAsync(window, directory, "edit-change", theme, waitForThumbnails: shell);
shell.Sequence.CancelPickCommand.Execute(null);
}
written += await CaptureFramingAsync(window, editor, directory);
// The server has the sequence (Sync can be ticked) and two copies of this PC's settings were kept by "Save both".
await sample.KeepEditorCopiesAsync(id);
@@ -329,6 +332,66 @@ public static class ScreenCapture
return written;
}
/// <summary>
/// The framing and look of owner review 1 (R5/R6) in both themes, each undone after: the Camera step with a 9:16 crop
/// box moved off centre and its handles (<c>edit-camera-crop</c>); the same view turned right and straightened 3° with
/// the straighten grid (<c>edit-camera-straighten</c>); the Exposure step with the Sepia look at 60 % and the compare
/// wipe (<c>edit-exposure-look</c>).
/// </summary>
private static async Task<int> CaptureFramingAsync(MainWindow window, EditorViewModel editor, string directory)
{
var written = 0;
var session = editor.Session;
var camera = editor.Tabs.OfType<CameraTab>().Single();
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
editor.SelectedTab = camera;
editor.IsCompare = false;
editor.CurrentIndex = 45;
var steps = 0;
if (session.Edit(p => SampleData.PortraitCrop(session, p))) steps++;
written += await SaveEditorAsync(window, editor, directory, "edit-camera-crop", theme);
if (session.Orient(OrientationOp.RotateRight)) steps++;
if (session.Edit(SampleData.Straightened)) steps++;
editor.IsStraightening = true;
written += await SaveEditorAsync(window, editor, directory, "edit-camera-straighten", theme);
editor.IsStraightening = false;
for (; steps > 0; steps--) session.Undo();
editor.SelectedTab = editor.Exposure;
editor.IsCompare = true;
var look = session.Edit(SampleData.SepiaLook);
await Settle(window);
// The Look group sits at the end of the step's rows: the panel is scrolled down to it.
var panel = ScrollerOf<GroupRow>(window);
panel?.ScrollToBottom();
written += await SaveEditorAsync(window, editor, directory, "edit-exposure-look", theme);
panel?.ScrollToTop();
if (look) session.Undo();
}
return written;
}
/// <summary>The scroll viewer around the shown row whose data is a <typeparamref name="TRow"/>; null when none is shown.</summary>
private static ScrollViewer? ScrollerOf<TRow>(DependencyObject root)
{
var pending = new Stack<DependencyObject>([root]);
while (pending.Count > 0)
{
var node = pending.Pop();
if (node is FrameworkElement { DataContext: TRow, IsVisible: true } row)
{
for (DependencyObject? up = row; up is not null; up = VisualTreeHelper.GetParent(up))
if (up is ScrollViewer scroller) return scroller;
return null;
}
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(node); i++) pending.Push(VisualTreeHelper.GetChild(node, i));
}
return null;
}
/// <summary>
/// The Library, the editor's Exposure tab and the import plan in Arabic, dark: the layout mirrors while photos,
/// charts, the filmstrip and templates stay left to right. English is restored whatever happens.