From f8014e62acaa469b642e296fa9d0a133fdd463b4 Mon Sep 17 00:00:00 2001 From: rzen Date: Sat, 11 Jul 2026 08:20:39 -0400 Subject: [PATCH] Add day navigation to the Today board toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Back/forward chevrons step the board a day at a time around the existing calendar button, and a Today button — shown only when the board is off today — jumps back. Also add the missing changelog entries for the Today board itself. Claude-Session: https://claude.ai/code/session_012qw2itfzKyEJ1HpsFt8Ex4 --- CHANGELOG.md | 4 ++++ Workouts/Views/Today/TodayView.swift | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b196ca8..197fef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ **July 2026** +A new Today board is the app's home tab: schedule routines by day, grouped by goal, and start or review each day's workouts from one place. + +The Today board can step back and forth by day or jump to any date from a calendar that dots the days with logged workouts. + A new Progress tab shows weekly goal streaks, workout trends, per-exercise weight progression, achievements, and your full workout history. A new Meditation exercise and matching starter routine let you log timed sits, recorded in Apple Health as Mind & Body sessions. diff --git a/Workouts/Views/Today/TodayView.swift b/Workouts/Views/Today/TodayView.swift index e655ffc..12afa1f 100644 --- a/Workouts/Views/Today/TodayView.swift +++ b/Workouts/Views/Today/TodayView.swift @@ -123,12 +123,28 @@ struct TodayView: View { } .navigationTitle(isViewingToday ? "\(greetingLine) Today" : selectedDate.formatDate()) .toolbar { - ToolbarItem(placement: .topBarLeading) { + ToolbarItemGroup(placement: .topBarLeading) { + Button { + shiftDay(by: -1) + } label: { + Label("Previous Day", systemImage: "chevron.backward") + } Button { showingDayPicker = true } label: { Label("Go to Day", systemImage: "calendar") } + Button { + shiftDay(by: 1) + } label: { + Label("Next Day", systemImage: "chevron.forward") + } + // Quick way home — redundant on today itself, so hidden there. + if !isViewingToday { + Button("Today") { + withAnimation { selectedDate = Date() } + } + } } ToolbarItem(placement: .topBarTrailing) { Button { @@ -243,6 +259,14 @@ struct TodayView: View { .background(.secondary.opacity(0.15), in: Capsule()) } + /// Step the viewed day back or forward (day precision; the time component is + /// irrelevant to the board). + private func shiftDay(by days: Int) { + withAnimation { + selectedDate = Calendar.current.date(byAdding: .day, value: days, to: selectedDate) ?? selectedDate + } + } + // MARK: - Resolution helpers /// The live routine this schedule points at, following the seed clone-on-edit