fix(reorder): save layer list AND preview layout immediately at drop; recording save dialog +10% (276→304)

Reorder: OnSceneElementsReordered now calls SaveLayoutNow() (was debounced
ScheduleSave) so a drag-drop persists instantly — one write stores the new
layer list (Source.SortOrder) and each layer's preview geometry (X/Y/W/H) in
the same rows. Reference: WPF ListBox drag-reorder requires an explicit persist
at drop; a debounce window lets a crash lose the drop.

Recording save dialog (RenameRecordingDialog.xaml): height 276→304 so the
Cancel/Save button row is no longer obscured; Save button named
SaveRecordingButton so the sizing test can assert it sits inside the client area.

Tests: deterministic seam test now asserts the dragged layer's geometry (preview
layout) is persisted with the new order; sizing test asserts 304 + textbox and
button-row bottoms within client area. 308/308 green.
This commit is contained in:
2026-09-18 10:20:25 -07:00
parent 2ac00db0da
commit f91bf8715d
6 changed files with 107 additions and 30 deletions
+5 -2
View File
@@ -87,11 +87,14 @@ public partial class MainViewModel
/// <summary>Drag-to-reorder in the layer list mutates <see cref="Scene.Elements"/>
/// directly in code-behind, bypassing SceneGraph's mutation surface. Trap it here
/// so the new z-order persists like any other layout change.</summary>
/// so the new z-order persists like any other layout change. Saves IMMEDIATELY at
/// drop — no debounce window — because a reorder is one discrete event: the write
/// stores BOTH the layer list (new SortOrder) and the preview layout (each layer's
/// X/Y/W/H) in the same Source rows.</summary>
public void OnSceneElementsReordered()
{
if (StagedScene != null) _sceneGraph.InvalidateBake(StagedScene);
ScheduleSave();
SaveLayoutNow();
}
// Duplicate resource names get an incrementing suffix with no space: Image,