fix: 12 planning engine bugs + App Store preview export at 886x1920
Planning engine fixes (from adversarial code review): - Bug #1: sortByLeisure tie-breaking uses totalDrivingHours - Bug #2: allDates/calculateRestDays guard-let-break prevents infinite loop - Bug #3: same-day trip no longer rejected (>= in dateRange guard) - Bug #4: ScenarioD rationale shows game count not stop count - Bug #5: ScenarioD departureDate advanced to next day after last game - Bug #6: ScenarioC date range boundary uses <= instead of < - Bug #7: DrivingConstraints clamps maxHoursPerDriverPerDay via max(1.0,...) - Bug #8: effectiveTripDuration uses inclusive day counting (+1) - Bug #9: TripWizardViewModel validates endDate >= startDate - Bug #10: allDates() uses min/max instead of first/last for robustness - Bug #12: arrivalBeforeGameStart accounts for game end time at departure - Bug #15: ScenarioBPlanner replaces force unwraps with safe unwrapping Tests: 16 regression test suites + updated existing test expectations Marketing: Remotion canvas set to 886x1920 for App Store preview spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,14 @@ enum ScenarioPlannerFactory {
|
||||
return ScenarioEPlanner()
|
||||
}
|
||||
|
||||
// Scenario D fallback: Team-First with single team → follow that team
|
||||
if request.preferences.planningMode == .teamFirst &&
|
||||
request.preferences.selectedTeamIds.count == 1 {
|
||||
// Single team in teamFirst mode → treat as follow-team
|
||||
print("🔍 ScenarioPlannerFactory: → ScenarioDPlanner (team-first single team)")
|
||||
return ScenarioDPlanner()
|
||||
}
|
||||
|
||||
// Scenario D: User wants to follow a specific team
|
||||
if request.preferences.followTeamId != nil {
|
||||
print("🔍 ScenarioPlannerFactory: → ScenarioDPlanner (follow team)")
|
||||
@@ -94,6 +102,11 @@ enum ScenarioPlannerFactory {
|
||||
request.preferences.selectedTeamIds.count >= 2 {
|
||||
return .scenarioE
|
||||
}
|
||||
// Scenario D fallback: Team-First with single team → follow that team
|
||||
if request.preferences.planningMode == .teamFirst &&
|
||||
request.preferences.selectedTeamIds.count == 1 {
|
||||
return .scenarioD
|
||||
}
|
||||
if request.preferences.followTeamId != nil {
|
||||
return .scenarioD
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user