fix: add group when cutting workspace comments (#9680)

* fix: add group when cutting workspace comments

* Update shortcut_items.ts

* added check for group to the cut workspace comment unit test
This commit is contained in:
lizschwab
2026-04-07 13:50:28 -07:00
committed by GitHub
parent 0bdae1497b
commit 61583fff31
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -217,7 +217,9 @@ export function registerCut() {
if (focused instanceof BlockSvg) {
focused.checkAndDelete();
} else if (isIDeletable(focused)) {
eventUtils.setGroup(true);
focused.dispose();
eventUtils.setGroup(false);
}
return !!copyData;
},
@@ -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);
});