Fix ForecastView rendering past forecast points#1092
Open
k9track wants to merge 1 commit intonightscout:devfrom
Open
Fix ForecastView rendering past forecast points#1092k9track wants to merge 1 commit intonightscout:devfrom
k9track wants to merge 1 commit intonightscout:devfrom
Conversation
The AreaMark and LineMark in ForecastView were rendering for timestamps in the past, causing visual artifacts on the glucose chart. Added a lower bound check (xValue >= Date()) so forecast marks only render for future timestamps, matching the existing upper bound of 2.5 hours.
Contributor
|
Do you have an example or an associated issue report for such artifacts and faulty renderings? Edit: reason I am asking this is that a forecasted cone that begins in the past is actually intended behavior if the last loop cycle in fact in the past, or the map even have skipped a loop or two. So just trying to identify what issue you are seeing because from a brief overview of the proposed changes it looks like this is breaking intentional behavior. |
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.
Summary
AreaMarkandLineMarkwere rendering for timestamps in the past, causing visual artifacts on the glucose chartxValue >= Date()) to all three render locations so forecast marks only render for future timestampsxValue <= Date(timeIntervalSinceNow: TimeInterval(hours: 2.5))) was already in place — this adds the missing lower boundChanges
File:
Trio/Sources/Modules/Home/View/Chart/ChartElements/ForecastView.swiftThree identical changes at lines 44, 60, and 83:
Test plan