Skip to content

feat(frontend): opt-in audio chime on successful transaction - #1387

Merged
joelpeace48-cell merged 2 commits into
FinesseStudioLab:mainfrom
circleboyslimited:feat/1234-success-chime
Sep 25, 2026
Merged

joelpeace48-cell merged 2 commits into
FinesseStudioLab:mainfrom
circleboyslimited:feat/1234-success-chime

Conversation

@circleboyslimited

@circleboyslimited circleboyslimited commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an optional, subtle audio chime that plays when an on-chain action turns green (the success state of TransactionStatus). It is off by default, and users opt in from Notification settings.

Changes

frontend/src/lib/successChime.js (new)

  • Synthesizes a short, quiet two-note tone (C6 → E6, ~0.35s) with the Web Audio API, so no audio file is added to the bundle.
  • The preference is stored in localStorage under trivela:success-chime. isSuccessChimeEnabled and setSuccessChimeEnabled read and write it.
  • Every step is guarded: if there's no AudioContext, storage is blocked or audio throws, nothing plays and the success flow is never interrupted.
  • One AudioContext is created lazily and reused, and it is resumed if the browser suspended it.

frontend/src/components/TransactionStatus.jsx

  • A useEffect calls playSuccessChime() when variant === 'success' and a hash is present. A ref makes sure it plays only once per hash, so re-renders don't repeat it.

frontend/src/NotificationSettings.jsx

  • Adds a "Play a subtle chime when a transaction succeeds" checkbox. Turning it on plays a preview so the user knows what it sounds like.

Tests

  • lib/successChime.test.js: it's off by default, the setting persists, it doesn't play when disabled, it plays two notes when enabled, force preview works, and it fails quietly without Web Audio.
  • TransactionStatus.test.jsx: it chimes once per successful hash across re-renders, and doesn't chime for pending or error states.

Tests were not run locally. CI will run them.
Closes #1234
Closes #1236
Closes #1238
Closes #1235

circleboyslimited and others added 2 commits September 25, 2026 23:48
Synthesizes a short two-note tone with the Web Audio API (no audio asset),
off by default, preference persisted in localStorage, and fails silently
when audio or storage is unavailable.

Refs FinesseStudioLab#1234

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oggle

TransactionStatus plays the chime once per successful hash; Notification
settings gains a checkbox to opt in (with a preview on enable).

Closes FinesseStudioLab#1234

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@circleboyslimited 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

@joelpeace48-cell
joelpeace48-cell merged commit cd43d78 into FinesseStudioLab:main Sep 25, 2026
9 of 23 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

2 participants