From 09d4c80edf3826ca1b0693f8cef59cd823c8341e Mon Sep 17 00:00:00 2001 From: Nucleic Date: Fri, 26 Jun 2026 01:18:11 -0700 Subject: [PATCH] Streak Freeze Feature Implementation Nucleic-Session: 89DB7BC1-F74C-4768-BC7B-25F898265E0E --- NucleicRemote/NucleicRemote/Views/HomeView.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/NucleicRemote/NucleicRemote/Views/HomeView.swift b/NucleicRemote/NucleicRemote/Views/HomeView.swift index 643a0e9..6c240f7 100644 --- a/NucleicRemote/NucleicRemote/Views/HomeView.swift +++ b/NucleicRemote/NucleicRemote/Views/HomeView.swift @@ -36,7 +36,10 @@ struct HomeView: View { } var body: some View { - NavigationStack { + // Computed once and threaded down so the badge and grid agree on the streak and which + // days a freeze bridged. + let streak = streakState + return NavigationStack { ScrollView { VStack(alignment: .leading, spacing: 22) { HStack(alignment: .top) { @@ -45,14 +48,14 @@ struct HomeView: View { Text(subtitle).font(.subheadline).foregroundStyle(.secondary) } Spacer() - if streak > 0 { StreakBadge(days: streak) } + if streak.streak > 0 { StreakBadge(days: streak.streak, freezes: streak.availableFreezes) } } statCards VStack(alignment: .leading, spacing: 10) { Text("Activity").font(.headline) - ActivityGrid(activityByDay: activityByDay) + ActivityGrid(activityByDay: activityByDay, frozenDays: streak.frozenDays) } .frame(maxWidth: .infinity, alignment: .leading) .card()