Repository navigation
Conversation
c0a0031 to
91a5ba0
Compare
There was a problem hiding this comment.
Thanks for splitting this up. Trends reads well and the Statistics parity work is careful. Before this goes further I'd like to shrink it and remove the overlap with Statistics.
Replace Statistics. Trends should replace Statistics in this PR rather than sit beside it in Settings. Two screens answering the same question will confuse people, and the parity commit already covers what Statistics shows. Please remove the Statistics entry and the screen as part of this change.
Duplicated figures. Several numbers appear two or three times on one page:
- Insulin per day and the basal/bolus split are in the Summary tile, the Basal and bolus card, and the Insulin per day chart's average line and legend. Could Summary stay focused on glucose (plus carbs and boluses), and Basal and bolus fold into the Insulin per day card, with Scheduled and Manual/Automatic under the chart?
- Loop active in Summary repeats the Loop status card, and it covers a different window from the period's other figures. It's clearer only in Loop status, beside its coverage note.
- "Usually X U by HH:MM" appears twice. One place is enough.
Aim lines. The Aim sentences, especially the six-target one under Time in range, are hard to scan. Showing each band's target in its row, or marking a figure that misses its target, would say the same with less text.
Colors. The PR adds 17 named colors, and most could reuse what Loop already has. glucose-ink, accent-ink, insulin-ink, bolus and carbs-ink are variants of the existing glucose, accent, insulin and carbs colors. agp-inner, agp-outer, target-band, basal and basal-edge can be those colors at reduced opacity, with no new color sets. ink-muted can be .secondary. The five range-* colors duplicate GlucoseBand.agpColor in Statistics (TimeInRangeBar.swift). Since Trends replaces Statistics, keep one time-in-range palette; your dark-mode variants are an improvement, so move them there. control-thumb goes away with a system segmented Picker.
Scope. Could the day page, Gaps and Export come as follow-up parts? Export in particular produces a shareable, clinical-looking report that deserves its own review.
Open/closed loop history. Loop keeps 90 days of data (Bundle.main.localCacheDuration, LOOP_LOCAL_CACHE_DURATION_DAYS), and localHistoryStart already uses it. Rather than a new UserDefaults record (LoopModeHistory, 100 days), please read closed/open loop from data Loop already stores. StoredSettings carries dosingEnabled with a date, and SettingsStore keeps those records for the cache duration. The provider already uses getStoredSettings for target history. If that doesn't work out, a new record should follow the other stores' design (Core Data in the cache store, expiring with localCacheDuration) rather than live in UserDefaults.standard. It's also worth checking that every closed-loop toggle path saves settings, so the history isn't missing changes.
"Loop keeps 7 days". Two strings hard-code this: the Loop status footnote and the day page's Apple Health note. The provider's window is localHistoryStart, which is the cache duration, 90 days by default, so the text is wrong for most builds. It should follow the cache duration rather than hard-code a number.
Older periods. For days beyond Loop's local history, how does the screen show that the Manual/Automatic split and the scheduled basal are partial or estimated?
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
e613641 to
150196b
Compare
|
Thanks, Pete. I've taken almost all of this, one commit per point (listed in the description). Point by point: 1. Replace Statistics
Done. The Statistics entry and screen are removed: Everything Current Setup shares with Statistics stays: the 2. Duplicated figures
All three are done:
3. Aim lines
The Aim sentences are gone. Each target sits beside its figure, muted:
High and Low read "< 25% above range" and "< 4% below range", because those consensus targets cover both bands on that side, and a bare "< 25%" beside High alone would mislead. Misses aren't coloured; red stays for warnings. 4. Colours
16 of the 17 are gone:
I'd like to keep one: a darker 5. Scope
Done. The day page, the Gaps list and Export (PDF and CSV) are out of this PR, with their strings, code and tests. A one-day period still leads with that day's timeline, but it no longer opens a day page. 6. Open/closed loop history
Done:
7. "Loop keeps 7 days"Fixed. The Loop status footnote reads "Covers …, from the start of Loop's records, which it keeps for 90 days", with the number from 8. Older periods
Before, it didn't: Scheduled used today's schedule for older days as if it were fact. Now:
While checking this, I also found that days inside the cache window but before Loop's first records came up empty. Trends now reads Apple Health for those, with the boundary per kind of data at the later of the cache start and Loop's first record, and no overlap. Also fixed while testing
Deferred
🤖 Generated with Claude Code |
Nutcasey
left a comment
There was a problem hiding this comment.
Codex has reviewed PR #2637 using code-reviewer-cx, against next-dev f7b08cad, including the full diff and Pete's existing feedback. Codex has fixed all outstanding high-confidence issues found in this review. No further findings at or above 80/100 confidence remain.
Critical (90–100 confidence)
- 98/100 — Schedule history extended into unknown time. LoopHistoryProvider.swift:107: the historical schedule queries backfilled the first saved profile and skipped records without a profile. Trends could therefore infer basal delivery and draw targets during unknown time. Fixed in 0081d73c: reporting uses each saved setting only for its recorded interval, including the setting before the requested start. A real-
SettingsStoreregression catches both leading unknown time and missing profiles; restoring the old queries produces 5 U instead of 3 U, and the corrected implementation passes.
Important (80–89 confidence)
- 89/100 — Unreadable chart axes at accessibility text sizes. TrendsComponents.swift:732: the 90-day chart's dates overlapped at AX XXXL. Fixed in 596606a2: fewer axis labels, correctly anchored end dates, and stacked card titles/subtitles. The AGP and day timeline also reduce their axis labels at accessibility sizes. Verified on the
loopsimulator, including a before/after check of the insulin chart.
Verification
- App build and
build-for-testingsucceeded, using the separate #2652 watch build fix locally; that fix is excluded from these commits. - Operated Settings → Trends, all five periods, previous/next navigation, older Apple Health data, empty periods, light/dark appearance and AX XXXL; Current Setup still opens.
- 457 selected LoopTests: 455 passed, 2 failed.
LoopDataManagerTests28/28,LoopHistoryMathTests32/32,GlucoseStatisticsTests12/12. - The two failures are the already documented
BolusEntryViewModelTests.testCarbEntryDateAndAbsorptionTimeStringand…String2locale assertions (12:00 PMversus12:00). They also appear in the earlier pre-review run. HealthKit-hostedDeviceDataManagerTestswere excluded; this is not a claim that the complete hosted suite passes. git diff --check, catalogue JSON and new-string placeholder checks pass. Existing translations are unchanged.
The description now includes these fixes and the final test results. The PR is open and ready for human review.
ps2
left a comment
There was a problem hiding this comment.
Thanks for all the updates! Looking good! Just a couple more things I noticed:
- There is a mmol/mol line for users that don't use mmol/l in the GMI panel. That should probably be removed for those users.
- I understand wanting to keep contrast for the insulin colors. The Basal looks brown though. Is there a way to use the standard insulin color, with different levels of transparency enough to keep the contrast?
|
@Nutcasey Could you please make sure your colors pass WCAG AAA contrast guidelines for normal text (https://webaim.org/resources/contrastchecker/)? The text in the Summary cards is too low contrast. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP9CXfENBveKkXDDz3c
|
Thanks both. This is pushed as three new commits on top, with no rebase, and the description and screenshots are updated. @ps2: GMI (6adb4178). The mmol/mol line now only shows with mmol/L, including in the no-data tile. @ps2: insulin colours (123113df). All insulin marks now use the standard insulin colour, and the darker I didn't use transparency alone, because it can't remove the brown. Basal was already insulin at 25%, and that's what looked brown in dark mode. Faded orange on a dark card always does. I tried Statistics' 35/65/100 as well: basal is still brown in dark ( So the marks now differ by shape: solid bolus, hatched automatic and hollow basal. Bars have no brown left. The one-day timeline keeps a plain 25% fill, because an outline along its steps looked like small boluses, so that fill is still slightly brown in dark mode. If you'd still prefer the transparency approach, it's a small change to swap. Before and after, light and dark. The 14-day captures end a day apart, so their totals differ; the marks are the change. @damonbayer: contrast (4256c71b). You were right, the Summary text was too low. It was iOS's
These are measured from simulator captures of the 14-day view. @ps2: this moves muted text away from the system colour we settled on after your last review, because Still below these targets:
Selected tests: 455 of 457 pass, and the two failures are the existing |
ps2
left a comment
There was a problem hiding this comment.
Thanks for the latest round. The mmol/mol line now shows only with mmol/L (6adb417). Telling insulin apart by shape works, and it removes the last new colour asset (123113d). The muted text now has the higher contrast that was asked for (4256c71). A few things remain.
Translations
Localizable.xcstrings gains about 15,500 lines. About 15,200 of them are translations: all 95 new strings in 23 or 24 languages, each marked translated, and 12 existing strings that gain languages ("Average", "GMI", "High" and "Low" go from none to 23). Existing translations are unchanged.
Loop's translations come from volunteers on Lokalise, and new strings land in English. The Statistics strings this PR removes had no translations, and more than half the catalogue has fewer than 5 languages. Marked translated, these would ship as finished work and reach Lokalise as done, not queued for review. "High" and "Low" are also the glucose alarm names (GlucoseAlertManager, GlucoseAlertSettingsView), so their new translations would change the alarm names too.
Please keep the new strings English-only and let the translators pick them up through Lokalise.
One set of glucose statistics
Trends computes its own statistics in LoopHistoryMath.glucoseStats and timeInRange, beside GlucoseStatistics, which Current Setup still uses. The two can give different time in range for the same days:
GlucoseStatisticsweights each reading by the time until the next one, with gaps capped. Trends counts each reading once.- The band edges differ:
..<181/..<251there, and...180/...250here. A reading of 180.4 mg/dL, which an mmol/L sensor can produce, is in range on one screen and high on the other.
Could Trends use GlucoseStatistics, so there's one definition?
CGM coverage and reading interval
cgmActiveFraction assumes one reading every 5 minutes and caps the result at 100%. A CGM that reports every minute would always read 100%, so the 14-day, 70% GMI check would pass with gaps, and the hours a day per band would be overstated. Readings from Apple Health are thinned to one per 2½ minutes, but readings from Loop's store aren't, so the two sources disagree at the boundary. Time-based coverage, like GlucoseStatistics' gap-capped durations, would cover both.
Smaller
healthGlucosethins readings within 150 s before fingersticks are filtered out, so a fingerstick can drop a neighbouring CGM reading. Filtering first avoids it.manualTempBasalsmatchesautomatic == falseonly, so a manual temp basal whose record leavesautomaticunset doesn't count as open loop. Is that possible from any pump's history?
|
Thanks, Pete. All five points are addressed below. They're pushed as six new commits on top, with no rebase, and the description is updated. Translations (7ec63b5d)The new strings are English only now. The 23 languages on the 95 new strings are gone, and the 12 existing strings ("Average", "GMI", "High", "Low" and the rest) are back to exactly what One set of glucose statistics (f3ee252e)Trends now uses
That gives one definition:
Trends also converted to mmol/L with 18.0182 (a5d1c390), where LoopKit uses 18.0156. A 14-day mean of 7.75 mmol/L showed as 7.7 on Trends and 7.8 elsewhere. Trends now uses LoopKit's factor. CGM coverage (e2c3852b)
On the simulator, I switched the CGM to 1-minute readings and backfilled 3 hours into a day with an overnight gap. Trends shows 35% CGM active and 3.0 h in range. The old count-based method gives 100% and 8.8 h for the same readings. Smaller
Verification
🤖 Generated with Claude Code |
Trends reviews one period at a time (a day, 7, 14, 30 or 90 days) on one screen: summary tiles (average with SD and CV, GMI, insulin, carbs and boluses per day, Loop active), time in range, the daily pattern (AGP), basal and bolus, insulin per day and Loop status with its gaps. A one-day period leads with that day's timeline. Tapping a day opens a day page with the insulin timeline and active insulin and carbs, stepping a day at a time. The period exports as a PDF report or a CSV with one row per day. Inside Loop's 7 days the figures come from Loop's own stores, so manual and automatic boluses, temp basals, historical targets and presets are known. Older days come from Apple Health. Closed and open loop are recorded from launch, because Loop's automation history only covers 36 hours. Trends opens from Settings, beside Statistics, as a sheet with its own navigation and a Done button. Statistics and Current Setup are unchanged. This is part 1 of 6 splitting LoopKit#2621. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP7ynB62LNuuYMy3yvH
Trends now carries everything Statistics shows that it lacked, so it can take Statistics' place: - Consensus goals: average under 8.6 mmol/L (154 mg/dL), GMI under 7% and CV 36% or less under the summary tiles; time in range over 70%, under 25% above and 4% below, under 5% very high and 1% very low, and CGM active over 70% on the Time in range card. - Scheduled basal under Basal in Basal and bolus: the schedule that applied over the same days (the stored profile with presets), or today's schedule where the profile history doesn't reach. - "Usually X U by HH:MM": today's insulin against the median by this time over the last 14 days, from InsulinDeliveryHistory as on Statistics. Under Total so far on today's Day view, and under the Insulin per day chart on longer periods ending today. - "CGM data covers 5 of 14 days." under Summary when readings start partway through the period. - Typed-in (fingerstick) readings are left out of every figure, as on Statistics. The day timeline still draws them. Each new line reuses a pattern already on the screen: the Aim footnote, the indented line under Bolus, and the muted footnote. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP7ynB62LNuuYMy3yvH
Removes the Statistics screen and its Settings entry, and puts Trends where it was. GlucoseBand's display extension, SetupComparisonCharts, GlucoseStatistics and InsulinDeliveryHistory stay, because Current Setup uses them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
A one-day period still leads with its timeline but no longer opens a day page. The removed code, strings and tests come back in their own parts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Summary keeps glucose, carbs and boluses. Basal and bolus fold into the Insulin per day card, Loop active is only in Loop status, and "usually by now" appears once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Each summary tile carries its aim and each time-in-range band shows its target in its row. Misses are not coloured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Removes the 17 colour sets. Marks use the existing glucose, insulin, carbs and accent colours, text uses primary and secondary, and GlucoseBand.agpColor gains dark variants. The period selector is a system segmented Picker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Loop status reads dosingEnabled from SettingsStore, including the record before the period, instead of a UserDefaults record. A manual temp basal counts as open loop, as on the home screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
The Loop status note uses localCacheDuration instead of 7 days. Scheduled basal and the manual and automatic split cover only days Loop has itself, with a day count, and boluses of unknown kind are no longer counted as manual. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Time in range, basal and bolus, and Loop status rows stack at accessibility sizes instead of spilling or breaking words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Moves the smooth-curve helper into SetupComparisonCharts, its remaining user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Reads Apple Health for days before Loop's first local records, per kind of data, without overlap. Classifies each bolus from its own record and shows unknown. Always shows GMI with its IFCC value, with a note when the period is short or coverage is low. Counts time-in-range hours over CGM-covered time, restores dark-mode tile backgrounds and matches the Settings chevron. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
Limits the first-record scan to each week, treats logged injections as manual, lets a recorded manual temp basal end win, refreshes cached first records when stores change and lets the Boluses detail wrap. Adds one bolus colour set, so bolus stands apart from basal in light mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP6NkV9kiyLRBAeMMt9
HbA1c in mmol/mol goes with glucose in mmol/L, so people who use mg/dL see the GMI as a percentage only. This applies to the no-data tile too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP9CXfENBveKkXDDz3c
All insulin marks now use Loop's insulin colour, so the darker bolus colour set is gone and this PR adds no colour sets. Bolus is solid, automatic bolus is hatched and basal is an outline with a faint wash. No tint of orange reaches 3:1 against it on a white card, and faded orange turns brown on a dark one, so opacity alone can't separate them in both modes. Over one day, basal is a plain 25% fill, because an outline breaks into pieces along a stepped area and looks like small boluses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP9CXfENBveKkXDDz3c
secondaryLabel reaches 3.2:1 in light mode and 4.1:1 in dark on a Summary tile. Black at 70% and white at 85% reach 7.9:1 and 7.6:1 there, and more on cards. All of Trends' muted text uses this token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP9CXfENBveKkXDDz3c
Loop's translations come from volunteers on Lokalise, so new strings land in
English and are picked up there. The 95 new strings lose their 23 languages,
and the 12 existing strings that gained languages ("Average", "GMI", "High",
"Low" and others) are back to their next-dev entries, which keeps the glucose
alarm names unchanged. COB, IOB and unknown belong to a later part and nothing
here uses them, so they are removed too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
Trends had its own mean, SD, time in range and daily pattern beside GlucoseStatistics, which Current Setup uses, and the two could disagree: Trends counted readings where GlucoseStatistics weights them by time, and its band edges (...180, ...250) put a reading such as 180.4 mg/dL (10.0 mmol/L) in High. Trends now takes every glucose figure from GlucoseStatistics: mean, SD, CV, GMI, time in range (time-weighted, gap-capped, ..<181 and ..<251) and the daily pattern (agpProfile, 15-minute buckets). GlucoseStatistics gains an init from readings as date and mg/dL, so Apple Health readings go through it too, and the standard deviation Trends shows. LoopHistoryMath's GlucoseStats, RangeBand, timeInRange, AGPSlot, agp and percentile are gone, and the band display moves to GlucoseBand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
percentActive counted each reading as five minutes and capped the result at 100%, so a CGM reporting every minute always read 100%: the GMI's 70% check passed through gaps and the hours a day per band were overstated. Apple Health readings, thinned to one per 2.5 minutes, and Loop's own also disagreed at the boundary. Each reading now covers the time until the next, up to one five-minute slot. Current Setup's coverage check uses the same figure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
Readings from Apple Health are thinned to one per 2.5 minutes before fingersticks are left out, so a fingerstick could take the place of the CGM reading after it. Thinning now compares CGM readings only with the last CGM reading and always keeps fingersticks, which the one-day chart still draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
A dose record whose automatic is nil hasn't said whether it was manual. The temp basals Loop works out from reservoir readings are like that, so counting nil as manual would show the loop as open wherever they appear. This matches isManualTempBasalRunning on the home screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
Trends divided by 18.0182 where LoopKit uses 18.0156, so a mean of 139.62 mg/dL read 7.7 mmol/L on Trends and 7.8 on Loop's other screens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
LoopKit#2675 replaced DoseEntry's decisionId argument with doseId. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP8iKGqygup9AoAAPuE
a5d1c39 to
c89c203
Compare
|
Rebased onto Parts 2–6 are being restacked on this branch. The day page with Gaps, and Export, follow as parts 7 and 8. |















Part 1 of the series splitting #2621. Updated after Pete's review (3 November 2026): Trends now replaces Statistics, each figure appears once, and the day page, Gaps and Export have moved to follow-up parts. Updated again on 7 November 2026 for Pete's second review and the contrast request: see Colours and the first set of screenshots. Updated on 13 November 2026 for Pete's third review: Trends' glucose figures now come from
GlucoseStatistics, CGM coverage is measured by time, and the new strings are English only.Trends reviews one period at a time: a day, 7, 14, 30 or 90 days. It opens from Settings → Trends, where Statistics was, as a sheet with a Done button.
Where the figures come from
StoredSettings.dosingEnabled, whichSettingsStorekeeps for the cache duration, including the record before the period. A manual temp basal counts as open loop, as on the home screen since Show the loop as open while a manual temp basal is running #2649, from the temp basal's own record and its end or cancellation.GlucoseStatistics, which Current Setup also uses: mean, SD, CV, GMI, time in range and the daily pattern. Time in range weights each reading by the time until the next, with gaps capped. The band edges are..<181and..<251mg/dL, so 10.0 mmol/L is in range and 13.9 mmol/L is high.Colours
No new colour sets. Marks use Loop's existing
glucose,insulin,carbsandaccent; the AGP bands, target band and basal fill are those colours at reduced opacity. Time in range usesGlucoseBand.agpColor, which gains dark-mode variants (Current Setup picks these up). The period picker is a system segmentedPicker.Insulin is one colour, told apart by shape. Bolus is solid, automatic bolus is hatched and basal is an outline with a faint wash.
insulinis 2.2:1 on white, so no lighter tint of it reaches 3:1 against it, and faded orange on a dark card always looks brown. Basal was alreadyinsulinat 25%, and that's what looked brown in dark mode. Statistics' 35%, 65% and 100% gives neighbouring marks 1.27:1 and 1.30:1 in light and 1.84:1 and 1.82:1 in dark, with basal#765421in dark. Over one day, basal is a plain 25% fill, because an outline along its steps looks like small boluses. That fill still looks slightly brown in dark mode.Text. Primary text is
label. Muted text isinkMuted, black at 70% in light and white at 85% in dark, to meet WCAG AAA for normal text (7:1).secondaryLabelcan't reach that here.Measured from simulator captures of the 14-day view, using the WCAG relative-luminance formula.
Still below these targets:
SetupComparisonCharts.swift(Current Setup) still has.secondarytext that this PR doesn't change.inkMuteddoesn't respond to Increase Contrast, though it's already above 7:1.Commits
The first two are the original Trends and Statistics-parity commits. The branch is rebased onto
next-dev698fb063(21 November 2026). The review changes follow, one commit per point so each can be reviewed on its own:Screenshots
Annotated, from the
loopsimulator's demo data on this PR's latest commit. "Before" is596606a2for insulin and the build with the insulin change for contrast. The 14-day insulin captures end a day apart, so their totals differ. Most of the demo's older boluses have no manual/automatic flag, so they draw solid.Also: 30 and 90 days, one day's insulin bar, largest text.
Screenshots from the 3 November review
Annotated, with before and after where something was removed. These predate the 7 November colour and text changes, so their colours, contrast figures and the mmol/mol line in mg/dL no longer apply. From the
loopsimulator's demo data; its seeded boluses before 26 October have no manual/automatic flag, which is why much of the 14-day bolus shows as unknown.Also: Current Setup still working, Boluses tile with unknown.
Testing
On the
loopsimulator (iOS 27.0, Pump and CGM Simulators, 90 days of history), based onnext-devf7b08cad:Selected LoopTests: 460 run, 458 pass, re-run on 13 November with these changes. The two failures are
BolusEntryViewModelTests.testCarbEntryDateAndAbsorptionTimeStringand…String2, which fail the same way on plainnext-dev("12:00 PM" against "12:00").LoopHistoryMathTestscovers the boundary, manual temp basal, GMI and classification rules. The Codex follow-up adds a real-SettingsStoreregression for schedule start dates, missing profiles and the preceding setting; restoring the old queries reproduces 5 U instead of the correct 3 U.LoopDataManagerTestspasses 28/28,LoopHistoryMathTests31/31,GlucoseStatisticsTests16/16 andSetupComparisonTests8/8. New tests cover the band edges for mmol/L readings, coverage with 1-minute readings, and a fingerstick beside a CGM reading. HealthKit-hostedDeviceDataManagerTestswere not run.22 November 2026: rebased onto
next-dev698fb063, which includes #2652, so the branch builds on its own. The 22 earlier commits applied without conflicts. #2675 renamedDoseEntry(decisionId:), so commit 23 updates the Trends tests. On theloopsimulator, Trends opened from Settings and showed the 14-day and one-day views. In the isolated harness, 471 LoopTests ran; the only failures were the two clock-format assertions.Strings. New keys are English only, for Loop's translators to pick up through Lokalise. Existing keys, including the alarm names "High" and "Low", are unchanged from
next-dev. Statistics' strings and those only the moved screens used are removed.Moved to later parts
The series
#2621 is split into eight PRs in the order Pete suggested: statistics and Trends first, then the Logbook, then the home screen. Each part builds on the one before it and targets
next-dev, so a PR shows the earlier parts' commits too. #2621 stays open as the combined reference until the series lands.Rebuilt on 22 November 2026. Parts 2–8 were rebuilt on this part as it stands now. They follow the same rules: Loop's existing colours and no new colour sets in the app, new strings in English only, and loop mode read from Loop's stored settings. Each lists where it differs from #2621.
Merging. With squash merges, each next PR needs a rebase onto
next-devonce the previous one lands. I'll rebase each PR as the one before it merges.Strings. Each part adds only its own catalogue entries, in English only. GitHub's line diff of
Localizable.xcstringscan show deletions where Xcode's ordering interleaves new keys.🤖 Generated with Claude Code
https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG