feat: Add a sound effect when dropping top-level items on the workspace (#9784)

This commit is contained in:
Aaron Dodson
2026-04-30 13:30:12 -07:00
committed by GitHub
parent 9a01417400
commit 71ca797dcb
4 changed files with 6 additions and 0 deletions
@@ -786,6 +786,10 @@ export class BlockDragStrategy implements IDragStrategy {
this.applyConnections(this.connectionCandidate);
this.disposeStep();
} else {
// play a sound if the block didn't connect to anything and isn't being deleted
if (disposition !== DragDisposition.DELETE) {
this.workspace.getAudioManager().play('drop');
}
this.block.queueRender().then(() => this.disposeStep());
}
@@ -50,6 +50,7 @@ export class CommentDragStrategy implements IDragStrategy {
this.workspace
.getLayerManager()
?.moveOffDragLayer(this.comment, layers.BLOCK);
this.workspace.getAudioManager().play('drop');
this.comment.setDragging(false);
this.comment.snapToGrid();
+1
View File
@@ -333,4 +333,5 @@ function loadSounds(pathToMedia: string, workspace: WorkspaceSvg) {
audioMgr.load([`${pathToMedia}click.mp3`], 'click');
audioMgr.load([`${pathToMedia}disconnect.mp3`], 'disconnect');
audioMgr.load([`${pathToMedia}delete.mp3`], 'delete');
audioMgr.load([`${pathToMedia}drop.mp3`], 'drop');
}
Binary file not shown.