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
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:
1 parent
db389a54f2
commit
188b2c2e55
355 files changed
+10549
-1061
No files matched your search
@@ -108,7 +108,7 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
_source = source;
|
||||
_session = session;
|
||||
_ui = ui;
|
||||
_sync = new AsyncRelayCommand(() => SyncAsync(), () => !_isSyncing);
|
||||
_sync = new AsyncRelayCommand(() => SyncAsync(), () => !_isSyncing && PushBlockedReason is null);
|
||||
_updateMedia = new AsyncRelayCommand(UpdateMediaAsync, () => _copyJob == Guid.Empty);
|
||||
SaveVersionCommand = new RelayCommand(OpenSaveVersion, () => CanSaveVersion);
|
||||
HistoryCommand = new AsyncRelayCommand(OpenHistoryAsync);
|
||||
@@ -146,6 +146,20 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
|
||||
public string StateToolTip => WorkspaceText.StateToolTip(_status, _isSyncing, IsServerHome);
|
||||
|
||||
/// <summary>
|
||||
/// Why the project cannot be sent to its server now (owner review 1, phase 4): its settings are of a format the server
|
||||
/// does not read (an older Chronos Server, which would refuse them); null when they can, and for a project of this PC's
|
||||
/// archive. What a sync sends decides: the working state and every local version not sent yet (one saved with a turn the
|
||||
/// working state no longer has still needs it). Sync is disabled with this as its tooltip, and a render of the server's
|
||||
/// is held; the workspace itself never sends such a version (<see cref="WorkspaceSyncException.HomeReadsOlderFormat"/>).
|
||||
/// </summary>
|
||||
public string? PushBlockedReason => IsServerHome && _source.Workspace is { } workspace && _host.HomeOf(workspace.Home) is { } home
|
||||
? ServerJobs.NeedsNewerServer(int.Max(_session.Project.WrittenFormat, _status?.UnpushedFormat ?? 0), home.SettingsFormat)
|
||||
: null;
|
||||
|
||||
/// <summary>Sync in the menu: why it is disabled, else where the project stands.</summary>
|
||||
public string SyncToolTip => PushBlockedReason ?? StateToolTip;
|
||||
|
||||
/// <summary>The ▾ button: its name, then where the project stands, then what the menu holds.</summary>
|
||||
public string MenuToolTip => Loc.L("Tooltips.Editor.Project.Menu", Name, StateText);
|
||||
|
||||
@@ -270,6 +284,12 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
if (_host.Settings.WorkspaceVersionOnRender && !await SaveForRenderAsync()) return false;
|
||||
// Rendered on this PC from the originals the workspace holds (phase 5c): the project renders as it is.
|
||||
if (!IsServerHome || _source.RendersLocally) return true;
|
||||
// Settings the server cannot read are neither sent nor rendered there (owner review 1, phase 4: an older server).
|
||||
if (PushBlockedReason is { } newer)
|
||||
{
|
||||
_ui.Notify(Loc.L("Editor.Workspace.RenderHeld"), newer, isError: true);
|
||||
return false;
|
||||
}
|
||||
await StoreEditAsync();
|
||||
var status = await _host.StatusAsync(ProjectId);
|
||||
if (_disposed) return false;
|
||||
@@ -386,6 +406,12 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
public async Task SyncAsync(bool quiet = false)
|
||||
{
|
||||
if (_isSyncing) return;
|
||||
// Settings the server cannot read stay here until it is updated (owner review 1, phase 4): Sync says why.
|
||||
if (PushBlockedReason is { } newer)
|
||||
{
|
||||
if (!quiet) _ui.Notify(Loc.L("Editor.Workspace.NotSent"), newer, isError: true);
|
||||
return;
|
||||
}
|
||||
SetSyncing(true);
|
||||
try
|
||||
{
|
||||
@@ -534,7 +560,7 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
{
|
||||
await StoreEditAsync();
|
||||
var history = await _host.HistoryAsync(ProjectId, Math.Max(50, _host.Settings.WorkspaceKeptVersions));
|
||||
dialog.Show(history, ProjectContent.Hash(ProjectContent.ToPortable(_session.Project, _source.Photos)));
|
||||
dialog.Show(history, ProjectContent.ToPortable(_session.Project, _source.Photos));
|
||||
}
|
||||
catch (Exception ex) when (ex is not OutOfMemoryException)
|
||||
{
|
||||
@@ -1026,6 +1052,8 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
OnPropertyChanged(nameof(StateText));
|
||||
OnPropertyChanged(nameof(StateKind));
|
||||
OnPropertyChanged(nameof(StateToolTip));
|
||||
OnPropertyChanged(nameof(PushBlockedReason));
|
||||
OnPropertyChanged(nameof(SyncToolTip));
|
||||
OnPropertyChanged(nameof(MenuToolTip));
|
||||
OnPropertyChanged(nameof(MenuName));
|
||||
OnPropertyChanged(nameof(HasMediaUpdate));
|
||||
@@ -1044,6 +1072,7 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
|
||||
OnPropertyChanged(nameof(CopyOriginalsToolTip));
|
||||
OnPropertyChanged(nameof(ProxiesOnlyToolTip));
|
||||
_updateMedia.RaiseCanExecuteChanged();
|
||||
_sync.RaiseCanExecuteChanged();
|
||||
CommandManager.InvalidateRequerySuggested();
|
||||
}
|
||||
}
|
||||
@@ -472,14 +472,17 @@ public sealed class HistoryDialogViewModel : ArchiveDialogViewModel
|
||||
|
||||
public IReadOnlyList<string> Compared { get => _compared; private set => Set(ref _compared, value); }
|
||||
|
||||
/// <summary>Lists <paramref name="history"/>; <paramref name="currentHash"/> marks the version the project is now.</summary>
|
||||
public void Show(WorkspaceHistory history, string? currentHash)
|
||||
/// <summary>
|
||||
/// Lists <paramref name="history"/>; <paramref name="currentPortable"/>, the project's portable text now, marks the version
|
||||
/// holding it (whatever line ends that version was saved with).
|
||||
/// </summary>
|
||||
public void Show(WorkspaceHistory history, string? currentPortable)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(history);
|
||||
Rows.Clear();
|
||||
foreach (var version in history.Versions)
|
||||
{
|
||||
var current = currentHash is not null && string.Equals(version.ContentHash, currentHash, StringComparison.OrdinalIgnoreCase);
|
||||
var current = currentPortable is not null && ProjectContent.MatchesHash(currentPortable, version.ContentHash);
|
||||
Rows.Add(new HistoryRowViewModel(version, history.Unsent.Contains(version.Id), current,
|
||||
new AsyncRelayCommand(() => CompareAsync(version), () => !IsBusy), new AsyncRelayCommand(() => RestoreAsync(version), () => !IsBusy), _server));
|
||||
}
|
||||
|
||||
@@ -133,6 +133,8 @@ public static class WorkspaceText
|
||||
// A version over the size one may be: saved here (refused before anything was written) or sent (the home stored nothing).
|
||||
ProjectVersionTooLargeException or WorkspaceSyncException { Outcome: PushOutcome.TooLarge } =>
|
||||
ForHome("Errors.Workspace.VersionTooLarge", server, ProjectSidecars.MaxVersionBytes >> 20),
|
||||
// A home that reads an older settings format (an older Chronos Server; owner review 1, phase 4): nothing was sent.
|
||||
WorkspaceSyncException { HomeReadsOlderFormat: true } => Loc.L("Tooltips.Server.NeedsNewerServer"),
|
||||
WorkspaceSyncException => ForHome("Errors.Workspace.Refused", server),
|
||||
// A server's refusal that keeps its meaning: an account that may not change projects there, above all.
|
||||
ChronosApiException { Status: HttpStatusCode.Forbidden } => Loc.L("Errors.Workspace.Forbidden"),
|
||||
|
||||
Reference in new issue
Block a user