Redesign trip option cards and fix various UI/planning issues
TripOptionCard improvements: - Replace horizontal route with vertical layout (start → end with arrow) - Remove rank badges (1, 2, 3, etc.) - Split stats into two rows: cities/miles and sports with game counts - Clear selection when navigating back from detail view Settings cleanup: - Remove unused settings (preferred game time, playoff games, notifications) - Convert remaining settings to sliders Planning fixes: - Fix multi-day driving calculation in canTransition - Remove over-restrictive trip rejection in TravelEstimator - Clear games cache when sport selection changes UI polish: - RoutePreviewStrip shows all cities (abbreviated) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,12 +17,6 @@ struct SettingsView: View {
|
||||
// Travel Preferences
|
||||
travelSection
|
||||
|
||||
// Game Preferences
|
||||
gamePreferencesSection
|
||||
|
||||
// Notifications
|
||||
notificationsSection
|
||||
|
||||
// Data Sync
|
||||
dataSection
|
||||
|
||||
@@ -71,13 +65,38 @@ struct SettingsView: View {
|
||||
|
||||
private var travelSection: some View {
|
||||
Section {
|
||||
Stepper(value: $viewModel.maxDrivingHoursPerDay, in: 2...12) {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Text("Max Driving Per Day")
|
||||
Spacer()
|
||||
Text("\(viewModel.maxDrivingHoursPerDay) hours")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
Slider(
|
||||
value: Binding(
|
||||
get: { Double(viewModel.maxDrivingHoursPerDay) },
|
||||
set: { viewModel.maxDrivingHoursPerDay = Int($0) }
|
||||
),
|
||||
in: 2...12,
|
||||
step: 1
|
||||
)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Text("Trip Options to Show")
|
||||
Spacer()
|
||||
Text("\(viewModel.maxTripOptions)")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
Slider(
|
||||
value: Binding(
|
||||
get: { Double(viewModel.maxTripOptions) },
|
||||
set: { viewModel.maxTripOptions = Int($0) }
|
||||
),
|
||||
in: 1...20,
|
||||
step: 1
|
||||
)
|
||||
}
|
||||
} header: {
|
||||
Text("Travel Preferences")
|
||||
@@ -86,39 +105,6 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Game Preferences Section
|
||||
|
||||
private var gamePreferencesSection: some View {
|
||||
Section {
|
||||
Picker("Preferred Game Time", selection: $viewModel.preferredGameTime) {
|
||||
ForEach(PreferredGameTime.allCases) { time in
|
||||
VStack(alignment: .leading) {
|
||||
Text(time.displayName)
|
||||
}
|
||||
.tag(time)
|
||||
}
|
||||
}
|
||||
|
||||
Toggle("Include Playoff Games", isOn: $viewModel.includePlayoffGames)
|
||||
} header: {
|
||||
Text("Game Preferences")
|
||||
} footer: {
|
||||
Text("These preferences affect trip optimization.")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Notifications Section
|
||||
|
||||
private var notificationsSection: some View {
|
||||
Section {
|
||||
Toggle("Schedule Updates", isOn: $viewModel.notificationsEnabled)
|
||||
} header: {
|
||||
Text("Notifications")
|
||||
} footer: {
|
||||
Text("Get notified when games in your trips are rescheduled.")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Data Section
|
||||
|
||||
private var dataSection: some View {
|
||||
|
||||
Reference in New Issue
Block a user