Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow Block Converter Plugin Parent Block Visual Selection Bug #2426

Closed
1 task done
changminbark opened this issue Jul 30, 2024 · 7 comments · Fixed by #2457
Closed
1 task done

Shadow Block Converter Plugin Parent Block Visual Selection Bug #2426

changminbark opened this issue Jul 30, 2024 · 7 comments · Fixed by #2457
Assignees
Labels
type: bug Something isn't working

Comments

@changminbark
Copy link
Contributor

Check for duplicates

  • 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

shadowblock_converter

@cpcallen
Copy link
Contributor

cpcallen commented Aug 2, 2024

@johnnesky: Would you like to take a look at this?

@cpcallen cpcallen removed the triage label Aug 2, 2024
@johnnesky
Copy link
Member

Sure!

@johnnesky johnnesky self-assigned this Aug 2, 2024
@johnnesky
Copy link
Member

johnnesky commented Aug 2, 2024

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?

Screen.Recording.2024-08-02.at.11.00.03.AM.mov

@changminbark
Copy link
Contributor Author

@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:
image
image
image

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!

@johnnesky
Copy link
Member

johnnesky commented Aug 9, 2024

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.

@johnnesky
Copy link
Member

johnnesky commented Aug 9, 2024

I believe the bug was a side effect of: google/blockly#8172

@johnnesky
Copy link
Member

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants