Skip to content

feat(sound): add SoundService and SettingsView#28

Merged
dinesh-git17 merged 1 commit intomainfrom
feat/sound-service-settings
Mar 5, 2026
Merged

feat(sound): add SoundService and SettingsView#28
dinesh-git17 merged 1 commit intomainfrom
feat/sound-service-settings

Conversation

@dinesh-git17
Copy link
Owner

Summary

Implements E8.1: Sound Service and Settings Toggle. Adds centralized AVAudioPlayer-backed sound playback service with named cue APIs for page turn, signature placed, and new content chime. Global sound preference persisted in UserDefaults (default: enabled). SettingsView provides deterministic toggle bound to SoundService state.

Design Doc Alignment

  • S6.8: Three sound cues (page turn, signature placed, new content chime) with toggleable settings gear, default on.
  • S10.5: AppState/service environment injection pattern.

Changes

  • ExhibitA/ExhibitA/Core/SoundService.swift (created): @Observable final class with Cue enum, isSoundEnabled persisted preference, play(_:) API, AVAudioPlayer preparation with graceful missing-asset handling.
  • ExhibitA/ExhibitA/Features/Home/SettingsView.swift (created): Settings surface with sound toggle using @Bindable binding to SoundService. Optional environment injection for preview safety. Theme-tokenized styling.
  • ExhibitA/ExhibitA/App/ExhibitAApp.swift (updated): SoundService instantiation and .environment() injection.
  • ExhibitA/ExhibitA.xcodeproj/project.pbxproj (updated): File references and build phase entries for both new files.

Risk Surface

  • Audio assets (page_turn.caf, signature_placed.caf, new_content_chime.caf) are not yet in the bundle. SoundService handles this gracefully via Logger.info and no-op playback. Assets must be added before cues are audible.
  • No call-site wiring in this PR. E8.2 wires SoundService.play(_:) into contract, signature, and sync surfaces.

Testing

  • Built with xcodebuild -project ExhibitA.xcodeproj -scheme ExhibitA -sdk iphoneos build. Zero errors, zero code warnings.
  • Protocol Zero scan: PASS (./scripts/protocol-zero.sh exit 0).
  • Typographic lint: PASS (./scripts/check-em-dashes.sh exit 0).
  • All pre-commit hooks pass.
  • Device: verified build targets iphoneos (physical device "Din").
  • Previews: SettingsView includes light, dark, and no-service previews.

Protocol Zero

./scripts/protocol-zero.sh exits 0.

Typographic Lint

./scripts/check-em-dashes.sh exits 0.

Centralized sound playback service with AVAudioPlayer-backed
cue APIs for page turn, signature placed, and new content chime.
Global sound preference persisted via UserDefaults with default
enabled on first launch. SettingsView exposes deterministic
toggle bound to SoundService state with optional environment
injection for preview safety.
@github-actions github-actions bot added the surface/ios iOS (SwiftUI) changes label Mar 5, 2026
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

CI Health Report

Workflow Status Notes Additional Context
Content Validation ✅ success -- 0m 14s
Full Stack Smoke ✅ success -- 0m 31s
PR Governance ✅ success -- 0m 19s
iOS Build & Test ✅ success -- 0m 7s

Not triggered: API Sync Contract, Admin Smoke, Backend Quality, DB Schema Check, Dependabot Updates, Push Mock Integration, Release Readiness, iOS Assets & Theme Check, pages-build-deployment


4 passed | 0 failed | 0 other | Commit: a389be7 | 2026-03-05 03:35:48 UTC

@dinesh-git17 dinesh-git17 merged commit e00235a into main Mar 5, 2026
12 checks passed
@dinesh-git17 dinesh-git17 deleted the feat/sound-service-settings branch March 5, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

surface/ios iOS (SwiftUI) changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant