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:
@@ -218,6 +218,15 @@ struct StationsView: View {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .fuelBoardOpenBestValueSettings)) { _ in
|
||||
// "Setup Best Value" from the explanation sheet. That sheet closes
|
||||
// itself and ContentView switches to Settings, but both of the
|
||||
// sheets this view can have open are presented from HERE and each
|
||||
// survived the tab switch, floating over Settings: the Key sheet
|
||||
// and the More info sheet. Close whichever is up.
|
||||
showKey = false
|
||||
detailStation = nil
|
||||
}
|
||||
.task(id: stations.count) {
|
||||
#if DEBUG
|
||||
// QA hook: `-showDetail` opens the More info sheet for the first
|
||||
|
||||
Reference in New Issue
Block a user