Skip to content

Fix Advanced Settings graph toggles not hiding chart elements#729

Open
bjorkert wants to merge 1 commit into
devfrom
fix/graph-display-toggles
Open

Fix Advanced Settings graph toggles not hiding chart elements#729
bjorkert wants to merge 1 commit into
devfrom
fix/graph-display-toggles

Conversation

@bjorkert

Copy link
Copy Markdown
Member

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant