Shadow Block Converter Plugin Parent Block Visual Selection Bug
Check for duplicates
- [X] I have searched for similar issues before opening a new one.
Component
Shadow Block Converter Plugin
Description
I think that I've come across a bug where editing a shadow block will select the parent block (at least visually). However, when trying to select something else (like a block or the workspace), the former shadow block's parent block does not get unselected (visually). This was tested without any of the other plugins (except for backpack). I will report this on the Blockly plugins github page. Look at the gif below for reference.
Reproduction steps
Stack trace
No response
Screenshots
@johnnesky: Would you like to take a look at this?
Sure!
Hm, I'm having trouble replicating the problem at the shadow block converter demo page. @changminbark, can you share more information? What version of Blockly are you using? Do you have any of your own customizations we should know about? Is there a public demo we can try?
https://github.com/user-attachments/assets/f1e053ad-0b9f-4e4e-9aa9-9b4131f1d250
@johnnesky
Hello! I am currently testing this on Blockly v11.1.1. Below is my package.json file.
{
"name": "@mit-app-inventor/blockly-plugin-workspace-multiselect",
"version": "1.0.0",
"description": "A Blockly plugin that allows to drag, select and doing actions on multiple blocks in the workspace.",
"scripts": {
"audit:fix": "blockly-scripts auditFix",
"build": "blockly-scripts build",
"clean": "blockly-scripts clean",
"lint": "eslint . --fix",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
"main": "./dist/index.js",
"module": "./src/index.js",
"unpkg": "./dist/index.js",
"author": "Songlin Jiang",
"keywords": [
"blockly",
"blockly-plugin",
"workspace-multiselect"
],
"homepage": "https://github.com/mit-cml/workspace-multiselect/#readme",
"bugs": {
"url": "https://github.com/mit-cml/workspace-multiselect/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/mit-cml/workspace-multiselect.git"
},
"license": "Apache-2.0",
"directories": {
"dist": "dist",
"src": "src"
},
"files": [
"dist",
"src"
],
"dependencies": {
"@blockly/disable-top-blocks": "^0.5.6",
"@blockly/keyboard-navigation": "^0.6.4",
"@blockly/shadow-block-converter": "^6.0.5",
"@blockly/workspace-content-highlight": "^5.0.5",
"dragselect": "^2.7.4"
},
"devDependencies": {
"@blockly/dev-scripts": "^4.0.1",
"@blockly/dev-tools": "^8.0.2",
"@blockly/workspace-backpack": "^6.0.2",
"blockly": "^11.1.1"
},
"peerDependencies": {
"blockly": ">=11"
},
"publishConfig": {},
"eslintConfig": {
"extends": "@blockly/eslint-config"
},
"engines": {
"node": ">=8.17.0"
},
"browserslist": [
"defaults"
]
}
My index.js file is also shown below:
As for a public demo, you can try cloning this branch and running npm i and npm start to test things out: https://github.com/changminbark/workspace-multiselect/tree/test-plugins
Let me know if you have any other questions. Thank you!
It turns out that I'm able to replicate the bug inside the shadow-block-converter plugin demo page by updating the dependency on core Blockly from 11.0.0 to 11.1.1. Will investigate.
EDIT: The bug is also present in 11.1.0.
I believe the bug was a side effect of: https://github.com/google/blockly/pull/8172
If I revert the changes related to getFirstNonShadowBlock() in core/block.ts and core/gesture.ts from https://github.com/google/blockly/pull/8172/files then this issue is fixed. However, I don't know what the original purpose of these changes was, so I'll wait until someone else from the Blockly team weighs in. @BeksOmega ?