Skip to content

feat: add Dynamic ISF override toggle and expand basal percentage range#29

Draft
Copilot wants to merge 8 commits intocopilot/create-profile-system-planfrom
copilot/expand-settings-dynamics-smb
Draft

feat: add Dynamic ISF override toggle and expand basal percentage range#29
Copilot wants to merge 8 commits intocopilot/create-profile-system-planfrom
copilot/expand-settings-dynamics-smb

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 6, 2026

Expands the override system with a Dynamic ISF disable toggle and widens the basal percentage range from 40–150% to 10–200%.

New: Disable Dynamic ISF per override

Full-stack addition of disableDynamicISF: Bool through all layers:

  • Data model: Override struct, OverrideStored Core Data entity + properties
  • Transport: TrioCustomOrefVariables field + CodingKeys, populated in prepareTrioCustomOrefVariables()
  • Algorithm: Explicit check in determine-basal.js before dynISF calculation:
    if (trio_custom_variables.useOverride && trio_custom_variables.disableDynamicISF === true) {
        dynISFenabled = false;
    }
  • Storage: storeOverride() and copyRunningOverride() persist the field
  • State: Added to AdjustmentsStateModel, wired into saveCustomOverride(), saveOverridePreset(), resetStateVariables()
  • UI: Toggle in both AddOverrideForm and EditOverrideForm
  • Validation: isOverrideInvalid() treats disableDynamicISF as a non-default setting

Expanded basal percentage range

Picker range changed from stride(from: 40, through: 150) to stride(from: 10, through: 200) in both Add and Edit forms, matching the existing roundOverridePercentageToStep bounds.

Existing SMB controls

Already comprehensive (disable, schedule disable, override max SMB/UAM minutes) — unchanged.

Other

  • Updated OverrideHelpView to mention Dynamic ISF disable
  • Updated all Override() callsites in OverrideStorageTests
  • Rebuilt webpack bundle for determine-basal.js

Copilot AI and others added 5 commits April 6, 2026 16:24
Implements a profile preset system that allows users to:
- Save current therapy settings (Basal, ISF, CR, Glucose Targets) as named presets
- View saved presets with summary info (total daily basal, entry counts)
- Activate a preset to restore saved settings
- Delete presets via swipe-to-delete

Components:
- ProfilePreset model (JSON-serializable)
- ProfilePresetStorage (file-based storage using existing FileStorage)
- ProfilePresets module (DataFlow, Provider, StateModel, RootView)
- Navigation integration (Screen, SettingItems, TherapySettingsView)
- Xcode project references for all new files

Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/366f341c-cce7-40cc-838e-7f9297cb2c2c

Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
- Validate that therapy settings are non-empty before saving as preset
- Validate preset data before activating to prevent unsafe configurations
- Return optionals/booleans from save/activate to propagate validation errors
- Add error alerts for save and activate failures
- Fix pluralization in preset detail view for better localizability

Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/366f341c-cce7-40cc-838e-7f9297cb2c2c

Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
Extract totalDailyBasal as a computed property on ProfilePreset
for better code organization and reusability.

Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/366f341c-cce7-40cc-838e-7f9297cb2c2c

Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
Copilot AI and others added 3 commits April 6, 2026 17:45
- Add disableDynamicISF field to Override model, OverrideStored Core Data entity, and TrioCustomOrefVariables
- Add "Disable Dynamic ISF" toggle to AddOverrideForm and EditOverrideForm
- Expand basal percentage range from 40-150% to 10-200% in both forms
- Update determine-basal.js algorithm to check for disableDynamicISF override
- Update OverrideStorage to persist the new field
- Update resetStateVariables() to reset the new field
- Rebuild webpack bundle for determine-basal.js

Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/cf56e9b5-def3-4eae-bea0-52c18f18aa86

Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
… gitignore

Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/cf56e9b5-def3-4eae-bea0-52c18f18aa86

Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
Copilot AI changed the title [WIP] Add additional settings for dynamics and SMB options feat: add Dynamic ISF override toggle and expand basal percentage range Apr 6, 2026
Copilot AI requested a review from Sjoerd-Bo3 April 6, 2026 17:51
@Sjoerd-Bo3 Sjoerd-Bo3 force-pushed the copilot/create-profile-system-plan branch from ab5c3ec to 30221b9 Compare April 6, 2026 18:45
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