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:
@@ -42,9 +42,6 @@ final class ScenarioCPlanner: ScenarioPlanner {
|
||||
|
||||
// MARK: - Configuration
|
||||
|
||||
/// Maximum number of itinerary options to return
|
||||
private let maxOptions = 5
|
||||
|
||||
/// Tolerance for "forward progress" - allow small increases in distance to end
|
||||
/// A stadium is "directional" if it doesn't increase distance to end by more than this ratio
|
||||
private let forwardProgressTolerance = 0.15 // 15% tolerance
|
||||
@@ -262,29 +259,15 @@ final class ScenarioCPlanner: ScenarioPlanner {
|
||||
)
|
||||
}
|
||||
|
||||
// Sort by game count (most first), then by driving hours (less first)
|
||||
let sorted = allItineraryOptions.sorted { a, b in
|
||||
let aGames = a.stops.flatMap { $0.games }.count
|
||||
let bGames = b.stops.flatMap { $0.games }.count
|
||||
if aGames != bGames {
|
||||
return aGames > bGames
|
||||
}
|
||||
return a.totalDrivingHours < b.totalDrivingHours
|
||||
}
|
||||
// Sort and rank based on leisure level
|
||||
let leisureLevel = request.preferences.leisureLevel
|
||||
let rankedOptions = ItineraryOption.sortByLeisure(
|
||||
allItineraryOptions,
|
||||
leisureLevel: leisureLevel,
|
||||
limit: request.preferences.maxTripOptions
|
||||
)
|
||||
|
||||
// Take top N and re-rank
|
||||
let rankedOptions = sorted.prefix(maxOptions).enumerated().map { index, option in
|
||||
ItineraryOption(
|
||||
rank: index + 1,
|
||||
stops: option.stops,
|
||||
travelSegments: option.travelSegments,
|
||||
totalDrivingHours: option.totalDrivingHours,
|
||||
totalDistanceMiles: option.totalDistanceMiles,
|
||||
geographicRationale: option.geographicRationale
|
||||
)
|
||||
}
|
||||
|
||||
print("[ScenarioC] Returning \(rankedOptions.count) itinerary options")
|
||||
print("[ScenarioC] Returning \(rankedOptions.count) itinerary options (leisure: \(leisureLevel.rawValue))")
|
||||
return .success(Array(rankedOptions))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user