Fix coast-to-coast trips and improve itinerary display
- Fix same-day different-city validation in C2C routes (no more impossible games like Detroit 7:30pm AND Milwaukee 8pm on the same day) - Cap C2C trips at 14 days max with 3 middle stops, prefer shortest routes - Add sport icon and name to game rows in trip itinerary - Add horizontal scroll to route dots in suggested trip cards - Allow swipe-to-dismiss on home sheet (trip planner still blocks) - Generate travel segments for suggested trips - Increase DAG route lookahead to 5 days for multi-day drives 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,6 +97,13 @@ final class ScenarioAPlanner: ScenarioPlanner {
|
||||
stopBuilder: buildStops
|
||||
)
|
||||
|
||||
print("🔍 ScenarioA: gamesInRange=\(gamesInRange.count), validRoutes=\(validRoutes.count)")
|
||||
if let firstRoute = validRoutes.first {
|
||||
print("🔍 ScenarioA: First route has \(firstRoute.count) games")
|
||||
let cities = firstRoute.compactMap { request.stadiums[$0.stadiumId]?.city }
|
||||
print("🔍 ScenarioA: Route cities: \(cities)")
|
||||
}
|
||||
|
||||
if validRoutes.isEmpty {
|
||||
return .failure(
|
||||
PlanningFailure(
|
||||
@@ -127,8 +134,14 @@ final class ScenarioAPlanner: ScenarioPlanner {
|
||||
routesAttempted += 1
|
||||
// Build stops for this route
|
||||
let stops = buildStops(from: routeGames, stadiums: request.stadiums)
|
||||
|
||||
// Debug: show stops created from games
|
||||
let stopCities = stops.map { "\($0.city)(\($0.games.count)g)" }
|
||||
print("🔍 ScenarioA: Route \(index) - \(routeGames.count) games → \(stops.count) stops: \(stopCities)")
|
||||
|
||||
guard !stops.isEmpty else {
|
||||
routesFailed += 1
|
||||
print("⚠️ ScenarioA: Route \(index) - buildStops returned empty")
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -139,6 +152,7 @@ final class ScenarioAPlanner: ScenarioPlanner {
|
||||
) else {
|
||||
// This route fails driving constraints, skip it
|
||||
routesFailed += 1
|
||||
print("⚠️ ScenarioA: Route \(index) - ItineraryBuilder.build failed")
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -178,12 +192,24 @@ final class ScenarioAPlanner: ScenarioPlanner {
|
||||
|
||||
// Sort and rank based on leisure level
|
||||
let leisureLevel = request.preferences.leisureLevel
|
||||
|
||||
// Debug: show all options before sorting
|
||||
print("🔍 ScenarioA: \(itineraryOptions.count) itinerary options before sorting:")
|
||||
for (i, opt) in itineraryOptions.enumerated() {
|
||||
print(" Option \(i): \(opt.stops.count) stops, \(opt.totalGames) games, \(String(format: "%.1f", opt.totalDrivingHours))h driving")
|
||||
}
|
||||
|
||||
let rankedOptions = ItineraryOption.sortByLeisure(
|
||||
itineraryOptions,
|
||||
leisureLevel: leisureLevel,
|
||||
limit: request.preferences.maxTripOptions
|
||||
)
|
||||
|
||||
print("🔍 ScenarioA: Returning \(rankedOptions.count) options after sorting (limit=\(request.preferences.maxTripOptions))")
|
||||
if let first = rankedOptions.first {
|
||||
print("🔍 ScenarioA: First option has \(first.stops.count) stops")
|
||||
}
|
||||
|
||||
return .success(rankedOptions)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user