From 4c19bffc54eb377d9cb4fc4e3ba7574812a68449 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sat, 27 Jun 2026 19:15:18 -0700 Subject: [PATCH] Activity Chart Intensity Logic Nucleic-Session: 76D64900-B16F-45BE-A6CB-E3D2EBC7C73A Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Views/HomeView.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/NucleicRemote/NucleicRemote/Views/HomeView.swift b/NucleicRemote/NucleicRemote/Views/HomeView.swift index dcb3427..5f06fd7 100644 --- a/NucleicRemote/NucleicRemote/Views/HomeView.swift +++ b/NucleicRemote/NucleicRemote/Views/HomeView.swift @@ -218,8 +218,9 @@ struct ActivityGrid: View { 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) + // days don't crush the everyday range. Shades by tokens-per-day, falling back to message + // count for days without recorded usage. Computed once for the whole grid (mirrors Mac). + let shading = ActivityShading(tokensByDay: tokensByDay, messagesByDay: activityByDay) return HStack(alignment: .top, spacing: gap) { ForEach(0..