Skip to content

editor: add resize SFX while dragging resize handles#437

Merged
wass08 merged 1 commit into
mainfrom
feat/resize-sfx
Jun 22, 2026
Merged

editor: add resize SFX while dragging resize handles#437
wass08 merged 1 commit into
mainfrom
feat/resize-sfx

Conversation

@wass08

@wass08 wass08 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds a resize sound effect that plays while dragging a node's resize handles.

  • Registers a resize SFX in sfx-player.ts — three round-robin variations (resize_0/1/2.mp3) with pitch/pan jitter, reduced volume, and an 80ms minimum gap so a sustained drag reads as texture rather than a machine-gun tone (mirrors the gridSnap approach).
  • Adds the sfx:resize event + mapping in sfx-bus.ts.
  • Emits sfx:resize from the linear/radial resize drag handler in node-arrow-handles.tsx only when the snapped + clamped value actually changes, so the cue ticks on real size steps (width / length / depth / radius / wall + chimney height) instead of every sub-pixel pointer jitter. Rotation handles keep their existing item-rotate cue.

How to test

  1. bun dev and open the editor.
  2. Ensure audio is unmuted in the editor's audio settings.
  3. Select a node (e.g. an item, column, or wall) and drag one of its resize handles — width/length/depth chevrons, the radial column handle, or the wall/chimney height tracker.
  4. Expected: a soft tick steps as the size changes; the cue does not stack into noise on fast drags, and rotation drags still play the rotate cue (not the resize one).

Screenshots / screen recording

N/A — audio change; no visual diff. (Happy to attach a screen recording with sound if useful.)

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Low Risk
Editor-only audio and a narrow emit guard on the existing resize drag path; no auth, data, or scene persistence changes.

Overview
Adds resize tick audio while dragging linear and radial resize handles (width, length, depth, radius, wall/chimney height trackers), without changing rotation handles.

A new sfx:resize event is registered in the SFX bus and backed by a resize sound in sfx-player — three round-robin clips, quieter volume, pitch/pan jitter, and an 80ms minimum gap (same idea as grid snap) so fast drags sound like stepped texture instead of a steady tone.

In LinearArrow’s resize move handler, the cue fires only when the snapped and clamped dimension value changes, so ticks align with real size steps rather than sub-pixel pointer movement.

Reviewed by Cursor Bugbot for commit 9bfbcc9. Bugbot is set up for automated code reviews on this repo. Configure here.

Register a `resize` sound effect (three round-robin variations with
pitch/pan jitter and an 80ms gap) and emit it from the linear/radial
resize drag handler whenever the snapped+clamped value steps, so width /
length / depth / radius / height drags tick as the size changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed Jun 22, 2026, 3:11 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@wass08 wass08 merged commit ae90da6 into main Jun 22, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant