diff --git a/FuelBoard/StationsView.swift b/FuelBoard/StationsView.swift index 6e6b491..1c952a0 100644 --- a/FuelBoard/StationsView.swift +++ b/FuelBoard/StationsView.swift @@ -25,6 +25,10 @@ struct StationsView: View { @State private var pageSize = 10 @State private var visibleCount = 10 + /// Price-rating legend (the "Key") lives in a sheet, opened from the + /// info button in the header — keeps the list focused on stations. + @State private var showKey = false + var body: some View { NavigationStack { List { @@ -127,40 +131,6 @@ struct StationsView: 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) - } - HStack(spacing: 8) { - Image(systemName: "star.fill") - .font(.caption2) - .foregroundStyle(.yellow) - Text("Star a station to add it to Favourites") - .font(.caption) - } - } } .refreshable { // Manual override for the twice-a-day cache policy. @@ -176,6 +146,71 @@ struct StationsView: View { // only renders text, which is exactly what we want here. .navigationTitle("FuelBoard") .navigationBarTitleDisplayMode(.large) + .onAppear { + // QA hook: launch with `-showKeySheet` to verify the legend + // sheet without driving a tap (simctl has no tap command). + if ProcessInfo.processInfo.arguments.contains("-showKeySheet") { + showKey = true + } + } + .toolbar { + ToolbarItem(placement: .topBarTrailing) { + Button { + showKey = true + } label: { + Image(systemName: "info.circle") + } + .accessibilityLabel("Key") + } + } + .sheet(isPresented: $showKey) { + NavigationStack { + List { + 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) + } + HStack(spacing: 8) { + Image(systemName: "star.fill") + .font(.caption2) + .foregroundStyle(.yellow) + Text("Star a station to add it to Favourites") + .font(.caption) + } + } + } + .navigationTitle("Key") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .confirmationAction) { + Button("Done") { showKey = false } + } + } + } + .presentationDetents([.medium]) + } } } } diff --git a/build-sim/Index.noindex/DataStore/v5/records/94/FuelPriceWidget.swift-D3A4WR24QG94 b/build-sim/Index.noindex/DataStore/v5/records/94/FuelPriceWidget.swift-D3A4WR24QG94 new file mode 100644 index 0000000..bb0600c Binary files /dev/null and b/build-sim/Index.noindex/DataStore/v5/records/94/FuelPriceWidget.swift-D3A4WR24QG94 differ diff --git a/build-sim/Index.noindex/DataStore/v5/records/BX/StationsView.swift-3GIT6CXC011BX b/build-sim/Index.noindex/DataStore/v5/records/BX/StationsView.swift-3GIT6CXC011BX new file mode 100644 index 0000000..179b98e Binary files /dev/null and b/build-sim/Index.noindex/DataStore/v5/records/BX/StationsView.swift-3GIT6CXC011BX differ diff --git a/build-sim/Index.noindex/DataStore/v5/records/DO/StationsView.swift-2YA15ND8VUTDO b/build-sim/Index.noindex/DataStore/v5/records/DO/StationsView.swift-2YA15ND8VUTDO new file mode 100644 index 0000000..f361680 Binary files /dev/null and b/build-sim/Index.noindex/DataStore/v5/records/DO/StationsView.swift-2YA15ND8VUTDO differ diff --git a/build-sim/Index.noindex/DataStore/v5/records/ID/FuelPriceProvider.swift-20891C0TW4YID b/build-sim/Index.noindex/DataStore/v5/records/ID/FuelPriceProvider.swift-20891C0TW4YID new file mode 100644 index 0000000..e4bdab1 Binary files /dev/null and b/build-sim/Index.noindex/DataStore/v5/records/ID/FuelPriceProvider.swift-20891C0TW4YID differ diff --git a/build-sim/Index.noindex/DataStore/v5/records/VB/FuelPriceProvider.swift-1RCWOG4BLZRVB b/build-sim/Index.noindex/DataStore/v5/records/VB/FuelPriceProvider.swift-1RCWOG4BLZRVB new file mode 100644 index 0000000..86fd354 Binary files /dev/null and b/build-sim/Index.noindex/DataStore/v5/records/VB/FuelPriceProvider.swift-1RCWOG4BLZRVB differ diff --git a/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-1G8ESDNGSHICY b/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-1G8ESDNGSHICY index d2f465f..b087727 100644 Binary files a/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-1G8ESDNGSHICY and b/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-1G8ESDNGSHICY differ diff --git a/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-2634DJBJD0HCN b/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-2634DJBJD0HCN index 3f1f5c5..1e2b07c 100644 Binary files a/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-2634DJBJD0HCN and b/build-sim/Index.noindex/DataStore/v5/units/FuelPriceProvider.o-2634DJBJD0HCN differ diff --git a/build-sim/Index.noindex/DataStore/v5/units/FuelPriceWidget.o-2ZFZ48TCIUKF3 b/build-sim/Index.noindex/DataStore/v5/units/FuelPriceWidget.o-2ZFZ48TCIUKF3 index d00db2c..fe8315e 100644 Binary files a/build-sim/Index.noindex/DataStore/v5/units/FuelPriceWidget.o-2ZFZ48TCIUKF3 and b/build-sim/Index.noindex/DataStore/v5/units/FuelPriceWidget.o-2ZFZ48TCIUKF3 differ diff --git a/build-sim/Index.noindex/DataStore/v5/units/StationsView.o-3DC65A9313H08 b/build-sim/Index.noindex/DataStore/v5/units/StationsView.o-3DC65A9313H08 index c02eba5..3c47155 100644 Binary files a/build-sim/Index.noindex/DataStore/v5/units/StationsView.o-3DC65A9313H08 and b/build-sim/Index.noindex/DataStore/v5/units/StationsView.o-3DC65A9313H08 differ diff --git a/build-sim/ModuleCache.noindex/Session.modulevalidation b/build-sim/ModuleCache.noindex/Session.modulevalidation index 3482e3a..a131ed1 100644 --- a/build-sim/ModuleCache.noindex/Session.modulevalidation +++ b/build-sim/ModuleCache.noindex/Session.modulevalidation @@ -1 +1 @@ -1786743969.454457: Module build session file for module cache at Path(_str: "/Users/apt/workspace/fuelboard/build-sim/ModuleCache.noindex") +1786747638.063251: Module build session file for module cache at Path(_str: "/Users/apt/workspace/fuelboard/build-sim/ModuleCache.noindex") diff --git a/build-sim/SDKStatCaches.noindex/iphonesimulator26.2-23C57-7d00a8b37fbd7999ea79df8ebc024bf0.sdkstatcache b/build-sim/SDKStatCaches.noindex/iphonesimulator26.2-23C57-7d00a8b37fbd7999ea79df8ebc024bf0.sdkstatcache index 89e0fde..b798611 100644 Binary files a/build-sim/SDKStatCaches.noindex/iphonesimulator26.2-23C57-7d00a8b37fbd7999ea79df8ebc024bf0.sdkstatcache and b/build-sim/SDKStatCaches.noindex/iphonesimulator26.2-23C57-7d00a8b37fbd7999ea79df8ebc024bf0.sdkstatcache differ diff --git a/build-sim/info.plist b/build-sim/info.plist index cbe0664..ce3dcaa 100644 --- a/build-sim/info.plist +++ b/build-sim/info.plist @@ -3,7 +3,7 @@ LastAccessedDate - 2026-08-14T21:46:07Z + 2026-08-14T22:47:15Z WorkspacePath /Users/apt/workspace/fuelboard/FuelBoard.xcodeproj