feat(progress): add progress tracking enhancements

- Enable zoom/pan on progress map with reset button
- Add visit count badges to stadium chips
- Create GamesHistoryView with year grouping and sport filters
- Create StadiumVisitHistoryView for viewing all visits to a stadium
- Add VisitListCard and GamesHistoryRow components
- Add "See All" navigation from Recent Visits to Games History
- Add tests for map interactions, visit lists, and games history

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-12 21:34:33 -06:00
parent ed526cabeb
commit 89167c01d7
11 changed files with 979 additions and 16 deletions

View File

@@ -0,0 +1,65 @@
import SwiftUI
struct GamesHistoryRow: View {
let visit: StadiumVisit
let stadium: Stadium?
var body: some View {
HStack(spacing: 12) {
// Sport icon
if let stadium {
Image(systemName: sportIcon(for: stadium.sport))
.font(.title3)
.foregroundStyle(stadium.sport.themeColor)
.frame(width: 32)
}
// Visit info
VStack(alignment: .leading, spacing: 4) {
// Date
Text(visit.visitDate.formatted(date: .abbreviated, time: .omitted))
.font(.subheadline.bold())
// Teams (if game)
if let matchup = visit.matchupDescription {
Text(matchup)
.font(.caption)
.foregroundStyle(.secondary)
} else {
Text(visit.stadiumNameAtVisit)
.font(.caption)
.foregroundStyle(.secondary)
}
}
Spacer()
// Chevron
Image(systemName: "chevron.right")
.font(.caption)
.foregroundStyle(.tertiary)
}
.padding()
.background(Color(.systemBackground))
.clipShape(RoundedRectangle(cornerRadius: 10))
}
private func sportIcon(for sport: Sport) -> String {
switch sport {
case .mlb: return "baseball"
case .nba: return "basketball"
case .nhl: return "hockey.puck"
case .nfl: return "football"
case .mls: return "soccerball"
@unknown default: return "sportscourt"
}
}
}
#Preview {
VStack {
Text("GamesHistoryRow Preview")
}
.padding()
.background(Color(.systemGroupedBackground))
}