Fix game times with UTC data, restructure schedule by date
- Update games_canonical.json to use ISO 8601 UTC timestamps (game_datetime_utc) - Fix BootstrapService timezone-aware parsing for venue-local fallback - Fix thread-unsafe shared DateFormatter in RichGame local time display - Bump SchemaVersion to 4 to force re-bootstrap with correct UTC data - Restructure schedule view: group by date instead of sport, with sport icons on each row and date section headers showing game counts - Fix schedule row backgrounds using Theme.cardBackground instead of black - Sort games by UTC time with local-time tiebreaker for same-instant games Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -269,7 +269,8 @@ struct TripDetailView: View {
|
||||
Task { await deleteItineraryItem(item) }
|
||||
},
|
||||
onAddButtonTapped: { day in
|
||||
addItemAnchor = AddItemAnchor(day: day)
|
||||
let coord = coordinateForDay(day)
|
||||
addItemAnchor = AddItemAnchor(day: day, regionCoordinate: coord)
|
||||
}
|
||||
)
|
||||
.ignoresSafeArea(edges: .bottom)
|
||||
@@ -692,7 +693,8 @@ struct TripDetailView: View {
|
||||
DropTargetIndicator()
|
||||
}
|
||||
InlineAddButton {
|
||||
addItemAnchor = AddItemAnchor(day: day)
|
||||
let coord = coordinateForDay(day)
|
||||
addItemAnchor = AddItemAnchor(day: day, regionCoordinate: coord)
|
||||
}
|
||||
}
|
||||
.onDrop(of: [.text, .plainText, .utf8PlainText], isTargeted: Binding(
|
||||
@@ -1285,6 +1287,12 @@ struct TripDetailView: View {
|
||||
return allItems
|
||||
}
|
||||
|
||||
/// Returns the coordinate of the first stop on the given day, for location-biased search.
|
||||
private func coordinateForDay(_ day: Int) -> CLLocationCoordinate2D? {
|
||||
let tripDay = trip.itineraryDays().first { $0.dayNumber == day }
|
||||
return tripDay?.stops.first?.coordinate
|
||||
}
|
||||
|
||||
private func toggleSaved() {
|
||||
if isSaved {
|
||||
unsaveTrip()
|
||||
@@ -1615,6 +1623,7 @@ enum ItinerarySection {
|
||||
struct AddItemAnchor: Identifiable {
|
||||
let id = UUID()
|
||||
let day: Int
|
||||
let regionCoordinate: CLLocationCoordinate2D?
|
||||
}
|
||||
|
||||
// MARK: - Inline Add Button
|
||||
@@ -2100,7 +2109,8 @@ private struct SheetModifiers: ViewModifier {
|
||||
QuickAddItemSheet(
|
||||
tripId: tripId,
|
||||
day: anchor.day,
|
||||
existingItem: nil
|
||||
existingItem: nil,
|
||||
regionCoordinate: anchor.regionCoordinate
|
||||
) { item in
|
||||
Task { await saveItineraryItem(item) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user