From ee8ab9f6a03e41a033fcdc8a097f4791a4a0c3ea Mon Sep 17 00:00:00 2001 From: lizschwab Date: Fri, 3 Apr 2026 14:17:48 -0700 Subject: [PATCH 1/3] fix: add group when cutting workspace comments --- packages/blockly/core/shortcut_items.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/blockly/core/shortcut_items.ts b/packages/blockly/core/shortcut_items.ts index caa8ea84c9d..4fec26c9226 100644 --- a/packages/blockly/core/shortcut_items.ts +++ b/packages/blockly/core/shortcut_items.ts @@ -217,7 +217,9 @@ export function registerCut() { if (focused instanceof BlockSvg) { focused.checkAndDelete(); } else if (isIDeletable(focused)) { + eventUtils.setGroup(true); focused.dispose(); + eventUtils.setGroup(true); } return !!copyData; }, From a85ed4d3f61b4ebb155b6d2160f1ed314b0b5fe7 Mon Sep 17 00:00:00 2001 From: lizschwab Date: Mon, 6 Apr 2026 08:49:54 -0700 Subject: [PATCH 2/3] Update shortcut_items.ts --- packages/blockly/core/shortcut_items.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blockly/core/shortcut_items.ts b/packages/blockly/core/shortcut_items.ts index 4fec26c9226..3e3e3c9e4ed 100644 --- a/packages/blockly/core/shortcut_items.ts +++ b/packages/blockly/core/shortcut_items.ts @@ -219,7 +219,7 @@ export function registerCut() { } else if (isIDeletable(focused)) { eventUtils.setGroup(true); focused.dispose(); - eventUtils.setGroup(true); + eventUtils.setGroup(false); } return !!copyData; }, From 556b865fe57a225e26059d9c0dc96dc8b97fd910 Mon Sep 17 00:00:00 2001 From: lizschwab Date: Mon, 6 Apr 2026 14:48:25 -0700 Subject: [PATCH 3/3] added check for group to the cut workspace comment unit test --- packages/blockly/tests/mocha/shortcut_items_test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/blockly/tests/mocha/shortcut_items_test.js b/packages/blockly/tests/mocha/shortcut_items_test.js index 99c7bd4d0f9..0a42c41ba7f 100644 --- a/packages/blockly/tests/mocha/shortcut_items_test.js +++ b/packages/blockly/tests/mocha/shortcut_items_test.js @@ -295,6 +295,11 @@ suite('Keyboard Shortcut Items', function () { this.disposeSpy = sinon.spy(this.comment, 'dispose'); this.injectionDiv.dispatchEvent(keyEvent); + + const deleteEvents = this.workspace + .getUndoStack() + .filter((e) => e.type === 'comment_delete'); + assert(deleteEvents[0].group !== ''); // Group string is not empty sinon.assert.calledOnce(this.copySpy); sinon.assert.calledOnce(this.disposeSpy); });