From 2e2b189b69e8b209c6e6394c172a682602844838 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Tue, 11 Aug 2026 14:19:55 +0100 Subject: [PATCH] =?UTF-8?q?Reorder:=20Fuel=20type=20=E2=86=92=20Stations?= =?UTF-8?q?=20(sort=20picker=20inside)=20=E2=86=92=20Key=20legend;=20drop?= =?UTF-8?q?=20emoji=20legend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FuelBoard/ContentView.swift | 53 ++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/FuelBoard/ContentView.swift b/FuelBoard/ContentView.swift index 59d5745..3c5e04d 100644 --- a/FuelBoard/ContentView.swift +++ b/FuelBoard/ContentView.swift @@ -49,23 +49,11 @@ struct ContentView: View { NavigationStack { List { Section { - Text("\(sortMode == .closest ? "Closest" : "Cheapest") \(selectedFuel.displayName) โ€” tap a station for directions. ๐ŸŸข great value ยท ๐ŸŸก okay ยท ๐Ÿ”ด pricey") + Text("\(sortMode == .closest ? "Closest" : "Cheapest") \(selectedFuel.displayName) โ€” tap a station for directions.") .font(.footnote) .foregroundStyle(.secondary) } - Section("Sort by") { - Picker("Sort by", selection: $sortMode) { - ForEach(SortMode.allCases) { mode in - Text(mode.displayName).tag(mode) - } - } - .pickerStyle(.segmented) - .onChange(of: sortMode) { _, newValue in - FuelStore.saveSortMode(newValue) - } - } - Section("Fuel type") { Picker("Fuel type", selection: $selectedFuel) { ForEach(FuelType.allCases) { fuel in @@ -80,6 +68,17 @@ struct ContentView: View { } Section("Stations") { + Picker("Sort by", selection: $sortMode) { + ForEach(SortMode.allCases) { mode in + Text(mode.displayName).tag(mode) + } + } + .pickerStyle(.segmented) + .onChange(of: sortMode) { _, newValue in + FuelStore.saveSortMode(newValue) + } + .padding(.vertical, 2) + if isLoading { HStack(spacing: 10) { ProgressView() @@ -101,6 +100,34 @@ struct ContentView: View { } } + Section("Key") { + HStack(spacing: 8) { + Circle().fill(.green).frame(width: 12, height: 12) + Text("Best value โ€” within 1.5p of the cheapest") + .font(.caption) + } + HStack(spacing: 8) { + Circle().fill(.orange).frame(width: 12, height: 12) + Text("Okay โ€” within 4p of the cheapest") + .font(.caption) + } + HStack(spacing: 8) { + Circle().fill(.red).frame(width: 12, height: 12) + Text("Pricey โ€” more than 4p over the cheapest") + .font(.caption) + } + HStack(spacing: 8) { + Text("TOP") + .font(.caption2.bold()) + .padding(.horizontal, 5) + .padding(.vertical, 1) + .background(Capsule().fill(.blue.opacity(0.15))) + .foregroundStyle(.blue) + Text("Top result for the current sort") + .font(.caption) + } + } + Section("Location") { if let location { Text("Using location \(String(format: "%.4f, %.4f", location.lat, location.lng))")