feat(editor): accounts without the Edit right open server sequences read-only

The Server screen offers Open with proxies to viewers; the editor now shows the
sequence with every change disabled and the reason in the tooltips, the session
refuses edits, undo and Optimise, and the source refuses to store a change.
Render says when the account may not render on the server. The event listener
stops cleanly when the editor closes and a late progress event no longer
brings a finished job back to running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-03 16:43:47 +00:00
1 parent 51fb84700e
commit 9cbfaae10d
17 files changed
+151 -67

No files matched your search

+20 -11
View File
@@ -86,11 +86,11 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
_player.Tick += (_, _) => Advance();
BackCommand = new RelayCommand(() => Shell.Navigate(SectionKey.Library));
_analyse = new AsyncRelayCommand(AnalyseAsync, () => !IsBusy && !IsAnalysing);
OptimiseAllCommand = new RelayCommand(OptimiseAll, () => !IsBusy);
_analyse = new AsyncRelayCommand(AnalyseAsync, () => !IsLocked && !IsAnalysing);
OptimiseAllCommand = new RelayCommand(OptimiseAll, () => !IsLocked);
_render = new AsyncRelayCommand(() => RenderAsync(JobPriority.User, batch: false), () => CanRender);
UndoCommand = new RelayCommand(() => Session.Undo(), () => !IsBusy && Session.History.CanUndo);
RedoCommand = new RelayCommand(() => Session.Redo(), () => !IsBusy && Session.History.CanRedo);
UndoCommand = new RelayCommand(() => Session.Undo(), () => !IsLocked && Session.History.CanUndo);
RedoCommand = new RelayCommand(() => Session.Redo(), () => !IsLocked && Session.History.CanRedo);
PlayCommand = new RelayCommand(() => TogglePlay(limit: 0));
PreviewClipCommand = new RelayCommand(() => TogglePlay(limit: ClipFrames()));
StepBackCommand = new RelayCommand(() => CurrentIndex--);
@@ -337,17 +337,24 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
/// <summary>A deep analysis of this sequence is queued or running (Analyse would queue it twice).</summary>
public bool IsAnalysing => _jobs.Values.Any(j => j.Kind == JobKind.DeepAnalyse);
public bool IsEditable => !IsBusy;
/// <summary>The project is shown, not changed: a server sequence for an account without the Edit right.</summary>
public bool IsReadOnly => Session.IsReadOnly;
public string? BusyToolTip => IsBusy ? Loc.L("Tooltips.Editor.Busy") : null;
/// <summary>Changes to the project wait (a job runs) or are not allowed (<see cref="IsReadOnly"/>); viewing tools stay live.</summary>
public bool IsLocked => IsReadOnly || IsBusy;
public bool IsEditable => !IsLocked;
/// <summary>Why the controls that change the project are disabled; null while they are not.</summary>
public string? LockedToolTip => IsReadOnly ? Loc.L("Tooltips.Editor.ReadOnly") : IsBusy ? Loc.L("Tooltips.Editor.Busy") : null;
/// <summary>What Analyse does and costs ("about 6 min" from the speed of the last analysis), or why it is disabled.</summary>
public string AnalyseToolTip => IsBusy ? Loc.L("Tooltips.Editor.Busy")
: IsAnalysing ? Loc.L("Tooltips.Editor.AnalyseQueued")
public string AnalyseToolTip => LockedToolTip
?? (IsAnalysing ? Loc.L("Tooltips.Editor.AnalyseQueued")
: _analysisSecondsPerFrame is { } perFrame ? Loc.L("Tooltips.Editor.AnalyseCost", Formatting.Duration(TimeSpan.FromSeconds(perFrame * FrameCount)))
: Loc.L("Tooltips.Editor.Analyse");
: Loc.L("Tooltips.Editor.Analyse"));
public string OptimiseAllToolTip => Loc.L(IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.OptimiseAll");
public string OptimiseAllToolTip => LockedToolTip ?? Loc.L("Tooltips.Editor.OptimiseAll");
public bool IsPlaying => _player.IsEnabled;
@@ -384,6 +391,7 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
/// <summary>Why the project's export cannot be rendered now, localised; null when it can.</summary>
public string? RenderBlockedReason => Plan switch
{
_ when IsRemote && !Shell.Services.Sync.CanRender => Loc.L("Tooltips.Editor.Render.NoRight", RemoteText ?? string.Empty),
null when _planned => Loc.L("Tooltips.Editor.Render.NoSource"),
null => Loc.L("Tooltips.Editor.Render.Planning"),
{ NameError: { } error } => Loc.L("Tooltips.Editor.Render.NameError", error),
@@ -865,8 +873,9 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
{
OnPropertyChanged(nameof(IsBusy));
OnPropertyChanged(nameof(IsAnalysing));
OnPropertyChanged(nameof(IsLocked));
OnPropertyChanged(nameof(IsEditable));
OnPropertyChanged(nameof(BusyToolTip));
OnPropertyChanged(nameof(LockedToolTip));
OnPropertyChanged(nameof(AnalyseToolTip));
OnPropertyChanged(nameof(OptimiseAllToolTip));
OnPropertyChanged(nameof(ServerJobText));