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

fix: Don't clober event group when renaming vars #6829

Merged
merged 3 commits into from
Mar 17, 2023
Merged

Conversation

NeilFraser
Copy link
Contributor

Also audit all existing event group commands and tweak a few of them where I think there's a potential issue.

See https://groups.google.com/g/blockly/c/dKizQbKb8vo

Also audit all existing event group commands and tweak a few of them where I think there's a potential issue.
@NeilFraser NeilFraser requested a review from a team as a code owner February 7, 2023 13:55
@NeilFraser NeilFraser requested a review from gonfunko February 7, 2023 13:55
@github-actions github-actions bot added the PR: fix Fixes a bug label Feb 7, 2023
@@ -279,7 +278,8 @@ export function registerDeleteAll() {
}
scope.workspace.cancelCurrentGesture();
const deletableBlocks = getDeletableBlocks_(scope.workspace);
const eventGroup = idGenerator.genUid();
eventUtils.setGroup(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

If the user chooses cancel on the dialog, deleteNext_ is never run and grouping is never turned off. deleteNext_ was already calling setGroup() with the passed-in ID - why is this change necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This changes eliminates the dependency on idGenerator. It also means that in Blockly there would be only one place which sets eventGroup -- so if we change the group format in the future, we won't need to change it in two places.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, that makes sense; I think the issue about grouping never being turned back off if the user chooses Cancel on the confirmation dialog still stands though.

core/workspace_svg.ts Show resolved Hide resolved
@gonfunko
Copy link
Contributor

Does this also address #1534?

@NeilFraser NeilFraser enabled auto-merge (squash) March 17, 2023 18:54
@NeilFraser NeilFraser merged commit 6f64d18 into develop Mar 17, 2023
@NeilFraser NeilFraser deleted the fraser-eventgroup branch March 21, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants