Skip to content

feat(widgets): auto-play UI sound feedback + deps cascade (ADR-037) - #215

Merged
kolkov merged 2 commits into
mainfrom
feat/sound-autoplay
Aug 7, 2026
Merged

feat(widgets): auto-play UI sound feedback + deps cascade (ADR-037)#215
kolkov merged 2 commits into
mainfrom
feat/sound-autoplay

Conversation

@kolkov

@kolkov kolkov commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Auto-play UI sounds — interactive widgets play system sounds on interaction via widget.PlaySound() DI pattern. Zero sound.Play() in user code.
  • deps: gg v0.50.14, gogpu v0.50.2 (12 sound types, WithSoundFeedback), wgpu v0.30.37

Auto-play widgets (SoundClick)

button, checkbox, radio, dropdown, collapsible, tabview, menu

Special sounds

  • dialog Show() → SoundAlert
  • slider — no sound (continuous drag)

Architecture (ADR-037)

widget.RegisterSoundPlayer() callback DI — widget/ never imports gogpu. desktop/sound.go bridges via init().

New files

  • widget/sound.go — SoundEvent, SoundPlayer, PlaySound
  • desktop/sound.go — bridge registration
  • widget/sound_test.go — 3 tests

Example

examples/sounds/ updated — sound.SetEnabled(true) only, widgets auto-click

Test plan

  • GOWORK=off go build ./...
  • go test ./... -count=1 (61 packages)
  • golangci-lint run --timeout=5m (0 issues)
  • Visual: all widgets click, slider silent

kolkov added 2 commits August 7, 2026 11:18
widget.PlaySound() DI pattern — widgets play sound.Click on interaction
without importing gogpu/sound. desktop/sound.go bridges via RegisterSoundPlayer.

Auto-play: button, checkbox, radio, dropdown, collapsible, tabview, dialog, menu.
No sound on slider (continuous drag). SoundAlert for dialog Show().
Sound before user callback for immediate feedback.
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
desktop/sound.go 14.28% 5 Missing and 1 partial ⚠️
core/dropdown/widget.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kolkov
kolkov merged commit 8d10ab7 into main Aug 7, 2026
9 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