Skip to content

Add all features + L&L Customizations - installer script for L&L-compatible installs & Loop AI Power Pack#2

Open
taylorpatterson-T1D wants to merge 45 commits intomainfrom
feat/installer
Open

Add all features + L&L Customizations - installer script for L&L-compatible installs & Loop AI Power Pack#2
taylorpatterson-T1D wants to merge 45 commits intomainfrom
feat/installer

Conversation

@taylorpatterson-T1D
Copy link
Copy Markdown

@taylorpatterson-T1D taylorpatterson-T1D commented Feb 14, 2026

Install the Loop AI PowerPack

(AutoPresets, FoodFinder, LoopInsights, GraphDetailView, SiteAtlas)

Adds AI-powered food analysis, therapy settings insights, and automatic preset management to Loop. Use this approach if you want to test all features together - Feature toggles exist for each of them.

For full detail about these features you can refer to these PRs:
AutoPresets - LoopKit/Loop#2402
FoodFinder - LoopKit/Loop#2404
LoopInsights - LoopKit/Loop#2405
GraphDetailView - LoopKit/Loop#2425
SiteAtlas - LoopKit/Loop#2427

You can reliably rebuild Loop + L&L Customizations + All of these features using one of these three Options. I have tested it a lot :-).


Option A: xCode quick Install (most users) - "Just the PowerPack, please"

If you don't need Loop & Learn customizations (Profiles, Basal Lock, etc.), use this. One command:

BUILD_DIR=~/Downloads/BuildLoop/Loop-$(date +%Y-%m-%d-%H%M%S) && mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" && git clone --branch feat/AllFeatures --recurse-submodules https://github.com/TaylorJPatterson/LoopWorkspace.git

Then open LoopWorkspace/LoopWorkspace.xcworkspace in Xcode → select your signing team → Cmd+R. That's it.


Option B: xCode install with L&L Customizations - "I want it all!"

If you want Loop & Learn patches (Profiles, Basal Lock, Negative Insulin, etc.) alongside all our features, use this path instead.

B1. Build Loop with this Build Select Script

Copy and paste into Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/loopandlearn/lnl-scripts/main/BuildSelectScript.sh)"

Choose Build Loop and select the MAIN branch. Full instructions: LoopDocs — Build with Mac

DO NOT BUILD IN XCODE YET

B2. Stay in the script and add your desired L&L customizations

Pick whatever L&L patches you want: Loop and Learn — Custom Code

Note: If applying multiple overlapping L&L patches (e.g. Profiles + Basal Lock), use the correct combo patch file from L&L (e.g. basal_lock_profiles.patch). That's an L&L thing — once your patches are applied, our installer handles the rest. When you are done, exit this script and goto step B3.

B3. Install all PowerPack features

Copy and paste into Terminal:

cd ~/Downloads/BuildLoop && cd "$(ls -dt */LoopWorkspace 2>/dev/null | head -1)" && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/TaylorJPatterson/LoopWorkspace/feat/installer/Scripts/install_features.sh)"

B4. Build in Xcode

Open LoopWorkspace.xcworkspace → select your signing team → Cmd+R. You're done!


To uninstall (Option B only)

Copy and paste into Terminal:

cd ~/Downloads/BuildLoop && cd "$(ls -dt */LoopWorkspace 2>/dev/null | head -1)" && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/TaylorJPatterson/LoopWorkspace/feat/installer/Scripts/install_features.sh)" bash --rollback

For Option A, just delete the folder. For Option C, just delete your fork.


L&L Compatibility (Option B)

Any combination of L&L patches works. Apply them first, then run our installer — it adapts automatically.

The installer fetches its own dev reference for diffing, so it works regardless of which branch you cloned. L&L patches target main, and the installer's 3-way merge adapts to whatever state the files are in.

Tested with all overlapping L&L patches applied simultaneously:

Customization Compatible Tested
Profiles
Basal Lock
Negative Insulin
Future Carbs 4h
All other L&L patches

Option C: Browser Build (no Mac required)

