fix: add contentShape to all tappable rows so entire row area registers taps

Adds .contentShape(Rectangle()) or .contentShape(Capsule()) to 11 buttons,
NavigationLinks, and onTapGesture handlers across 8 files where only the
visible content (text/icons) was receiving taps instead of the full row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-20 13:30:41 -06:00
parent 1b05f0ebaf
commit e2d449046b
8 changed files with 11 additions and 0 deletions

View File

@@ -147,6 +147,7 @@ struct HomeContent_Classic: View {
selectedSuggestedTrip = suggestedTrip selectedSuggestedTrip = suggestedTrip
} label: { } label: {
SuggestedTripCard(suggestedTrip: suggestedTrip) SuggestedTripCard(suggestedTrip: suggestedTrip)
.contentShape(Rectangle())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
} }
@@ -233,6 +234,7 @@ struct HomeContent_Classic: View {
TripDetailView(trip: trip) TripDetailView(trip: trip)
} label: { } label: {
classicTripCard(savedTrip: savedTrip, trip: trip) classicTripCard(savedTrip: savedTrip, trip: trip)
.contentShape(Rectangle())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.staggeredAnimation(index: index, delay: 0.05) .staggeredAnimation(index: index, delay: 0.05)

View File

@@ -318,6 +318,7 @@ struct PollDetailView: View {
selectedTrip = trip selectedTrip = trip
} label: { } label: {
TripPreviewCard(trip: trip, index: index + 1) TripPreviewCard(trip: trip, index: index + 1)
.contentShape(Rectangle())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
} }

View File

@@ -87,6 +87,7 @@ struct PollsListView: View {
ForEach(polls) { poll in ForEach(polls) { poll in
NavigationLink(value: poll) { NavigationLink(value: poll) {
PollRowView(poll: poll) PollRowView(poll: poll)
.contentShape(Rectangle())
} }
} }
} }

View File

@@ -209,6 +209,7 @@ struct AchievementsListView: View {
) { ) {
ForEach(filtered) { achievement in ForEach(filtered) { achievement in
AchievementCard(achievement: achievement) AchievementCard(achievement: achievement)
.contentShape(Rectangle())
.onTapGesture { .onTapGesture {
selectedAchievement = achievement selectedAchievement = achievement
} }
@@ -283,6 +284,7 @@ struct SportFilterButton: View {
.background(isSelected ? color : Theme.cardBackground(colorScheme)) .background(isSelected ? color : Theme.cardBackground(colorScheme))
.foregroundStyle(isSelected ? .white : Theme.textPrimary(colorScheme)) .foregroundStyle(isSelected ? .white : Theme.textPrimary(colorScheme))
.clipShape(Capsule()) .clipShape(Capsule())
.contentShape(Capsule())
.overlay { .overlay {
Capsule() Capsule()
.stroke(isSelected ? Color.clear : color.opacity(0.3), lineWidth: 1) .stroke(isSelected ? Color.clear : color.opacity(0.3), lineWidth: 1)

View File

@@ -135,6 +135,7 @@ private struct SportChip: View {
Capsule() Capsule()
.fill(isSelected ? sport.themeColor : Theme.cardBackgroundElevated(colorScheme)) .fill(isSelected ? sport.themeColor : Theme.cardBackgroundElevated(colorScheme))
) )
.contentShape(Capsule())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.accessibilityValue(isSelected ? "Selected" : "Not selected") .accessibilityValue(isSelected ? "Selected" : "Not selected")
@@ -173,6 +174,7 @@ private struct GamesListByYear: View {
visit: visit, visit: visit,
stadium: AppDataProvider.shared.stadium(for: visit.stadiumId) stadium: AppDataProvider.shared.stadium(for: visit.stadiumId)
) )
.contentShape(Rectangle())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
} }

View File

@@ -236,6 +236,7 @@ struct SportFilterChip: View {
.background(isSelected ? Color.blue : Color(.secondarySystemBackground)) .background(isSelected ? Color.blue : Color(.secondarySystemBackground))
.foregroundStyle(isSelected ? .white : .primary) .foregroundStyle(isSelected ? .white : .primary)
.clipShape(Capsule()) .clipShape(Capsule())
.contentShape(Capsule())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.accessibilityIdentifier("schedule.sport.\(sport.rawValue.lowercased())") .accessibilityIdentifier("schedule.sport.\(sport.rawValue.lowercased())")

View File

@@ -609,6 +609,7 @@ struct TripOptionCard: View {
.padding(Theme.Spacing.md) .padding(Theme.Spacing.md)
.background(Theme.cardBackground(colorScheme)) .background(Theme.cardBackground(colorScheme))
.clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium)) .clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium))
.contentShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium))
.overlay { .overlay {
RoundedRectangle(cornerRadius: Theme.CornerRadius.medium) RoundedRectangle(cornerRadius: Theme.CornerRadius.medium)
.stroke(Theme.surfaceGlow(colorScheme), lineWidth: 1) .stroke(Theme.surfaceGlow(colorScheme), lineWidth: 1)

View File

@@ -97,6 +97,7 @@ struct TeamPickerStep: View {
.padding(Theme.Spacing.md) .padding(Theme.Spacing.md)
.background(Theme.cardBackgroundElevated(colorScheme)) .background(Theme.cardBackgroundElevated(colorScheme))
.clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium)) .clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium))
.contentShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium))
.overlay( .overlay(
RoundedRectangle(cornerRadius: Theme.CornerRadius.medium) RoundedRectangle(cornerRadius: Theme.CornerRadius.medium)
.stroke(Theme.textMuted(colorScheme).opacity(0.3), lineWidth: 1) .stroke(Theme.textMuted(colorScheme).opacity(0.3), lineWidth: 1)