Bläddra i källkod

Move override/temp target badges to left side of chart; remove graph compression

Badges are repositioned from topTrailing to topLeading overlay alignment.
The X-axis no longer extends 2 hours into the future when an override or
temp target is active — the chart end stays at now, same as the normal state.
t1dude 4 dagar sedan
förälder
incheckning
a4db7f5256

+ 1 - 2
LiveActivity/Views/LiveActivityChartView.swift

@@ -39,8 +39,7 @@ struct LiveActivityChartView: View {
         let now = Date()
 
         let startDate = calendar.date(byAdding: .hour, value: isWatchOS ? -3 : -6, to: now) ?? now
-        let endDate = (isOverrideActive || isTempTargetActive) ? (calendar.date(byAdding: .hour, value: 2, to: now) ?? now) :
-            (calendar.date(byAdding: .minute, value: isWatchOS ? 5 : 0, to: now) ?? now)
+        let endDate = calendar.date(byAdding: .minute, value: isWatchOS ? 5 : 0, to: now) ?? now
 
         // TODO: workaround for now: set low value to 55, to have dynamic color shades between 55 and user-set low (approx. 70); same for high glucose
         let hardCodedLow = isMgdL ? Decimal(55) : 55.asMmolL

+ 1 - 1
LiveActivity/Views/LiveActivityView.swift

@@ -62,7 +62,7 @@ struct LiveActivityView: View {
                 LiveActivityChartView(context: context, additionalState: context.state.detailedViewState)
                     .frame(maxWidth: UIScreen.main.bounds.width * 0.9)
                     .frame(height: 80)
-                    .overlay(alignment: .topTrailing) {
+                    .overlay(alignment: .topLeading) {
                         HStack(spacing: 4) {
                             if context.state.detailedViewState.isOverrideActive {
                                 Text(context.state.detailedViewState.overrideName)