feat(itinerary): reorder Add button after day header + comprehensive docs

- Move Add button to appear immediately after Day header (before games)
- Split games out of dayHeader into separate row for correct ordering
- Add 600+ lines of inline documentation to ItineraryTableViewController
- Document architecture decisions, data flow, constraints, and algorithms
- Add function-level comments explaining drag/drop, sortOrder calculation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-17 10:07:37 -06:00
parent 2a8bfeeff8
commit f84addb39d
3 changed files with 671 additions and 130 deletions

View File

@@ -159,6 +159,9 @@ struct ItineraryTableViewWrapper<HeaderContent: View>: UIViewControllerRepresent
// Travel before this day (travel is stored on the destination day)
let travelBefore: TravelSegment? = travelByDay[dayNum]
// ONE Add button per day - always first after day header
items.append(ItineraryRowItem.addButton(day: dayNum))
// Custom items for this day - simply filter by day and sort by sortOrder
let dayItems = customItems.filter { $0.day == dayNum }
.sorted { $0.sortOrder < $1.sortOrder }
@@ -167,9 +170,6 @@ struct ItineraryTableViewWrapper<HeaderContent: View>: UIViewControllerRepresent
items.append(ItineraryRowItem.customItem(item))
}
// ONE Add button per day
items.append(ItineraryRowItem.addButton(day: dayNum))
let dayData = ItineraryDayData(
id: dayNum,
dayNumber: dayNum,

View File

@@ -837,14 +837,14 @@ struct TripDetailView: View {
// Custom items for this day (sorted by sortOrder)
if allowCustomItems {
// Add button first - always right after day header
sections.append(.addButton(day: dayNum))
let dayItems = customItems.filter { $0.day == dayNum }
.sorted { $0.sortOrder < $1.sortOrder }
for item in dayItems {
sections.append(.customItem(item))
}
// One add button per day
sections.append(.addButton(day: dayNum))
}
}