mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-20 18:07:43 -05:00
fix: enforce sentinel reactively in OnPlateAdded/OnPlateRemoved
Without this, RemoveEmptyPlates would destroy the sentinel with no recovery, and tail-plate subscriptions would go stale after plate list mutations. Added tests for both scenarios. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
51eea6d1e6
commit
ede06b1bf6
2 files changed
+50
-1
No files matched your search
@@ -198,6 +198,9 @@ namespace OpenNest
|
||||
|
||||
private void OnPlateAdded(object sender, ItemAddedEventArgs<Plate> e)
|
||||
{
|
||||
if (!suppressNavigation && !batching)
|
||||
EnsureSentinel();
|
||||
|
||||
PlateListChanged?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
if (!suppressNavigation)
|
||||
@@ -212,6 +215,9 @@ namespace OpenNest
|
||||
if (CurrentIndex >= Count && Count > 0)
|
||||
CurrentIndex = Count - 1;
|
||||
|
||||
if (!suppressNavigation && !batching)
|
||||
EnsureSentinel();
|
||||
|
||||
PlateListChanged?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
if (!suppressNavigation)
|
||||
|
||||
Reference in new issue
Block a user