Skip to content

Conversation

@BeksOmega
Copy link
Contributor

@BeksOmega BeksOmega commented Apr 2, 2024

The basics

The details

Resolves

Fixes N/A

Proposed Changes + reasons

Makes it so the gesture class looks at whatever is selected when it starts a drag. This will allow the multi select plugin to provide its own draggable for when multiple things are selected.

Test Coverage

Manually tested and everything seems to be working! But this could definitely use some hammering.

  • Dragging blocks
  • Dragging child blocks
  • Dragging the workspace
  • Dragging flyouts
  • Dragging blocks from the flyout
  • Dragging on child blocks in the flyout
  • Dragging blocks in mutators

Documentation

N/A

Additional Information

N/A

Breaking changes / To fix

This reverses the responsibility of the Blockly.common.setSelected and the someElement.select methods. If you were calling select or unselect you should instead call Blockly.common.setSelected(some element) and Blockly.common.setSelected(null) respectively.

@github-actions github-actions bot added PR: feature Adds a feature and removed PR: feature Adds a feature labels Apr 2, 2024
@BeksOmega BeksOmega changed the title feat: change gestures to look at selected when dragging feat!: change gestures to look at selected when dragging Apr 2, 2024
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: feature Adds a feature and removed PR: feature Adds a feature labels Apr 2, 2024
@BeksOmega BeksOmega mentioned this pull request Apr 2, 2024
1 task
return this.style.colourTertiary;
}

// TODO: Before merging, is it better to just remove these or to leave them
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we have to leave these so that the BlockSvg conforms to the ISelectable interface.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have to keep it, please add a description of the breaking change to the PR description (as I understanding, that block.select() and block.unselect() no longer fire events or update the workspace's selected value--they just update the block itself--and that devs need to call common.select to get the old behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna go through and update the PR descriptions in bulk before the release.

@BeksOmega BeksOmega force-pushed the feat/gestures-selected branch from ba804c4 to 3163dc6 Compare April 2, 2024 22:04
@BeksOmega BeksOmega marked this pull request as ready for review April 2, 2024 22:54
@BeksOmega BeksOmega requested a review from a team as a code owner April 2, 2024 22:54
return this.style.colourTertiary;
}

// TODO: Before merging, is it better to just remove these or to leave them
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have to keep it, please add a description of the breaking change to the PR description (as I understanding, that block.select() and block.unselect() no longer fire events or update the workspace's selected value--they just update the block itself--and that devs need to call common.select to get the old behaviour.

@BeksOmega BeksOmega merged commit ed403d0 into RaspberryPiFoundation:rc/v11.0.0 Apr 4, 2024
johnnesky pushed a commit to johnnesky/blockly that referenced this pull request Apr 13, 2024
…Foundation#7991)

* feat: change gestures to look at selected when dragging

* chore: fix tests

* chore: format

* chore: PR comments
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: feature Adds a feature and removed PR: feature Adds a feature breaking change Used to mark a PR or issue that changes our public APIs. labels Apr 19, 2024
mjgallag added a commit to mit-cml/blockly-plugins that referenced this pull request Sep 17, 2025
mark-friedman pushed a commit to mit-cml/blockly-plugins that referenced this pull request Sep 17, 2025
* Change BlockSvg.select to Blockly.common.setSelected

RaspberryPiFoundation/blockly#7991

* Enable Highlight Procedure

* Change method name to conform with current Blockly and App Inventor
mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Sep 19, 2025
mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Oct 16, 2025
mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Oct 16, 2025
mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Nov 6, 2025
mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Nov 20, 2025
mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Used to mark a PR or issue that changes our public APIs. PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants