Give the Progress tab a rotating daily title greeting
Claude-Session: https://claude.ai/code/session_01PKptrgbx74peTwHGRxBojv
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user