Refactor travel segments and simplify trip options
Travel segment architecture: - Remove departureTime/arrivalTime from TravelSegment (location-based, not date-based) - Fix travel sections appearing after destination instead of between cities - Fix missing travel segments when revisiting same city (consecutive grouping) - Remove unwanted rest day at end of trip Planning engine fixes: - All three planners now group only consecutive games at same stadium - Visiting A → B → A creates 3 stops with proper travel between UI simplification: - Remove redundant sort options (mostDriving/leastDriving, mostCities/leastCities) - Remove unused "Find Other Sports Along Route" toggle (was dead code) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -326,18 +326,8 @@ struct TravelEstimatorTests {
|
||||
#expect(twoDrivers != nil, "Should succeed with two drivers - within 32h limit")
|
||||
}
|
||||
|
||||
@Test("estimate stops - calculates departure and arrival times")
|
||||
func estimateStops_CalculatesTimes() {
|
||||
let baseDate = Calendar.current.date(from: DateComponents(year: 2026, month: 4, day: 5))!
|
||||
let stop1 = makeStop(city: "Los Angeles", latitude: 34.0522, longitude: -118.2437, departureDate: baseDate)
|
||||
let stop2 = makeStop(city: "San Diego", latitude: 32.7157, longitude: -117.1611)
|
||||
|
||||
let segment = TravelEstimator.estimate(from: stop1, to: stop2, constraints: defaultConstraints())
|
||||
|
||||
#expect(segment != nil)
|
||||
#expect(segment!.departureTime > baseDate, "Departure should be after base date (adds 8 hours)")
|
||||
#expect(segment!.arrivalTime > segment!.departureTime, "Arrival should be after departure")
|
||||
}
|
||||
// Note: departure/arrival time tests removed - travel is now location-based, not time-based
|
||||
// The user decides when to travel; segments only describe route info (distance, duration)
|
||||
|
||||
@Test("estimate stops - distance and duration are consistent")
|
||||
func estimateStops_DistanceDurationConsistent() {
|
||||
|
||||
Reference in New Issue
Block a user