Build directly from GitHub using GitHub Actions — no Xcode or Mac needed.

Already have a LoopWorkspace fork? No problem. This uses a separate repo so it won't conflict with your existing fork.

C1. Fork the Loop-AllFeatures repository

Go to github.com/TaylorJPatterson/Loop-AllFeatures and click Fork. Uncheck "Copy the main branch only" if prompted — you want all branches.

C2. Set up your secrets

Follow the standard LoopDocs — Browser Build instructions to configure your GitHub secrets (GH_PAT, TEAMID, FASTLANE_KEY_ID, FASTLANE_ISSUER_ID, FASTLANE_KEY, MATCH_PASSWORD).

C3. Run the build

Go to Actions4. Build LoopRun workflow → select the main branch → click Run workflow.

Your build will be uploaded to TestFlight automatically. Updates sync to your fork automatically.

Note: Browser Build does NOT support L&L customizations. If you need L&L patches, use Option A or B with Xcode.


After installing (any option)

All features are off by default. Turn them on in Loop Settings.
For AI driven features, enter your AI API key (OpenAI, Anthropic, or Google) in FoodFinder Settings. LoopInsights shares the same key.


Recent Updates (since initial PR)

AutoPresets (PR #2402)

  • Extended Stop Delay — Up to 2 hours for post-exercise insulin sensitivity
  • Detects walking and running activity using CMPedometer (step counting) and CMMotionActivityManager (activity classification)
  • Applies a user-selected override preset automatically when sustained activity is confirmed
  • Removes the override automatically after activity stops, with a configurable delay
  • Geofence triggers — auto-activate presets when arriving at or leaving saved locations (gym, park, office)
  • Calendar triggers — scan your calendars for keyword-matched events and activate presets before scheduled activities

FoodFinder (PR #2404)

  • Per-Item Portion Control — Individual USDA serving steppers per food item
  • AI Performance Optimizations — Removed cosmetic delays, added OCR fast gate, trimmed prompt by ~8K chars
  • Location-Aware AI — GPS reverse geocode for restaurant/venue context
  • Image Crop Step — Crop photos before AI analysis
  • Macro-Aware Absorption — Extended absorption for high fat/protein meals (ungated)
  • Pre-Bolus Timing — AI timing recommendations based on GI and glucose context
  • AI Carb Range Display — Confidence range alongside point estimate

LoopInsights (PR #2405)

  • Endo Visit Report Generator — One-tap branded PDF with 9 toggleable sections, Dexcom Clarity-style TIR bar, detected patterns, and custom email subject
  • Caregiver / Family Digest — Pre-configured email/iMessage delivery to caregivers with recipient storage, frequency picker, and personalized greeting
  • Behavior Insights — Detects systematic carb correction patterns by food type, location, time of day; surfaces in dashboard with alert banners
  • Settings Impact Tracker — Before/after comparison when AI suggestions are applied, with verdict badges and countdown to evaluation
  • Ask Loopy Chat History — Auto-save and browse past AI chat sessions
  • Step Count Dedup — Fixes double-counting when iPhone + Apple Watch both record steps
  • Background Monitor Status — Shows last checked / next check timestamps

GraphDetailView: Long-Hold Detail Popup (PR #2425)

Long-press on glucose chart shows a detail popup with glucose, IOB, COB, bolus, basal rate, preset, AutoPreset, and heart rate at that timestamp. Scrub left/right to explore the timeline with haptic feedback. Auto-fades after 5 seconds. Works standalone — no dependency on other features.
-Long-press anywhere on the glucose chart to show a detail popup
-Scrub left and right to slide through the timeline — the popup follows your finger and updates data in real-time
-Auto-fades after 5 seconds when you lift your finger
-Dismiss early by tapping elsewhere or the X button
-Re-scrub without needing to dismiss first — just long-press again

SiteAtlas: Pump & CGM Site Rotation Tracker (PR #2427)

-Track where you place pump infusion sets and CGM sensors on a visual body map. Color-coded pins show site age — red (just placed) through green (safe to reuse) over 14 days. 12 recommended placement zones shown as grey highlights on the body map (abdomen, thighs, arms, buttocks), with the ability to toggle off zones you don't use via a collapsible "Enable Placement Zones" section in Settings. "Next Up" section recommends your best site based on oldest-first sorting. Prompted logging on pump deactivation, manual logging anytime. Touch-drag-drop pin adjustment with proximity-based coloring that warns when placing too close to a recently-used site. Edit date/time, hide old entries, and manage everything from Settings.
-Visual body map (front and back) where you tap to log where you placed a site
-Color-coded pins: red (just placed) → orange (healing) → yellow (almost ready) → green (safe to reuse) over 14 days
-12 recommended placement zones — grey highlighted areas on the body map showing where sites should go (abdomen, thighs, arms, buttocks)
-Toggleable zones — turn off zones you don't use via a collapsible "Enable Placement Zones" section in Settings
-Next Up recommendations — sorted oldest-first so you always know where to go next
-Manual logging anytime from Settings
-Touch-drag-drop pin adjustment with dramatic visual feedback (pin grows large when grabbed)
-Proximity warning — while dragging a pin, it turns green in safe areas and red when too close to a recently-used site
-Existing sites shown as faded reference pins when placing a new one
-Hide locations you no longer use (swipe right → Hide)

International Units Support — mg/dL ↔ mmol/L (LoopInsights + AutoPresets)

Honors your iOS Health glucose unit preference across the entire PowerPack. LoopInsights surfaces (Dashboard, Trends, Meal Insights, Endo Report, Caregiver Digest, Goals reports, Suggestion Detail) and AutoPresets surfaces (AI Preset Advisor reasoning, override editor) all display values in your preferred unit. AI prompts tell Claude to respond in your unit with the correct ISF rule (Rule of 1800 for mg/dL, Rule of 100 for mmol/L) and Time in Range targets (70–180 mg/dL or 3.9–10.0 mmol/L). International users (UK/EU/AU/etc.) finally get a fully native experience.

Requesting review by @marionbarker based on availability.

marionbarker and others added 4 commits January 11, 2026 10:33
Point Loop submodule at TaylorJPatterson/Loop feat/AllFeatures branch
which merges all three feature branches onto dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@taylorpatterson-T1D taylorpatterson-T1D changed the title Add feature installer script for L&L-compatible installs Add all features + L&L Customizations - installer script for L&L-compatible installs Feb 14, 2026
Provides an alternative install method where users run a script on a
standard Loop clone after applying any L&L customizations. The script
uses anchor-based text insertion and 3-way merges to adapt to whatever
patches are already present, making all L&L customizations compatible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fetch dev from feature remote as diff base (available even when user clones main)
- Make Localizable.xcstrings checkout conditional (main uses .strings, dev uses .xcstrings)
- L&L patches target main, so Option B must use main not dev

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@taylorpatterson-T1D taylorpatterson-T1D force-pushed the feat/installer branch 2 times, most recently from 5c5b17b to f4adda4 Compare February 15, 2026 16:25
Anchor on "Diabetes Treatment" instead of the ForEach line so our features
(FoodFinder, LoopInsights, AutoPresets) appear right after Therapy Settings.
If L&L Profiles is installed, it ends up below our features instead of above.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@taylorpatterson-T1D taylorpatterson-T1D changed the title Add all features + L&L Customizations - installer script for L&L-compatible installs Add all features + L&L Customizations - installer script for L&L-compatible installs + AutoPreset/FoodFinder/LoopInsights Feb 15, 2026
taylorpatterson-T1D and others added 15 commits February 15, 2026 13:18
Replace str | None union syntax (requires Python 3.10+) with
Optional[str] from typing so the script works on Python 3.6+.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The AlcoholTracker and AlcoholLogView files were missing from both
the NEW_FILES array in install_features.sh and the SOURCE_FILES
array in update_pbxproj.py, causing Option B installs to fail with
"Cannot find type 'LoopInsights_AlcoholTracker' in scope".
- NEW_FILES: old root-level paths → AutoPresets/ subdirectory paths
- Added AutoPresets_FeatureFlags.swift to NEW_FILES
- SettingsView patch: uses AutoPresets_FeatureFlags.isEnabled gate
- LoopDataManager patch: uses AutoPresets_Coordinator/Delegate types
- update_pbxproj.py: AutoPresets subgroups under Managers/Models/Views/Resources
- Rollback: includes AutoPresets subdirectories in cleanup
AutoPresets row now always shows in Settings, matching Option A behavior.
6 new files added to NEW_FILES and SOURCE_FILES arrays:
- LoopInsights_MealDebriefModels.swift (Models)
- LoopInsights_MealDebriefService.swift (Services)
- LoopInsights_PreMealAdvisorService.swift (Services)
- LoopInsights_MealInsightsViewModel.swift (View Models)
- LoopInsights_MealDebriefCard.swift (Views)
- LoopInsights_PreMealAdvisorCard.swift (Views)
Reorder: AutoPresets → FoodFinder → LoopInsights.
Sync loopInsightsSection computed property with Section{} wrapper to match Option A.
install_features.sh: NEW_FILES array
update_pbxproj.py: SOURCE_FILES + SUBGROUPS arrays
- 3 new files: RecommendationModels, AIAdvisor, AIRecommendationView
- New Services/AutoPresets group in pbxproj script
- Added shouldCreatePreset delegate method to LoopDataManager template
…late

Without this, the AI Preset Advisor section is hidden in Option B builds
because the guard on dataStoresProvider always fails when it's nil.
@taylorpatterson-T1D taylorpatterson-T1D changed the title Add all features + L&L Customizations - installer script for L&L-compatible installs + AutoPreset/FoodFinder/LoopInsights Add all features + L&L Customizations - installer script for L&L-compatible installs & Loop AI Power Pack (AutoPreset/FoodFinder/LoopInsights/GraphDetailView) May 2, 2026
@taylorpatterson-T1D taylorpatterson-T1D changed the title Add all features + L&L Customizations - installer script for L&L-compatible installs & Loop AI Power Pack (AutoPreset/FoodFinder/LoopInsights/GraphDetailView) Add all features + L&L Customizations - installer script for L&L-compatible installs & Loop AI Power Pack May 2, 2026
…alog imagesets

Phase 4b creates BodyMapFront.imageset and BodyMapBack.imageset in
DerivedAssetsBase.xcassets instead of copying loose PNGs to Resources/SiteAtlas/.
This ensures Xcode bundles the images reliably via the asset catalog compiler.
Phase 8b patches Environment+Dismiss.swift and TherapySettingsView.swift
in LoopKit so the installer-based (Option B) flow also wires "Get help
with Therapy Settings" to LoopInsights when enabled.
Option B always installs all features, so the therapyHelpDestination
environment injection should be unconditional. Previously it was gated
behind LoopInsights_FeatureFlags.isEnabled which defaults to false,
causing the therapy help to always show the placeholder view.

Also added proper error exits and diagnostics for pattern matching
failures so issues are visible in installer output.
Replace TherapyHelpDestination environment key with TherapyHelpRegistry
static class. Environment propagation was unreliable. Static property
is set once by Loop's SettingsView onAppear and read directly by
TherapySettingsView.
- Use TherapyHelpRegistry static class instead of environment keys
- Anchor on .navigationViewStyle(.stack) so onAppear fires when
  SettingsView appears, before user navigates to TherapySettingsView
- Previous approach had onAppear on therapySettingsView which fired
  too late (same instant TherapySettingsView body evaluated)
Required for Option B installs to receive the new mg/dL ↔ mmol/L glucose unit
helper that LoopInsights and AutoPresets depend on. Without this, Option A
(direct clone of feat/AllFeatures) compiles but Option B (installer script)
fails with "Cannot find type 'LoopInsights_GlucoseUnitContext'".
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.

2 participants