Closest mode: TOP + deltas vs the CHEAPEST within radius (not the nearest); list stays nearest-first
This commit is contained in:
@@ -10,6 +10,7 @@ struct StationsView: View {
|
||||
@Binding var sortMode: SortMode
|
||||
@Binding var stationLimit: Int
|
||||
let baselinePrice: Double?
|
||||
let topStationID: String?
|
||||
let location: Coordinate?
|
||||
let favouriteIDs: Set<String>
|
||||
var onToggleFavourite: (FuelStation) -> Void = { _ in }
|
||||
@@ -28,7 +29,7 @@ struct StationsView: View {
|
||||
Section {
|
||||
if let location {
|
||||
if sortMode == .closest {
|
||||
Text("Closest \(selectedFuel.displayName) stations — tap a station for directions.")
|
||||
Text("Closest \(selectedFuel.displayName) stations — nearest first, best value within \(stationLimit) miles.")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
} else {
|
||||
@@ -105,13 +106,13 @@ struct StationsView: View {
|
||||
Text("No \(selectedFuel.displayName) stations found.")
|
||||
.foregroundStyle(.secondary)
|
||||
} else {
|
||||
ForEach(Array(stations.prefix(visibleCount).enumerated()), id: \.element.id) { index, station in
|
||||
ForEach(Array(stations.prefix(visibleCount)), id: \.id) { station in
|
||||
StationRow(
|
||||
station: station,
|
||||
fuel: selectedFuel,
|
||||
location: location,
|
||||
baselinePrice: baselinePrice,
|
||||
isTopResult: index == 0,
|
||||
isTopResult: station.id == topStationID,
|
||||
isFavourite: favouriteIDs.contains(station.id),
|
||||
onToggleFavourite: { onToggleFavourite(station) }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user