feat: Play delete sound when workspace comments are deleted (#9776)

* feat: Play delete sound when workspace comments are deleted

* fix: Play delete sound (and no error beep) when cutting workspace comments

* fix: Play delete sound when deleting comments via the context menu
This commit is contained in:
Aaron Dodson
2026-04-29 11:01:25 -07:00
committed by GitHub
parent 61ad99440c
commit adeeb613a4
3 changed files with 6 additions and 0 deletions
@@ -102,5 +102,6 @@ export class DeleteCommentBarButton extends CommentBarButton {
this.getCommentView().dispose();
e?.stopPropagation();
getFocusManager().focusNode(this.workspace);
this.workspace.getAudioManager().play('delete');
}
}
@@ -591,6 +591,7 @@ export function registerCommentDelete() {
eventUtils.setGroup(true);
scope.comment?.dispose();
eventUtils.setGroup(false);
scope.comment?.workspace.getAudioManager().play('delete');
},
scopeType: ContextMenuRegistry.ScopeType.COMMENT,
id: 'commentDelete',
+4
View File
@@ -118,6 +118,7 @@ export function registerDelete() {
eventUtils.setGroup(true);
focused.dispose();
eventUtils.setGroup(false);
workspace.getAudioManager().play('delete');
}
return true;
},
@@ -249,10 +250,13 @@ export function registerCut() {
if (focused instanceof BlockSvg) {
focused.checkAndDelete();
e.preventDefault();
} else if (isIDeletable(focused)) {
eventUtils.setGroup(true);
focused.dispose();
eventUtils.setGroup(false);
workspace.getAudioManager().play('delete');
e.preventDefault();
}
return !!copyData;
},