fix: resolve 4 UI/planning bugs from issue tracker

- Lock all maps to North America (no pan/zoom) in ProgressMapView and TripDetailView
- Sort saved trips by most cities (stops count)
- Filter cross-country trips to top 2 by stops on home screen
- Use LocationSearchSheet for Follow Team home location (consistent with must-stop)
- Initialize DateRangePicker to show selected dates on appear

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-11 18:46:40 -06:00
parent c2f52aaccc
commit 81095a8170
9 changed files with 418 additions and 88 deletions

View File

@@ -56,7 +56,16 @@ final class SuggestedTripsGenerator {
var tripsByRegion: [(region: Region, trips: [SuggestedTrip])] {
let grouped = Dictionary(grouping: suggestedTrips) { $0.region }
return Region.allCases.compactMap { region in
guard let trips = grouped[region], !trips.isEmpty else { return nil }
guard var trips = grouped[region], !trips.isEmpty else { return nil }
// For cross-country trips, sort by most stops (descending) and limit to top 2
if region == .crossCountry {
trips = trips
.sorted { $0.trip.stops.count > $1.trip.stops.count }
.prefix(2)
.map { $0 }
}
return (region: region, trips: trips)
}
}