Profile editor - Fix auto-saving, failing commands, suspended editing and smaller editor issues

- A failed auto-save no longer stops auto-saving for the rest of the session
- A failing command is no longer also reported to ReactiveUI as unhandled, on top of the error dialog
- Resuming editing applies the editor's time again right away
- Nothing is focused while editing is suspended
- A layer created on another layer gets a name that isn't in use next to it
- CanUndo and CanRedo start out false, so new subscribers know the state right away
- An empty command scope doesn't add an undo step
- New subscribers to History get the current history once
- Expanding the keyframe selection with an already selected keyframe doesn't add it twice
- Snapping can snap to a snap time of zero
This commit is contained in:
RobertBeekman committed 2026-10-20 09:47:43 +02:00
1 parent 0920cf8917
commit 55dc04163c
8 files changed
+60 -62

No files matched your search

@@ -131,7 +131,7 @@ public class ProfileEditorTimeTests : ProfileEditorTestBase
}
[Fact]
public async Task ResumingEditing_TakesBackControlButLeavesTheTimelinesAtTheStart()
public async Task ResumingEditing_TakesBackControlAndAppliesTheTime()
{
Layer layer = AddLayer("Layer", null, LedId.Keyboard_A);
await StartEditing();
@@ -142,13 +142,7 @@ public class ProfileEditorTimeTests : ProfileEditorTestBase
Current(Service.SuspendedEditing).ShouldBeFalse();
ProfileService.UpdateFocusProfile.ShouldBeFalse();
// Pinned as-is: resuming calls Tick to apply the editor's time again, but does so before marking editing as
// resumed, and Tick skips suspended editing. So the profile stays where suspending left it (at the start) until
// the time changes, while the editor shows 2 seconds
layer.Timeline.Position.ShouldBe(TimeSpan.Zero);
Current(Service.Time).ShouldBe(TimeSpan.FromSeconds(2));
Service.ChangeTime(TimeSpan.FromSeconds(2));
layer.Timeline.Position.ShouldBe(TimeSpan.FromSeconds(2));
}