Skip to content

Conversation

@codebymini
Copy link
Collaborator

Overview

This PR enhances the Loop APNS override functionality by replacing the simple confirmation alert with an interactive modal that allows users to configure override duration settings before activation.

Key Changes

🆕 New Features

  • Override Duration Modal: Replaces basic confirmation dialog with a comprehensive modal for override configuration
  • Duration Control: Added slider for setting custom override duration (15 minutes to 24+ hours)
  • Indefinite Override Toggle: Added toggle to enable/disable indefinite overrides
  • Smart Duration Display: Duration slider shows time in intuitive hours and minutes format (e.g., "1h 30m")

🔧 Enhanced User Experience

  • Preset Information Display: Modal shows override details including symbol, name, target range, and insulin needs
  • Contextual Warnings: Displays warning for overrides with default durations that can't be set to indefinite
  • Accessible Controls: Duration controls positioned at bottom of modal for easier thumb reach
  • Visual Feedback: Duration slider is disabled for overrides with preset durations

🏗️ Technical Improvements

  • Modal Architecture: Implemented OverrideActivationModal view with proper state management
  • Duration Handling: Enhanced activateOverride method to accept custom duration parameter
  • State Management: Added showOverrideModal property to view model

User Workflow Changes

Before: User taps override → Simple confirmation dialog → Override activates with preset duration

After: User taps override → Modal opens → Configure duration/indefinite setting → Override activates with chosen settings

Benefits

  • Flexibility: Users can now customize override duration instead of being limited to preset values
  • Clarity: Clear visual representation of what duration will be applied
  • Accessibility: Better positioned controls for mobile device usage
  • Consistency: Duration format matches other parts of the app (hours and minutes)

Files Modified

LoopFollow/Remote/LoopAPNS/OverridePresetsView.swift - Main implementation with modal and enhanced functionality
This enhancement significantly improves the user experience for remote override management while maintaining backward compatibility with existing override presets.

@bjorkert bjorkert requested a review from marionbarker August 23, 2025 09:04
Copy link
Contributor

@bjorkert bjorkert left a comment

Choose a reason for hiding this comment

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

Approved based on code review.

@marionbarker
Copy link
Collaborator

marionbarker commented Aug 30, 2025

Summary

  • If LoopFollow is in dark mode, I think the override modal should be in dark mode too. (Edited because after upgrading phone to iOS 18.6.2 with associated reboot - the modal is in dark mode).

  • The duration slider is not working for me for override that has a set duration

  • There should be a decimal point displayed for mmol/L glucose ranges

  • LoopFollow phone: SE 3rd gen, iOS 18.6.1

    • Note - repeated the test on an iPhone 8 running iOS 16 and the modal was dark on that device
    • edited to add: After updating the SE to iOS 18.6.2 with associated reboot - the modal is in dark mode
    • However, the duration for a defined duration override still could not be adjusted

Test

This test was performed using a Loop URL from a phone that uses mmol/L.

build dev branch to remind me of how the override interface works

  • when selecting the override, it asks if you want to enable it

in other words: Before: User taps override → Simple confirmation dialog → Override activates with preset duration

build this branch

test with an indefinite override from LoopFollow override screen

  • user can just accept as it
  • user can modify an indefinite override to specific duration from 15 minutes to 24 hours and return to indefinite

test with a defined-duration override from LoopFollow override screen

  • user can just accept as it
  • user should be able to modify the duration - but the slider is not working

The white full-screen modal is really high-contrast in the evening with a LoopFollow phone in dark mode.

  • edited to add: After updating the SE to iOS 18.6.2 with associated reboot - the modal is in dark mode

Also, the target should show one value after the decimal point for mmol/L. The sedentary override on the Looping phone is 5,5 to 6,1.

lf-pr457-formating

@marionbarker
Copy link
Collaborator

I updated the SE 3rd gen phone to iOS 18.6.2.
Either the update or the reboot associated with the update fixed the white modal problem.

@codebymini
Copy link
Collaborator Author

codebymini commented Aug 30, 2025

  • The duration slider is not working for me for override that has a set duration
    This is expected behaviour. I changed the warning text and also set the Duration and Enable Indefinitly to the secondary (disabled) color
  • There should be a decimal point displayed for mmol/L glucose ranges
    Added formatting based on users selection of mmol/L / mg/dL

@marionbarker
Copy link
Collaborator

If overrides with a defined duration cannot have the duration modified, I would suggest hiding the slider and the Enable indefinitely button and just show the duration as information.

For the overrides with indefinite duration, I would suggest adding a message saying, "To configure for a specific duration, disable the "Enable indefinitely" option to reveal a Duration slider.

Graphic below shows the current formatting for a defined duration override on left and indefinite override on the right.

lf-pr457-formating_2

@codebymini
Copy link
Collaborator Author

codebymini commented Sep 5, 2025

IMG_7976 IMG_7977 IMG_7978
  • For overrides with fixed duration the toggle and slider is hidden and information about the duration is shown together with other override information.
  • For overrides without duration a toggle to enable indefinitely is shown and if toggle off a slider to choose duration is shown

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.

I tested this earlier and left suggestions. These suggestion have been implemented. I tested the updated code and approve it.

The developer who created this PR has been using in in-vivo with no issues.

@marionbarker marionbarker merged commit 7ee73e1 into loopandlearn:dev Oct 1, 2025
@bjorkert bjorkert deleted the override-time branch October 1, 2025 18:20
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