Repository navigation
Sync upstream Trio dev 1.0.2.79 into Tai/dev - #46
Merged
Merged
Conversation
Shortened the explanatory comments added for the objectID/id fix and the Decimal/Double-to-Int trap guards down to one line each -- same substance, less essay. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017dwtF7rgieonCdrsQo11r5
this is a performance improvement for Garmin and Apple watch
Without new data the glucose bobble switched to "--" once the newest reading
was 6 minutes old. Like the phone's home screen, it now keeps showing the
last reading, its trend arrow and delta, with the reading's age ("6 m",
"< 1 m") next to the delta, until the reading is 12 minutes old, the loop's
own freshness gate. The age counts up with the main view's timer.
IOB, COB, the loop status and the treatment buttons keep their own staleness
rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0135v4JApHewuwGjWKiSPDNY
…phone" This reverts commit 3b8c467; the change belongs on the fork's dev view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0135v4JApHewuwGjWKiSPDNY
Covers full histories, deltas, the 2 h context tail and the bucket repair on both sides, and logs a missing local history as such instead of as changed glucose settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix two crash risks in Override preset row rendering
LibreCRKit is superseded by RoundWhiteDiscKit, which LibreLoop now uses, and which pairs Libre 3 / 3+ sensors with a plain-key app identity before falling back to its runtime tables. - RoundWhiteDiscKit (airedev326, main) replaces the LibreCRKit submodule, workspace entry, local package reference and app link. - LibreLoop moves from loopandlearn's trio branch to LoopKit/LibreLoop's legacy-loopkit-compat branch: current LibreLoop plus only the changes needed to build against loopandlearn's LoopKit. - swiftformat.sh excludes RoundWhiteDiscKit, and the submodule list and CODEOWNERS follow the rename.
RoundWhiteDiscKit now takes app credentials from the host; LibreLoop downloads them and picks the sensor by its advertised BLE address.
Replace LibreCRKit with RoundWhiteDiscKit and track LoopKit's LibreLoop
* scripts update, remove LibreCRKit, point to OmnipodKit dev branch * update submodules in common with Loop v3.14.9 plus DanaKit; other submodules unchanged * restore LibreLoop to match dev branch * update OmnipodKit to point to dev branch
Run swiftformat and extract missing strings
…ly and keep them in memory in the manager
…ly and keep them in memory in the manager
…ly, keep them in memory in the manager and load them before a remote save
Watch: fewer, better-timed state updates
Fix Apple Watch bolus direction arrow
[Part 1/4] Store therapy profiles in Core Data
[Part 2/4] Add therapy profiles with switching and editing
[Part 3/4] Upload every therapy profile to Nightscout
# Conflicts: # Trio/Sources/Localizations/Main/Localizable.xcstrings # Trio/Sources/Services/TherapyProfiles/TherapyProfileManager.swift
[Part 4/4] Add remote profile switch, save and delete commands
Therapy profiles in Trio
Fix app init running twice from TrioApp().resolver
Remove unused statistics reporting pipeline and StatsData entity
Re-apply Tai's APSManager changes (insulin concentration adjustments, enactManualTempBasal, settings/preferences accessors) on top of upstream's cleaned APSManager. Rebuild project.pbxproj as a 3-way merge of Tai dev with the profile-free upstream changes since 3f6b238, so all Tai fork files stay referenced while upstream's additions and deletions (Statistics, Loops, StatsData, WatchStateSnapshot) are honored.
Tai extends TherapySettingUnit with .mgdLPer10Gram and .mmolLPer10Gram, which the upstream stats PDF export did not handle. Group them as TherapySettingEditorView.displayText does: .mgdLPer10Gram with .gramPerUnit and .mmolLPer10Gram with the mmol units, all at max one fraction digit.
APSManager.isScheduledBasal was removed upstream in 508f3bd. Derive pump availability from state.pumpDisplayState, as upstream does.
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings Tai
devup to upstreamnightscout/Triodevatd37fe347e(1.0.2.79) — a 191-commit delta over 16 commits on the upstream dev line (8 functional commits/merges + 8 CI build-counter bumps) since the last sync base3f6b238b4(1.0.2.71, PR #44). The merge lands as 60 files changed, +3 570 / −1 106 on top of Taidev.Upstream's
feat/profilessubsystem (PRs #1763–#1766, merged upstream as #1788) is deliberately excluded from this sync — details below.Branch commits:
f1e91a29e(sync(trio): merge upstream/dev at d37fe347e),96a3cdda3(Revert "Merge pull request #1788 from nightscout/feat/profiles"),a29a6dfb3(sync(trio): restore Tai fork additions after excluding feat/profiles),64574cfc4(fix(sync): cover Tai CSF units in TherapySchedulePDFContent switch) and35454bc4d(fix(sync): use upstream pump availability signal in home header) — the two compile fixes found by review. Current head is35454bc4d, build-for-testing green. Merge basec9d309b02; working tree clean; no submodule or.gitmoduleschange.What changed
Statistics PDF report export (#1777)
The Statistics screen gained a full multi-page report builder (
StatExportMenuView,StatPDFExporter,StatPDFReportView,ReportChartType) with per-page selection and report presets (ExportSetup,ReportPresetSetup). Pages: glucose distribution by day, glucose percentile by day (plus the existing GRI view), insulin bolus, insulin TDD, meals, and a therapy-schedule page with the basal total. The export header shows the device's marketing name (UIDevice+Extensions) instead of the raw model identifier, and the menu has a help sheet. Chart math was factored intoStatChartUtils; about 345 lines of new localization strings.Watch: one compact glucose trace instead of a synced history (#1598)
The watch no longer syncs a glucose-history snapshot —
WatchStateSnapshot.swiftis gone on both sides (Trio/Sources/Models/,Trio Watch App Extension/) andWatchStatewas rewritten around a single request/push cycle: one request in flight, a fixed push window, and a compact trace that carries the phone's own values and colours (the phone computes them with itsgetDynamicGlucoseColor). A CGM gap only dates the BG bubble instead of blanking the trace, and a request from an older watch app build is still answered.AppleWatchManagerfollows the new payload shape.Watch: bolus confirmation crown hint (#1783)
The bolus-confirmation crown hint arrow points by crown side rather than by wrist, with watch unit tests covering both orientations.
APSManager cleanup and removal of the old statistics pipeline (#1681)
APSManagerloses unused APS state, injected services and pump helpers (−457 / +3 lines against Tai's previous file). The old statistics reporting pipeline is removed outright:Statistics.swift,Loops.swift, theStatsDataCore Data entity pair, theirNSPredicateshelpers, and the statistics reporting inAPSManager/DeviceDataManager. Tai has no callers left (verified), and the new Statistics export module above does not use that pipeline.CoreDataStackgains a separated content-change publisher, whichGarminManagerfollows.Smaller fixes
DevelopmentBranchAlerterno longer publishes changes from within view updates (#1779):@Observable+@ObservationIgnored+ aViewModifier-driven alert; Tai's branding strings are kept.TrioApp.resolveris static, so a secondTrioAppinstance is no longer created (#1781)..github/workflows/upstream_automation.yml;unit_tests.ymltrimmed; action versions bumped inadd_to_project.ymlandstale_issues.yml.auto_version_dev.ymlstays deleted on Tai.Upstream commits
Functional (upstream dev line):
490de75a7— Migrate non-fork build GitHub action jobs into a single workflow (#1773)f096d9739— Statistics PDF export (#1777)3adbc238e— Fix "Publishing changes from within view updates" warning (#1779)927c22b7a— Watch: send one compact glucose trace instead of syncing a history (#1598)d2c7f3186— Watch: bolus confirmation crown hint by crown side (#1783)de0f7f1f9—feat/profiles(#1788) — excluded, see below5587e4b35— Use staticTrioApp.resolverinstead of creating a newTrioApp(#1781)b9fcb5434— Remove unused APS state, injected services and pump helpers; remove the unused statistics reporting pipeline andStatsDataentity (#1681)Version bumps (build counter only, applied manually instead of cherry-picking):
ad6c66876(1.0.2.72),102bf772a(1.0.2.73),4a9fdecff(1.0.2.74),e6a9259e2(1.0.2.75),7e2fa52cb(1.0.2.76),e11a823e7(1.0.2.77),1bbf79dfd(1.0.2.78),d37fe347e(1.0.2.79).What Tai keeps
APSManagerwas taken, then Tai's fork patch was re-applied on top —enactManualTempBasal(rate:duration:), thesettings/preferencesaccessors,adjustPumpedVolumeToConcentration(_:)andadjustPumpedRateToConcentration(_:). Nothing referencing the removedStatsData/Statisticspipeline came back.AdaptProfile,ProfileScheduler,ProfileScheduleFirer,ActiveProfileMirror, the App Intents (ApplyProfileIntent,CreateCustomTempTargetIntent,ScheduleCustomTempTargetIntent,ScheduleProfileOnceIntent,ScheduleTempPresetIntent), theSettingsScopewrite rules and all four therapy editors editing live settings.GarminManager,GarminCommandRouterand tests).APP_DISPLAY_NAME = Tai,BUNDLE_IDENTIFIER = org.nightscout.$(DEVELOPMENT_TEAM).tai,COPYRIGHT_NOTICE = autoISF 3.01,RELEASE_NOTES_REPO = mountrcg/Tai,APP_URL_SCHEME = Trio, the app-group lines and bothConfigOverride.xcconfigincludes.Testflight/stays as is (onlyWhatToTest.en-CA.txtchanges, by design)..gitmodulesuntouched — the range contains no gitlink change..github/workflows/auto_version_dev.ymlstays deleted (Tai removes it deliberately).What is excluded
Upstream
feat/profiles— not in this sync (option C)Upstream merged the therapy-profile feature into
devinside the single mergede0f7f1f9(PRs #1763 Core Data storage, #1764 switching/editing, #1765 Nightscout upload, #1766 remote commands, rolled up as #1788). Because it all arrives through one merge commit, it is excluded with onegit revert -m 1 de0f7f1f9— deterministic, no per-file hand-reversion:Modules/TherapyProfiles/*(7),Services/TherapyProfiles/{TherapyProfileManager,TherapyProfileValidator},APS/Storage/TherapyProfileStorage.swift,Services/RemoteControl/TrioRemoteControl+Profile.swift,Models/{TherapyProfile,CompactTherapyProfile,ScheduledProfileSwitch}.swift, the 8*Stored+CoreData{Class,Properties}pairs andModel/Helper/TherapyProfileStored+helper.swift, plus 12 profile test files (TrioTests/TherapyProfileTests/*,TrioTests/CoreDataTests/TherapyProfileStorageTests.swift).TrioCoreDataPersistentContainer.xcdatamodel/contents:TherapyProfileStored,TherapyProfileEntryStored,TherapyProfileSwitchStored,ScheduledProfileSwitchStored.StatsDatais not restored (upstream removed it in #1681 and Tai accepts that).NightscoutManager,NightscoutAPI,NightscoutUploadPipeline, onboarding import);SettingItemshas no route toTherapyProfiles.SettingsScope, not "the active therapy profile".Reason: profiles are analysis-only for Tai at the moment. They will be ported as their own feature card, not smuggled in through a sync.
Note on two similarly named files:
Modules/Stat/View/ViewElements/Export/Charts/TherapySchedulePDFContent.swiftandModules/Onboarding/View/TherapyProfileChart.swiftcome from #1777 and are not part of the profile subsystem — they read live settings, and the profile merge's net effect on them was zero, so they stay.Upstream
feat/tandemNot in this range (
feat/tandemis a separate branch, upstream head888326d9e, not part ofdev). Tracked as its own ticket.Conflict resolutions
13 merge conflicts (items 1–11), 8 revert conflicts (items 12–13), plus the two binding canon edits (items 14–15).
.github/workflows/auto_version_dev.yml(modify/delete) — stays deleted.Trio.xcodeproj/project.pbxproj— upstream's file set was taken, then the fork file set was reconciled as a 3-way merge (base3f6b238b4, ours Taidev, theirs profile-free upstream): 4 hunks, upstream's re-sortedModelsgroup, and theStatistics/Loops/StatsData/WatchStateSnapshotentries dropped. All 118 Tai-only files plus Tai resources are referenced again; 0 dangling object IDs.Trio/Sources/APS/APSManager.swift— upstream's cleaned version (its cleanup must survive), then Tai's autoISF/concentration patch re-applied in the reconciliation commit.Trio/Sources/Assemblies/ServiceAssembly.swift— Tai kept.Modules/BasalProfileEditor/{BasalProfileEditorProvider,BasalProfileEditorStateModel,View/BasalProfileEditorRootView}.swift— Tai kept.Modules/CarbRatioEditor/View/CarbRatioEditorRootView.swift— Tai kept.Modules/ISFEditor/View/ISFEditorRootView.swift— Tai kept.Modules/TargetsEditor/View/TargetsEditorRootView.swift— Tai kept.Modules/Home/View/HomeRootView.swift— Tai kept.Modules/Settings/SettingItems.swift— Tai kept.Services/DevelopmentBranchAlerter/DevelopmentBranchAlerter.swift— upstream's@Observable/ViewModifierimplementation with Tai's strings ("This is the development version of Tai, …", "Hey Tai user, watch out!").TrioCoreDataPersistentContainer.xcdatamodel/contents(revert conflict) — the 4 profile entities removed, nothing else added.Localizable.xcstrings— auto-merged on upstream's side, never hand-merged; the revert strips the profile strings automatically.Config.xcconfig— all fork lines intact,APP_DEV_VERSION1.0.2.71 → 1.0.2.79 (APP_VERSIONstays 1.0.2).Testflight/WhatToTest.en-CA.txt—based on Trio dev 1.0.2.79.Files 4–10 were kept Tai-side in the merge and again in the revert: upstream's only change on them in this range came from profile commits, so "keep Tai" is the exclusion.
Verification
Three review passes on this branch; the last one re-ran the full build-for-testing gate on the final head and it succeeds. All content gates are PASS and the branch now compiles clean.
Review 1 — card
t_829535dcata29a6dfb3:APP_DEV_VERSION = 1.0.2.79,COPYRIGHT_NOTICE = autoISF 3.01, submodule pins and.gitmodulesunchanged,auto_version_dev.ymlstill deleted,WhatToTestline updated.AdaptProfile,ProfileScheduler,ProfileScheduleFirer,ActiveProfileMirror, App Intents,SettingsScopeand the four editors intact.git diff --checkclean; pbxproj object graph 2 758 objects, 0 dangling, all 118 fork files re-added.build-for-testingexited 65 on exactly one compile error: a non-exhaustive switch over Tai-extendedTherapySettingUnitin the upstream stats-export fileTherapySchedulePDFContent.swift:141— Tai adds.mgdLPer10Gram/.mmolLPer10Gramfor its CSF editor, which upstream's new switch did not know.Rework 1 —
64574cfc4(fix(sync): cover Tai CSF units in TherapySchedulePDFContent switch): explicit cases for.mgdLPer10Gramand.mmolLPer10Graminformat(_:), grouped with the correct sibling fraction digits (1), no@unknown defaultescape hatch. Two added lines, no other file in the commit.Review 2 — card
t_77142000at64574cfc4:Rework scope and format (PASS) — the switch fix is correct and the commit does not touch anything else.
Regression checks (PASS) —
git diff --checkclean, no profile-subsystem file in the diff, fork specifics (Tai,1.0.2.79) and the untrackedREADME/draft untouched.Build (FAIL) — the CSF error is gone, and the identical command now stops on one remaining, distinct error:
Cause: upstream
508f3bda8(#1681) deletedisScheduledBasalfrom theAPSManagerprotocol as dead code; Tai's fork-only header block (rightHeaderPanel(), added in23a229ca05) still gated the delivery-rate line on it. The last unresolved merge collision between the fork header and the cleanedAPSManager— the next error behind the one the first rework fixed, not a new regression. Rework cardt_0405628afollowed.Rework 2 —
35454bc4d(fix(sync): use upstream pump availability signal in home header): the Tai header block now derives pump availability fromstate.pumpDisplayState != nil— the signal upstream itself uses since theAPSManagercleanup — instead of the removedapsManager.isScheduledBasal. Two lines changed inHomeRootView+Header.swift(the condition plus its comment), no other file in the commit;APSManager.swiftandDeviceDataManager.swiftare untouched, and the pre-existingPumpHistoryEvent.isScheduledBasalfield and its consumers stay as they are.Review 3 (final) — card
t_f5bf3fccat35454bc4d: all three gates PASS.Rework scope (PASS) — the commit touches only
HomeRootView+Header.swift(2 inserted / 2 deleted);isScheduledBasalappears nowhere in the protocol or its members any more.Build-for-testing (PASS) — on the exact head:
Regression checks (PASS) —
git diff --checkclean; no profile-subsystem file in the diff (TherapyProfileStorage.swift,TrioRemoteControl+Profile.swiftabsent;TherapyProfileChart.swiftis the fork's therapy-settings chart fromf91ed2baf, notfeat/profiles); fork specifics intact (APP_DISPLAY_NAME = Tai,APP_DEV_VERSION = 1.0.2.79); the CSF-units fix (mgdLPer10Gram/mmolLPer10Gram) still present;READMEand this draft untouched.CI — not run yet. The exact-head checks (
Algorithm Package,Run Unit Tests) run on the first push of this PR.Checklist before merge
35454bc4d—TEST BUILD SUCCEEDED, exit 0.Not included
APP_DEV_VERSIONmoves 1.0.2.71 → 1.0.2.79 (upstream's build counter;APP_VERSIONstays 1.0.2).feat/profilesis not included (analysis-only for now; separate port).feat/tandemis not included (separate ticket).WhatToTestupdate.Screenshots
Not applicable for a Tai-side change: the new Statistics export UI and the watch changes are upstream's own UI, shown with screenshots in the upstream PRs (#1777, #1598, #1783). This merge adds no Tai-only UI.