fix: restore auto-navigation on plate add in PlateManager

OnPlateAdded now navigates to the new plate when suppressNavigation is
false, matching the original EditNestForm behavior. Fixed CanRemoveCurrent
test to account for this auto-navigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 23:52:32 -04:00
parent d93b69c524
commit d12f0cee3e
2 changed files with 8 additions and 0 deletions

View File

@@ -199,6 +199,12 @@ namespace OpenNest
private void OnPlateAdded(object sender, ItemAddedEventArgs<Plate> e)
{
PlateListChanged?.Invoke(this, EventArgs.Empty);
if (!suppressNavigation)
{
CurrentIndex = Count - 1;
FireCurrentPlateChanged();
}
}
private void OnPlateRemoved(object sender, ItemRemovedEventArgs<Plate> e)

View File

@@ -390,6 +390,8 @@ public class PlateManagerTests
Assert.False(mgr.CanRemoveCurrent);
nest.CreatePlate();
// Auto-navigated to plate2 (empty), go back to plate1 (has parts)
mgr.LoadFirst();
Assert.True(mgr.CanRemoveCurrent);
}
}