Stations: move price-rating Key (legend) into a modal sheet opened by an info button in the nav header; list stays focused on stations. Sheet = medium detent, inline nav title 'Key', Done button; legend rows unchanged. Adds -showKeySheet launch arg (QA hook for sim).
This commit is contained in:
@@ -25,6 +25,10 @@ struct StationsView: View {
|
|||||||
@State private var pageSize = 10
|
@State private var pageSize = 10
|
||||||
@State private var visibleCount = 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 {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
List {
|
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 {
|
.refreshable {
|
||||||
// Manual override for the twice-a-day cache policy.
|
// 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.
|
// only renders text, which is exactly what we want here.
|
||||||
.navigationTitle("FuelBoard")
|
.navigationTitle("FuelBoard")
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.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])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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")
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>LastAccessedDate</key>
|
<key>LastAccessedDate</key>
|
||||||
<date>2026-08-14T21:46:07Z</date>
|
<date>2026-08-14T22:47:15Z</date>
|
||||||
<key>WorkspacePath</key>
|
<key>WorkspacePath</key>
|
||||||
<string>/Users/apt/workspace/fuelboard/FuelBoard.xcodeproj</string>
|
<string>/Users/apt/workspace/fuelboard/FuelBoard.xcodeproj</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
Reference in New Issue
Block a user