diff --git a/NucleicRemote/NucleicRemote/Views/HomeView.swift b/NucleicRemote/NucleicRemote/Views/HomeView.swift index 9dd27f5..28f6941 100644 --- a/NucleicRemote/NucleicRemote/Views/HomeView.swift +++ b/NucleicRemote/NucleicRemote/Views/HomeView.swift @@ -14,6 +14,9 @@ struct HomeView: View { private var running: [WireSessionSummary] { store.liveSessions.filter { $0.status == .running }.sorted { $0.updatedAt > $1.updatedAt } } + /// Outstanding to-dos — everything not yet done (open + dispatched), matching the count the + /// To-dos tab lists. The Mac surfaces this elsewhere on its home; the phone gets a stat card. + private var openTodoCount: Int { store.dashboard.todos.filter { $0.status != .done }.count } private var activityByDay: [Date: Int] { Dictionary(store.dashboard.activity.map { (Calendar.current.startOfDay(for: $0.day), $0.count) }, uniquingKeysWith: +) @@ -99,13 +102,14 @@ struct HomeView: View { } private var statCards: some View { - // Flow the cards into two rows (3 + 2) so each gets ~a third of the width rather than a - // fifth — enough room for labels like "In progress" and full token counts to render cleanly + // Flow the cards into two rows of three so each gets ~a third of the width rather than a + // sixth — enough room for labels like "In progress" and full token counts to render cleanly // instead of wrapping or truncating. LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: 3), spacing: 12) { StatCard(value: counts.projects, label: "Projects", icon: "folder") StatCard(value: running.count, label: "In progress", icon: "circle.lefthalf.filled") StatCard(value: counts.activeChats, label: "Active", icon: "bolt") + StatCard(value: openTodoCount, label: "To-dos", icon: "checklist") StatCard(value: counts.messages, label: "Messages", icon: "paperplane") StatCard(values: TokenCount.adaptiveCandidates(counts.tokens), label: "Tokens", icon: "text.word.spacing") }