From eff0b841149194f265208554372c4589768404cc Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sat, 27 Jun 2026 15:46:04 -0700 Subject: [PATCH] Streak Square Brightness Logic Nucleic-Session: 129BD35A-FB15-4E39-82E2-F476950F60AD Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Views/HomeView.swift | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/NucleicRemote/NucleicRemote/Views/HomeView.swift b/NucleicRemote/NucleicRemote/Views/HomeView.swift index 449e128..696e20b 100644 --- a/NucleicRemote/NucleicRemote/Views/HomeView.swift +++ b/NucleicRemote/NucleicRemote/Views/HomeView.swift @@ -192,6 +192,9 @@ struct ActivityGrid: View { let weekday = cal.component(.weekday, from: today) let startOfWeek = cal.date(byAdding: .day, value: -(weekday - 1), to: today)! let gridStart = cal.date(byAdding: .day, value: -7 * (weeks - 1), to: startOfWeek)! + // Brightness relative to *this user's* activity, outliers excluded so a few marathon + // days don't crush the everyday range. Computed once for the whole grid (mirrors Mac). + let scale = ActivityScale(activityByDay: activityByDay) return HStack(alignment: .top, spacing: gap) { ForEach(0.. Int { - switch count { - case 0: 0 - case 1...2: 1 - case 3...5: 2 - default: 3 - } - } }