openroberta-lab
openroberta-lab copied to clipboard
Blockly name connection not working properly when typing invalid names.
Describe the bug
- When entering an invalid name into the textbox of a sensor or actor that is connected to a action block in the program workspace the last viable text gets added to the list of sensors/actors you can choose in the action blocks drop-down menu.
- this causes more sensors to choose from then there are actually in the configuration To Reproduce Steps to reproduce the behavior:
- Go to Program of a robot using the new config
- pull out an action block that has a variable port field which is connected to the configuration
- pull out the corresponding block in the configuration
- change the name to something invalid and press enter
- switch back to program
- click drop-down of the added block
- see issue
Expected behavior
- when changing T to test....(invalid) test should not be added to the list of available blocks to choose in the program, instead only T should remain in the drop-down menu
Screenshots
Additional context
- I have partially fixed this issue in this(WIP) PR by changing this to: if (dropDown[d].menuGenerator_[i][1] === oldName || subComponentNames.has(dropDown[d].menuGenerator_[i][1])) {
- however this only fixes the issue for every time the name is changed to something invalid except from the original name, which is arguably the most important time.
- this issue seems to be caused by this from the validator of the configuration blocks, removing it resolves the issue completely but i have not looked further into why that causes the issue and why it is needed here.
- Special attention should be payed to the calli:bot which seems to have the most issues regarding this bug