Skip to content

🔊 Audio-Feedback | Optional Sound Effect Cues for Transaction Events - #670

Merged
Sadeequ merged 1 commit into
StellarFlow-Network:mainfrom
milah-247:feat/627-transaction-audio-cues
Aug 2, 2026
Merged

🔊 Audio-Feedback | Optional Sound Effect Cues for Transaction Events#670
Sadeequ merged 1 commit into
StellarFlow-Network:mainfrom
milah-247:feat/627-transaction-audio-cues

Conversation

@milah-247

Copy link
Copy Markdown
Contributor

Summary

  • Adds useTransactionAudio (src/hooks/useTransactionAudio.ts), a hook that synthesizes success, warning, and failure chimes with the Web Audio API — no external audio files, so nothing to load over the network.
  • AudioContext is created lazily on first play (never at mount) and reused, respecting the browser's autoplay/gesture policy.
  • Wires success/failure chime playback into ToastQueue on the existing confirmed/failed toast status transitions (swap confirmed, transaction failed, etc.), tracked as a side effect (not inside setState) so it's safe under React strict mode.
  • Adds a "Sound Effects" toggle to Settings → Alert Channels, defaulting to disabled, persisted to localStorage (sf_audio_enabled).
  • Adds an icon-volume-2 symbol to the shared SVG sprite for the new toggle row.

Technical Requirements Addressed

  • Lightweight web audio synthesized chimes for success, warning, and failure states
  • Explicit global audio toggle setting (Mute/Unmute) defaulting to disabled
  • Load compressed audio assets lazily to prevent bundle overhead (no audio assets needed — synthesized at runtime, AudioContext created lazily)

Files Changed

  • src/hooks/useTransactionAudio.ts (new)
  • src/components/ui/ToastQueue.tsx
  • src/app/settings/page.tsx
  • src/components/icons/iconIds.ts
  • public/sprite.svg, public/static/sprite.svg

Testing

  • npx tsc --noEmit — no new type errors introduced.
  • npx eslint on all changed files — clean.

Closes #627

Adds a lazily-initialized Web Audio API hook that synthesizes success,
warning, and failure chimes with no external audio assets. Wires
success/failure playback into ToastQueue on confirmed/failed status
transitions, and adds a Sound Effects toggle (off by default) to
Settings that persists to localStorage.
@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

@milah-247 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Sadeequ
Sadeequ merged commit 1ee5644 into StellarFlow-Network:main Aug 2, 2026
3 of 7 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.

🔊 Audio-Feedback | Optional Sound Effect Cues for Transaction Events Impact Severity: Low

2 participants