Skip to content

feat: add haptic toogle#100

Merged
destucr merged 3 commits intodevelopmentfrom
fix/haptic-toogle
Nov 30, 2025
Merged

feat: add haptic toogle#100
destucr merged 3 commits intodevelopmentfrom
fix/haptic-toogle

Conversation

@destucr
Copy link
Contributor

@destucr destucr commented Nov 30, 2025

🎯 Summary

This pull request introduces a user-facing toggle for haptic feedback within the Live Listen feature. This includes implementing persistent storage for the user's preference, integrating the setting across the Haptic, Audio, and ViewModel layers, and updating the OrbLiveListenView UI with a new button arrangement to host the toggle.


✨ Features/Changes

📳 Haptics Toggle Feature

  • Persistent Storage: Added a persistent isHapticsEnabled property to HapticManager, using UserDefaults to store the user's preference and setting a default value on first run.
  • Conditional Triggering: Updated HapticManager logic to strictly check the isHapticsEnabled state before any haptic feedback is triggered, ensuring the user's preference is respected.

🔗 Integration Across Layers

  • Audio Manager: Exposed the isHapticsEnabled property and the toggleHaptics() method via AudioPostProcessingManager to act as a pass-through layer.
  • ViewModel Binding: Added corresponding pass-through properties and methods (isHapticsEnabled, toggleHaptics()) to OrbLiveListenViewModel to facilitate easy two-way binding with the UI.

✨ UI Updates (OrbLiveListenView)

  • New Button Arrangement: The single floating button for opening the timeline has been replaced with a new horizontal button row visible in playback mode.
  • Haptics Toggle Button: The new row includes the haptics toggle button, which visually changes its icon/state to reflect whether haptic feedback is currently enabled or disabled.
  • Share Button Inclusion: The new button row also includes a share button alongside the haptics toggle.

📁 Files Changed

  • HapticManager.swift - Added persistent storage and conditional haptics trigger logic.
  • AudioPostProcessingManager.swift - Added pass-through logic for haptics state and toggle.
  • OrbLiveListenViewModel.swift - Added pass-through properties and methods for UI binding.
  • OrbLiveListenView.swift - Replaced floating button with new button row containing the haptics toggle and share button.

🔧 Usage Examples (if applicable)

// Toggling haptics from the ViewModel:
viewModel.toggleHaptics()

// Checking state in the Haptic Manager before a trigger:
if isHapticsEnabled {
    // trigger haptics
}

@destucr destucr merged commit d16642e into development Nov 30, 2025
2 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