Repository navigation
fix(varmodel): keep the new data variable form open on invalid input - #200
Merged
Merged
Conversation
uiCreateDataVariableFromFile checked the entered values after the window had closed and reopened the form in a loop until they were valid. A name already in use passed those checks and was refused later by insertItem, after the form had closed, so the entered values were lost. The form now passes a ValidationFcn, so it stays open and shows the reasons at Save. The check also refuses a name the model already contains, and reports problems with the name and the file name expression together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
uiCreateDataVariableFromFilechecks the entered values aftertools.editStructhas returned and reopens the form in a loop until they are valid. A name that is already in use passes those checks.VariableModel.insertItemrefuses it after the form has closed, so the entered values are lost.Changes:
ValidationFcn(feat(structeditor): let ValidationFcn refuse to save entered values #182), so it stays open and shows the reason at Save. The reopen loop is removed.isvarname, a name the variable model already contains, and a file name expression that is empty or does not match the file.CreateDataVariableDialogTestcovers the check and the output of the form, in a temporary project with a stub oftools.editStruct.All of these problems now appear in an error dialog titled "Invalid Input".
Closes #199
🤖 Generated with Claude Code