How Best Value works: a Setup Best Value button, and a clean hand-off to Settings
The explanation sheet now carries a full-width button that closes it and the sheet it was opened from, then lands on Settings — whose Best Value section is the first thing in its list, so the controls are on screen on arrival. It uses .controlSize(.large), the standard iOS button height. Both the More info sheet and the Key sheet are presented by StationsView, and FavouritesView presents its own More info sheet — not ContentView's monitor as assumed — so each host closes whichever sheet it owns on the notification. Before this, one of them stayed up over the Settings tab. The button now announces itself half a second after its own dismissal, so the child and parent dismissals cannot race and drop one of the two.
This commit is contained in:
@@ -222,6 +222,12 @@ struct FavouritesView: View {
|
||||
onToggleFavourite: { onToggleFavourite(station, activeFuel) }
|
||||
)
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .fuelBoardOpenBestValueSettings)) { _ in
|
||||
// "Setup Best Value" from the explanation sheet, opened inside
|
||||
// this view's More info sheet. That sheet closes itself; this one
|
||||
// is presented from HERE and would otherwise stay over Settings.
|
||||
detailStation = nil
|
||||
}
|
||||
.onAppear {
|
||||
#if DEBUG
|
||||
// QA hook: launch with `-showTrends` to open the sheet
|
||||
|
||||
Reference in New Issue
Block a user