Skip to content

Conversation

@RoboErikG
Copy link
Contributor

@RoboErikG RoboErikG commented Feb 19, 2025

The basics

The details

Resolves

Fixes #8764

Proposed Changes

Moves the event group management up to dragger.ts instead of being handled in the various *_drag_strategy.ts files. Conceptually, this makes it the responsibility of the top level dragger to manage event groups and ensures that the group wraps all side effects of the drag.

In vanilla Blockly this shouldn't have any effect, but is necessary for the multi-select plugin used by AppInventor.

Also fixes a bug where snapping to the grid adds a move event that isn't part of the group.

Reason for Changes

AppInventor has a multi-select plugin that creates multiple BlockDragStrategy instances. This requires that endDrag be called on each one, which was causing the event group to be reset after the first one. Moving it up a level ensures all of the block drags finish before the event group is reset.

Test Coverage

Screen.recording.2025-02-19.12.39.26.PM.webm

Documentation

No documentation changes, but we should include it in the release notes that the behavior has changed and anyone overriding dragger.ts should make this change if they aren't calling through to the super.

Additional Information

@RoboErikG RoboErikG requested a review from a team as a code owner February 19, 2025 21:30
@RoboErikG RoboErikG requested a review from gonfunko February 19, 2025 21:30
@RoboErikG RoboErikG changed the title Fix #8764 by moving the event grouping calls up to dragger.ts fix: Fixes #8764 by moving the event grouping calls up to dragger.ts Feb 19, 2025
@github-actions github-actions bot added the PR: fix Fixes a bug label Feb 19, 2025
@RoboErikG
Copy link
Contributor Author

The failing test is the flakey connection test which was fixed in develop but hasn't been merged into V12 yet.

@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Feb 19, 2025
@RoboErikG RoboErikG merged commit b343a13 into RaspberryPiFoundation:rc/v12.0.0 Feb 20, 2025
7 of 8 checks passed
@RoboErikG RoboErikG deleted the undo-groups branch March 26, 2025 17:34
@RoboErikG RoboErikG added the breaking change Used to mark a PR or issue that changes our public APIs. label Mar 31, 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: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants