Closed bassmanitram closed 1 year ago
The problem is (still) in the "min_items/max_items" cross-property validator - it corrupts the model as items are moved. This is likely because it is called on every change to the model, not just at the end of a set of changes.
I was trying to be too "fine-grained" with the consistency checks! EVERY part of the model is presented to the validator, so rather than address the min and max properties individually, we can just wait until the "Basic" block of a command action is presented as a whole and then check it - this avoids having to introspect the editors and reduces the check to on (albeit long) if statement.
This tackles the persistent problem but it leaves one problem that I can't quite get a handle on yet - when you move a command action that is in error (particularly, has the min/max inconsistency) "past" a menu item, the command action in error becomes a menu action - with even more errors! I'll tackle this problem in a separate issue.
OK, I take that back - another tweak to the condition for the check - making it more targetted - fixes the "moving action-in-error" issue too. I think we're good to go!
Difficult to reproduce, but for me when I deleted a command action a menu action further down the list was interpreted as a command action and lost all its submenu configuration as well as being marked invalid.
Workaround - use the JSON editor to handle this kind of thing until a fix is available.