Skip to content

Conversation

@codebymini
Copy link
Collaborator

Add Import/Export Settings Feature

This commit introduces a comprehensive settings import/export system that allows users to:

  • Export settings via QR codes for Nightscout, Remote, and Alarm configurations
  • Import settings by scanning QR codes with automatic validation and migration
  • Backup/restore via iCloud for complete settings preservation
  • Selective alarm export with custom alarm selection interface

Key Features:

  • QR code generation and scanning for easy settings transfer between devices
  • Version compatibility checking and migration support
  • iCloud integration for automatic settings backup
  • Smart conflict detection and user warnings for remote settings
  • Modular export system supporting individual or combined settings

Technical Implementation:

  • New ImportExportSettingsView with SwiftUI interface
  • ExportableSettings structs for each settings type with JSON serialization
  • SettingsMigrationManager for version compatibility
  • Integration into main settings menu with dedicated navigation
    This feature improves the user experience for setting up LoopFollow on multiple devices or after reinstalls.

@codebymini codebymini requested a review from bjorkert October 17, 2025 07:21
@marionbarker
Copy link
Collaborator

Test

There are a few UI issues to be cleaned up before moving forward with this but this is a really great improvement in progress.

test with new installation of LoopFollow

Deleted LoopFollow from iOS 18 phone.

Nice set of buttons on main screen after start-up.

A8AC72D3-E2F3-413A-BD61-8C2C1C766362

test the Setup Dexcom Share button

Typing in my credentials does not seem to work.
There is no "done" button
Quit the app, restart, the 2 buttons are still on main screen.

  • probably because not wearing a sensor that goes to Share right now

Go to setting and check Dexcom entry - looks correct.
Tap Done button there.
(Note - I'm running a Stelo - so my Share is empty right now) - I will test this once I'm back on G7.

test the Setup Nightscout button

The QR appeared to be read from a different phone, you have to scroll to the bottom of the screen to see the Successfully imported message. Should a Continue button show up at the top right?

I tapped on Back then dismissed the card (showed empty).
The URL was clearly added because after I dismissed the card, the correct display is showing.
Checked the Settings, Nightscout and see the correct URL.

test import alarms

Exported 5 alarms from iOS 26 phone and the iOS 18 phone picked them up.

test import remote Trio

Exported remote Trio configuration from iOS 26 phone and the iOS 18 phone picked them up.

I need to set up a Trio test phone to be able to test this.

Need to get remote control working first then I'll come back and finish this test.

test import remote Loop

(For this test, I merged dev into local test-export-settings branch created from export-settings)

Plan to use my Looping phone for the source of the QR code.
operator error my one-time password is evidently out of date - when I went to Nightscout treatments I see the error messages

  • make sure that current version of LoopFollow 4.1.0 has remote control working
    • ✅ start an override
    • ❓ send 1 g carbs (wrong OTP)
    • ✅ send 0.05 U bolus
    • ❓ cancel the override (wrong OTP)

Build this onto my Looping phone and then do a fresh build onto the iOS 18 test phone (SE 2nd gen).

  • ❓ confirm all the remote commands still work (wrong OTP)
    • turns out I saw the message (on the same phone) that Loop got the remote commands, but in Loop history only the override change happened; the carbs and bolus did not appear
  • delete LoopFollow off iOS 18 test phone
  • build LoopFollow onto iOS 18 phone
  • ✅ import NS from Looping phone
    • There really needs to be a continue button after importing settings
    • Takes a long time for the URL to populate
  • ✅ import 5 alarms from Looping phone
  • ✅ import remote control settings from Looping phone
    • ✅ test set remote override from iOS 18 test phone
    • ❌ test send remote carbs from iSO 18 test phone: sent but not received
    • ❓ test send remote carbs from Looping (real phone) - I send and I see Loop got the remote but it's not showing up in the carbs or bolus history of Loop, only the override (wrong OTP)

stop test for now - ask for help on configuring this.

@codebymini codebymini marked this pull request as ready for review November 1, 2025 21:24
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.

4 participants