Skip to content

feat: Beep when attempting constrained move on top-level block#9635

Merged
gonfunko merged 3 commits intov13from
move-boops
Mar 18, 2026
Merged

feat: Beep when attempting constrained move on top-level block#9635
gonfunko merged 3 commits intov13from
move-boops

Conversation

@gonfunko
Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9623

Proposed Changes

This PR plays a brief error beep when attempting to move a top-level block in constrained mode.

@gonfunko gonfunko requested a review from a team as a code owner March 16, 2026 22:08
@gonfunko gonfunko requested review from BenHenning and removed request for a team March 16, 2026 22:08
@github-actions github-actions bot added the PR: feature Adds a feature label Mar 16, 2026
Copy link
Copy Markdown
Collaborator

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gonfunko! Just one thought, but approving since it's a potentially contentious design suggestion.


if (this.moveMode === MoveMode.CONSTRAINED) {
showUnconstrainedMoveHint(this.workspace, true);
this.workspace.getAudioManager().beep(260);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this should be put in a more domain-specific method in the audio manager, maybe a playTryConstrainMoveTopLevelBlockSound() or something? It would hide the implementation details and puts the API a bit closer to just playing sound files, though it's a balance on where we represent the domain context and decision making. I defer to you (though this is how I was thinking of representing other similar solutions in the screen reader design doc).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that feels a little over-specified, but I agree it would be nice to avoid magic constants. WDYT about adding playErrorBeep()? I don't think we want separate tones for everything, basically just a "nope" beep and then the scope-change ones, which I think can be individually specified since the frequency is based on the nesting level.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error beep might be a tad generic since different 'error' cases may justify playing that (but the same tone used in each place might be a bit confusing). I like that more than the magic number, but there are definitely pros/cons. Might be worth getting a third opinion from someone else on the team to see if we can make a case one direction or the other.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maribethb do you have opinions here? I think we should use the same beep for all errors; this is how OSes normally work, and conditions where we want to beep are typically accompanied by a toast which should clarify the problem/what needs to be done to address it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using the same error beep for all the errors makes sense unless/until we find out otherwise in testing, and until then, a playErrorBeep method sounds fine.

If we do end up having different types of error beeps later, then potentially having an enum of them to give as an argument would work (instead of the really long method name described above, and more extensible as developers could pass their own number if they wished). but for now just the one value seems fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated accordingly, thanks!

@BenHenning BenHenning assigned gonfunko and unassigned BenHenning Mar 17, 2026
@gonfunko gonfunko assigned BenHenning and unassigned gonfunko Mar 17, 2026
@BenHenning BenHenning assigned gonfunko and unassigned BenHenning Mar 17, 2026
@gonfunko gonfunko merged commit c862b5e into v13 Mar 18, 2026
4 of 5 checks passed
@gonfunko gonfunko deleted the move-boops branch March 18, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants