Fix Advanced Settings graph toggles not hiding chart elements#729
Open
bjorkert wants to merge 1 commit into
Open
Fix Advanced Settings graph toggles not hiding chart elements#729bjorkert wants to merge 1 commit into
bjorkert wants to merge 1 commit into
Conversation
The old chart only drew what the gated update calls pushed into it, but the Swift Charts model reads the data arrays directly, so Graph Basal, Graph Bolus, Graph Carbs and Graph Other Treatments were never consulted. Skip the corresponding data during rebuild when a toggle is off, and mark the chart dirty when a toggle changes so it redraws on return to the home screen. Restore two settings-change behaviors dropped in the migration: changing the prediction style re-routes the stored predBGs again, and toggling Show Yesterday's BG reloads the BG window so the overlay updates right away instead of at the next scheduled fetch.
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.
The Graph Basal, Graph Bolus, Graph Carbs and Graph Other Treatments toggles in Advanced Settings stopped working in 7.0. The old chart only drew what the gated update calls pushed into it, but the new chart model reads the data arrays directly, so the toggles were never consulted. The model now skips the corresponding data when a toggle is off, and flipping a toggle marks the chart dirty so the graph redraws when you return to the home screen.
Two more settings-change behaviors were lost in the migration and are restored here: changing the prediction style re-routes the stored predBGs again, so switching between cone and lines no longer waits for the next device status fetch, and toggling Show Yesterday's BG reloads the BG window so the overlay appears or disappears right away instead of at the next scheduled fetch.
Verified in the simulator against a live Nightscout site: each toggle hides and restores its elements on both the main and the small graph, and the yesterday line appears within seconds of enabling it.
Fixes #728