From f04a0fe0f55a894367d52e5a2f512268c5a47d2d Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Wed, 14 Oct 2026 15:19:20 +0100 Subject: [PATCH] Key sheet: gate the How Best Value row on the feature, like the More info row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The More info row went inside the Best Value card's `if let fuelSavings`, but the Key sheet row was left ungated, so it stayed visible with Best Value switched off. It is now gated on `fuelSavingsSettings.isConfigured` — exactly the condition `savingsForStation` uses, i.e. the same gate as the card — so the two rows appear and disappear together. Verified on the simulator by toggling Best Value in Settings and scrolling the Key sheet to its end (four drags, sheet still up and its footer in view each time): - OFF: the row is absent at every scroll position, and the More info sheet shows neither the card nor the row; - ON: the row is present, and the More info card and its row are both back. 210 tests pass; Release builds. --- FuelBoard/StationsView.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/FuelBoard/StationsView.swift b/FuelBoard/StationsView.swift index 91e38b2..02a0671 100644 --- a/FuelBoard/StationsView.swift +++ b/FuelBoard/StationsView.swift @@ -317,11 +317,14 @@ struct StationsView: View { } // The explanation is its own sheet now, opened from this - // row. Deliberately NOT gated by Best Value: the Key sheet - // is the legend and is reachable whatever the feature is - // doing. - Section { - HowBestValueRow { showBestValueInfo = true } + // row. Gated exactly like the More info row and the Best + // Value card itself: `isConfigured` is the same condition + // `savingsForStation` uses, so the row appears and + // disappears with the feature. + if fuelSavingsSettings.isConfigured { + Section { + HowBestValueRow { showBestValueInfo = true } + } } } .navigationTitle("Key")