Closed bjorkert closed 3 months ago
@bjorkert @marionbarker Just wanted to feed in that I quickly borrowed this code as soon as i saw it and put it in my personal customized branch.
And I have been running it for a couple of hours to test the cases mentioned in the notes. Everything works as expected.
This is a really nice UX feature for everyone like me that frequently looks at historical data in the chart.
Great job Jonas!
@bjorkert @marionbarker Just wanted to feed in that I quickly borrowed this code as soon as i saw it and put it in my personal customized branch.
And I have been running it for a couple of hours to test the cases mentioned in the notes. Everything works as expected.
This is a really nice UX feature for everyone like me that frequently looks at historical data in the chart.
Great job Jonas!
Thanks for the feedback and testing! =)
Code review looks good.
Testing on test phone.
Overview
This PR introduces enhancements to the blood glucose chart's auto-scrolling behavior in the
MainViewController
. The primary goal is to improve the user experience by allowing manual chart interactions (like scrolling to view historical data) without being interrupted by auto-scrolling to the latest data point.Changes
Date?
variable namedautoScrollPauseUntil
toMainViewController
. This variable tracks the time until which auto-scrolling should be paused due to user interaction.updateBGGraph
method to checkautoScrollPauseUntil
before executing auto-scrolling logic. Auto-scrolling now only occurs ifautoScrollPauseUntil
isnil
or the current time is past theautoScrollPauseUntil
timestamp.chartTranslated
delegate method to updateautoScrollPauseUntil
based on user scrolling. If the user scrolls to the latest data point,autoScrollPauseUntil
is set tonil
, allowing immediate resumption of auto-scrolling. If the user scrolls to view historical data,autoScrollPauseUntil
is set to 5 minutes into the future, temporarily pausing auto-scrolling.Rationale
The motivation behind these changes is to strike a balance between keeping users informed of the latest blood glucose data and allowing uninterrupted exploration of historical data. By intelligently managing auto-scrolling based on user interaction, we enhance the application's usability, particularly for users who actively engage with their historical blood glucose data.
Testing
These changes have been tested in the development environment to ensure that: