From 551a40ddf03c35453c92bf681bbd3be297b27940 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Sat, 19 Sep 2026 07:41:52 +0100 Subject: [PATCH] feat: show station info on long press --- FuelBoard/ContentView.swift | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/FuelBoard/ContentView.swift b/FuelBoard/ContentView.swift index b3c0547..73229b5 100644 --- a/FuelBoard/ContentView.swift +++ b/FuelBoard/ContentView.swift @@ -981,6 +981,21 @@ struct StationRow: View { return String(format: "%+.1fp", delta) } + private func handleTap() { + switch tapAction { + case .openMap: + if let url = station.mapsDirectionsURL { + UIApplication.shared.open(url) + } + case .showDetails: + showDetails() + } + } + + private func showDetails() { + onShowDetails(station) + } + var body: some View { HStack(spacing: 12) { // LEFT — round brand logo (or generic fuel pump fallback) @@ -1059,16 +1074,8 @@ struct StationRow: View { .buttonStyle(.borderless) } .contentShape(Rectangle()) - .onTapGesture { - switch tapAction { - case .openMap: - if let url = station.mapsDirectionsURL { - UIApplication.shared.open(url) - } - case .showDetails: - onShowDetails(station) - } - } + .onTapGesture(perform: handleTap) + .onLongPressGesture(perform: showDetails) } }