Simplify shared fill-up wording and help
This commit is contained in:
@@ -69,6 +69,15 @@ struct FavouritesView: View {
|
||||
}
|
||||
private var cheapestPrice: Double? { cheapest?.prices[activeFuel] }
|
||||
|
||||
/// The baseline note is useful only when at least one visible favourite has
|
||||
/// an actual savings comparison. An unavailable result (for example, while
|
||||
/// location is missing) must not leave an orphaned explanation below the list.
|
||||
private var showsSavingsComparisonExplanation: Bool {
|
||||
fuelSavingsSettings.isConfigured && ordered.contains { station in
|
||||
savingsForStation(station)?.result != nil
|
||||
}
|
||||
}
|
||||
|
||||
/// IDs favourited for the active fuel — the star state on each row.
|
||||
private var activeFuelFavouriteIDs: Set<String> {
|
||||
Set(favourites.filter { $0.fuel == activeFuel }.map(\.station.id))
|
||||
@@ -145,8 +154,6 @@ struct FavouritesView: View {
|
||||
if fuelSavingsSettings.isConfigured {
|
||||
Section {
|
||||
FuelSavingsAdjustmentView(amount: $fuelSavingsAmount)
|
||||
} footer: {
|
||||
Text(String(localized: "Savings below are estimated against the closest station by journey distance — the same baseline as the Stations list.", comment: "Favourites fuel-savings explanation"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +178,15 @@ struct FavouritesView: View {
|
||||
} header: {
|
||||
Text(String(format: String(localized: "%@ favourites", comment: "Favourites section title for fuel type"), activeFuel.displayName))
|
||||
} footer: {
|
||||
Text(String(localized: "The first station is the favourite used in single widgets. Tap Edit, then drag to reorder.", comment: "Favourites reorder explanation"))
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
Text(String(localized: "The first station is the favourite used in single widgets. Tap Edit, then drag to reorder.", comment: "Favourites reorder explanation"))
|
||||
if showsSavingsComparisonExplanation {
|
||||
Text(String(localized: "Savings are compared with your nearest station, just like in the Stations tab.", comment: "Favourites fuel-savings explanation"))
|
||||
}
|
||||
}
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
if let cheapest = cheapest {
|
||||
|
||||
Reference in New Issue
Block a user