Skip to content

Conversation

@codebymini
Copy link
Collaborator

@codebymini codebymini commented Aug 7, 2025

Overview

This PR introduces enhancements to the LoopFollow app's alarm management system: volume button alarm silencing.

Features Added

Volume Button Alarm Silencing

  • Hardware Control: Users can silence active alarms by pressing volume buttons
  • Smart Detection: Advanced algorithm that distinguishes intentional button presses from other volume changes
  • Configurable: Toggle option in settings to enable/disable this feature
  • User Feedback: Haptic feedback confirms successful volume button actions

Technical Implementation

Volume Button Handler

  • New File: VolumeButtonHandler.swift (327 lines)
  • Enhanced Files: 6 existing files updated
  • Key Features:
    • 0.9-second activation delay after alarm starts
    • Comprehensive logging for debugging
    • App lifecycle integration (starts/stops with foreground/background)

Configuration

New Settings

  • Volume Button Silencing: Toggle in Alarm Settings (defaults to disabled)

Default Behavior

  • Volume button silencing is disabled by default

Testing & Reliability

Volume Button Detection

  • Analyzes volume change magnitude (0.02-0.15 range)
  • Tracks timing patterns between changes
  • Distinguishes discrete button presses from continuous adjustments
  • Implements cooldown periods to prevent rapid triggers

@bjorkert bjorkert marked this pull request as draft August 13, 2025 18:57
@bjorkert bjorkert requested a review from marionbarker August 15, 2025 17:44
@bjorkert bjorkert marked this pull request as ready for review August 15, 2025 17:44
codebymini added a commit to CodeByMiniOrg/LoopFollow that referenced this pull request Sep 30, 2025
Copy link
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been used in-vivo by two of the developers.

Do a quick test by triggering an alarm and observing that pressing one-time on either a volume button snoozes the alarm when the feature is enable.

EDIT: the description has been updated.
The only issue is the description of the PR says enabled by default, when in fact it is disabled by default. But very first alarm that came on was snoozed right away and log said it was the volume button that stopped it. However, that seemed to be a one-time thing. I then changed to enabled. Quit and restart the app. Then volume buttons snoozed.

@marionbarker marionbarker merged commit 18a6ed1 into loopandlearn:dev Oct 1, 2025
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.

3 participants