From ca2a270fad60ab0f539114218d089eb9f4802835 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sat, 27 Jun 2026 19:14:40 -0700 Subject: [PATCH] Activity Chart Intensity Logic Nucleic-Session: 76D64900-B16F-45BE-A6CB-E3D2EBC7C73A Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Views/HomeView.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Views/HomeView.swift b/NucleicRemote/NucleicRemote/Views/HomeView.swift index 696e20b..0fd8dda 100644 --- a/NucleicRemote/NucleicRemote/Views/HomeView.swift +++ b/NucleicRemote/NucleicRemote/Views/HomeView.swift @@ -18,6 +18,12 @@ struct HomeView: View { Dictionary(store.dashboard.activity.map { (Calendar.current.startOfDay(for: $0.day), $0.count) }, uniquingKeysWith: +) } + /// Tokens used per day — the activity grid's primary intensity signal (falls back to message + /// count for days without recorded usage). Mirrors the Mac home. + private var tokensByDay: [Date: Int] { + Dictionary(store.dashboard.activity.map { (Calendar.current.startOfDay(for: $0.day), $0.tokens) }, + uniquingKeysWith: +) + } /// Current activity streak with streak freezes folded in — the run of consecutive active /// days, where a banked freeze (one earned per five days) bridges a missed day. Shared with