loopandlearn / LoopFollow

A general Follow app for parents of T1D Loop Users
GNU Affero General Public License v3.0
99 stars 494 forks source link

Implement User-Initiated Scroll Detection to Control Chart Auto-Scrolling #268

Closed bjorkert closed 3 months ago

bjorkert commented 3 months ago

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

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:

dsnallfot commented 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 commented 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!

Thanks for the feedback and testing! =)

marionbarker commented 3 months ago

Code review looks good.

Testing on test phone.

  1. Build using dev branch (does not have this change)
    • Scroll to older time
    • When new glucose arrives, chart auto-scrolls to display new glucose
  2. Build using branch from this PR
    • Scroll to older time
    • When new glucose arrives, scroll position remains unchanged
    • Do not modify chart (no touching)
    • When next glucose arrives, chart auto-scrolls to display new glucose