fix: standardize trip name display with arrow separators app-wide

- Add `displayName` computed property to Trip model that always
  generates city list with " → " separator for consistent display
- Replace all `trip.name` usages with `trip.displayName` in UI files
- Update SuggestedTripsGenerator to use " → " separator
- Update PDFGenerator to use displayName for PDF titles

This ensures all trip names display consistently regardless of when
the trip was created or how the name was originally stored.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-14 11:36:13 -06:00
parent 2ad458bffd
commit 1e26cfebc8
30 changed files with 60 additions and 59 deletions

View File

@@ -101,7 +101,7 @@ private struct TripSelectionRow: View {
Button(action: onTap) {
HStack {
VStack(alignment: .leading, spacing: 4) {
Text(trip.name)
Text(trip.displayName)
.font(.headline)
.foregroundStyle(.primary)

View File

@@ -274,7 +274,7 @@ struct PollDetailView: View {
let rank = results.tripScores.firstIndex { $0.tripIndex == item.tripIndex }! + 1
ResultRow(
rank: rank,
tripName: trip.name,
tripName: trip.displayName,
score: item.score,
percentage: results.scorePercentage(for: item.tripIndex),
isLeader: rank == 1 && item.score > 0
@@ -420,7 +420,7 @@ private struct TripPreviewCard: View {
.background(Theme.warmOrange)
.clipShape(Capsule())
Text(trip.name)
Text(trip.displayName)
.font(.headline)
.foregroundStyle(.primary)
}
@@ -441,12 +441,6 @@ private struct TripPreviewCard: View {
}
.font(.caption)
.foregroundStyle(.secondary)
// Show cities
Text(trip.stops.map { $0.city }.joined(separator: ""))
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(2)
}
Image(systemName: "chevron.right")

View File

@@ -138,7 +138,7 @@ private struct RankingRow: View {
.clipShape(Circle())
VStack(alignment: .leading, spacing: 2) {
Text(trip.name)
Text(trip.displayName)
.font(.headline)
Text(tripSummary)