Remove debug prints and fix build warnings

- Remove all print statements from planning engine, data providers, and PDF generation
- Fix deprecated CLGeocoder usage with MKLocalSearch for iOS 26
- Fix Swift 6 actor isolation by converting PDFGenerator/ExportService to @MainActor
- Add @retroactive to CLLocationCoordinate2D protocol conformances
- Fix unused variable warnings in GameDAGRouter and scenario planners
- Remove unreachable catch blocks in SettingsViewModel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-08 13:25:27 -06:00
parent fbb5ae683e
commit 045fcd9c07
20 changed files with 188 additions and 303 deletions

View File

@@ -76,14 +76,12 @@ enum ItineraryBuilder {
to: toStop,
constraints: constraints
) else {
print("\(logPrefix) Failed to estimate travel: \(fromStop.city) -> \(toStop.city)")
return nil
}
// Run optional validator (e.g., arrival time check for Scenario B)
if let validator = segmentValidator {
if !validator(segment, fromStop, toStop) {
print("\(logPrefix) Segment validation failed: \(fromStop.city) -> \(toStop.city)")
return nil
}
}
@@ -97,7 +95,6 @@ enum ItineraryBuilder {
// Verify invariant: segments = stops - 1
//
guard travelSegments.count == stops.count - 1 else {
print("\(logPrefix) Invariant violated: \(travelSegments.count) segments for \(stops.count) stops")
return nil
}
@@ -147,9 +144,8 @@ enum ItineraryBuilder {
searchRadiusMiles: 5.0,
intervalMiles: 100.0
)
print("[ItineraryBuilder] Found \(evChargers.count) EV chargers: \(segment.fromLocation.name) -> \(segment.toLocation.name)")
} catch {
print("[ItineraryBuilder] EV charger search failed: \(error.localizedDescription)")
// EV charger search failed - continue without chargers
}
}
@@ -167,7 +163,7 @@ enum ItineraryBuilder {
enrichedSegments.append(enrichedSegment)
} catch {
print("[ItineraryBuilder] Route calculation failed, keeping original: \(error.localizedDescription)")
// Route calculation failed - keep original segment
enrichedSegments.append(segment)
}
}
@@ -252,7 +248,6 @@ enum ItineraryBuilder {
// Get coordinates
guard let fromCoord = fromStop.coordinate,
let toCoord = toStop.coordinate else {
print("\(logPrefix) Missing coordinates: \(fromStop.city) -> \(toStop.city)")
// Fall back to estimate
guard let segment = TravelEstimator.estimate(
from: fromStop,
@@ -283,9 +278,7 @@ enum ItineraryBuilder {
searchRadiusMiles: 5.0,
intervalMiles: 100.0
)
print("\(logPrefix) Found \(evChargers.count) EV chargers: \(fromStop.city) -> \(toStop.city)")
} catch {
print("\(logPrefix) EV charger search failed: \(error.localizedDescription)")
// Continue without chargers - not a critical failure
}
}
@@ -302,7 +295,6 @@ enum ItineraryBuilder {
// Run optional validator
if let validator = segmentValidator {
if !validator(segment, fromStop, toStop) {
print("\(logPrefix) Segment validation failed: \(fromStop.city) -> \(toStop.city)")
return nil
}
}
@@ -312,7 +304,6 @@ enum ItineraryBuilder {
totalDistance += segment.estimatedDistanceMiles
} catch {
print("\(logPrefix) Route calculation failed, using estimate: \(error.localizedDescription)")
// Fall back to estimate
guard let segment = TravelEstimator.estimate(
from: fromStop,
@@ -329,7 +320,6 @@ enum ItineraryBuilder {
// Verify invariant
guard travelSegments.count == stops.count - 1 else {
print("\(logPrefix) Invariant violated: \(travelSegments.count) segments for \(stops.count) stops")
return nil
}
@@ -366,7 +356,6 @@ enum ItineraryBuilder {
let deadline = gameStart.addingTimeInterval(-bufferSeconds)
if earliestArrival > deadline {
print("[ItineraryBuilder] Cannot arrive in time: earliest arrival \(earliestArrival) > deadline \(deadline)")
return false
}
return true