Repository navigation
Conversation
In-app modal alerts (glucose alarms, pump alerts) were presented on the app's topmost view controller. A SwiftUI .alert from that screen then failed with "already presenting", and on the bolus screen the stuck activeAlert suppressed every later alert there, including Exceeds Maximum Bolus. Presenting those alerts from an overlay window at alert level leaves the app's presentation chain free; the window passes touches through and hides when no alert is showing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A glucose alarm presented over the bolus screen blocked the screen's own SwiftUI alerts. In-app modal alerts were presented on the app's topmost view controller, so when a new reading both crossed the high threshold and changed the recommendation, UIKit logged:
"Bolus Recommendation Updated" was lost and
activeAlertstayed set.presentAlert'sactiveAlert == nilguard then dropped every later alert on that bolus screen, including "Exceeds Maximum Bolus". Delivery was still refused, but with no explanation.This presents the alert manager's in-app modal alerts (glucose and pump) from their own window at
.alertlevel, so they no longer occupy the app's presentation chain. The window passes touches through when no alert is showing and hides once its alert is dismissed. Other presenters (delivery uncertainty, etc.) are unchanged.Testing, simulator with CGM and pump simulators:
Not tested: VoiceOver focus with both alerts up (the alert underneath is in the accessibility tree), and real hardware.