Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes for new bolus calc #290

Merged
merged 33 commits into from
Oct 30, 2023

Conversation

polscm32
Copy link
Collaborator

This PR adds back the "Continue without bolus" button when the bolus amount is 0. For values > 0 it will show "Enact bolus" or if the entered bolus amount is above maxBolus it will show "Max Bolus exceeded! and disables the button. In this case the popup also shows the info that maxBolus is exceeded and what the current setting/limit for maxBolus is.

Moreover it fixes the wrong alignment of insulin doses when using "U" and removes the function for adding non pump insulin from BolusStateModel which is not longer needed there.

…calculator settings to switch between bolus calculators
…ncreas#269 and make color in info popup for fatty meals in light mode more readable
…stent, update explaining text in setting for new bolus calculator, add alignment for non pump insulin button so that it is centred
… calc, add message in popup if entered bolus amount exceeds maxBolus setting and limit it to maxBolus
@LiroyvH
Copy link
Contributor

LiroyvH commented Oct 30, 2023

I thought this was already implemented, I tried the new bolus calculator yesterday and it suggested 43U whereas 25U is the max. When tapping it, it tried to populate the field to 43U and it instantly showed the dead emoji; that worked as expected. :)

It'd probably be handy if it would respect the max bolus and simply not exceed that in the bolus amount field. I think ideally, if it suggests a value higher than maxBolus: it will populate the bolus field with maxBolus instead (in red color?) and show a warning explaining why the field got capped to maxBolus (25U in my case) instead of the calculated suggestion? Otherwise you keep running in to having to manually modify the bolus field whenever you run in to a situation exceeding maxBolus, which might be perceived as annoying.

@polscm32
Copy link
Collaborator Author

polscm32 commented Oct 30, 2023

Yeah I actually implemented the function that amount will be equal to maxBolus if amount > maxBolus in my previous commits but rolled it back now. Problem I had with this was that you right now don't really have the ability to confirm the amount that you put in the DecimalTextField. This way it doesn't get updated to maxBolus if you exceed it but just stays at the value you entered. So you have to open the popup for example and only then it gets updated.

So if you have a maxBolus of 5 and enter 6 and you want to bolus, pump will give 5, but in the decimal textfield remains the 6 unless you tap somewhere else...

Tried several things to optimize this, for example via alert, onChange modifier, changing binding of state.amount with get/set or via applying an optional limit to the DecimalTextFieldClass but after all I found this to be easier. It is currently nearly the same way loop handles it. When you exceed maxBolus, you get an alert (here the button text changes) and can not proceed.

But more thoughts on this are greatly appreciated!

@polscm32
Copy link
Collaborator Author

polscm32 commented Oct 30, 2023

I hope my explanation was not too confusing :)

Perhaps see my commit 9a2f124 for more info. There I set amount to maxBolus if it exceeds maxBolus. Then the button really never gets disabled (unless amount <= 0) because it is immediately set to maxBolus and you can proceed with maxBolus whereas in the Textfield there is still the higher entered amount.

@Jon-b-m Jon-b-m merged commit b8ea284 into Artificial-Pancreas:dev Oct 30, 2023
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.

3 participants