Give the Progress tab a rotating daily title greeting

Claude-Session: https://claude.ai/code/session_01PKptrgbx74peTwHGRxBojv
This commit is contained in:
2026-07-12 00:37:05 -04:00
parent c24bc9cfeb
commit 530021c2de
+24 -1
View File
@@ -26,6 +26,29 @@ struct ProgressTabView: View {
@Query(sort: \Workout.start, order: .reverse)
private var workouts: [Workout]
/// Motivational openers for the tab title each reads as a phrase completed
/// by "Progress" ("See Your Progress"), mirroring the Today board's rotating
/// greeting. One per day, rotating by day-of-era: stable all day, fresh the next.
private static let greetings: [String] = [
"See Your",
"Own Your",
"Earn Your",
"Trust Your",
"Watch Your",
"Feel the",
"Proof of",
"Chase",
"Celebrate",
"Measure Your",
"Honor Your",
"Fuel Your",
]
private var greetingLine: String {
let day = Calendar.current.ordinality(of: .day, in: .era, for: Date()) ?? 0
return Self.greetings[day % Self.greetings.count]
}
var body: some View {
NavigationStack {
ScrollView {
@@ -57,7 +80,7 @@ struct ProgressTabView: View {
}
.defaultScrollAnchor(initialAnchor)
.background(Color(.systemGroupedBackground))
.navigationTitle("Progress")
.navigationTitle("\(greetingLine) Progress")
}
}