Closed kskandis closed 4 months ago
Thanks for providing this fix 💪 How does this relate or influence or affect #352 and #356 ?
Thanks for providing this fix 💪 How does this relate or influence or affect #352 and #356 ? Sorry, I didn't see these PRs.
extension TextFieldWithToolBar.Coordinator: UITextFieldDelegate {
which is also in this PR, so there could be a minor file change conflict, easy to resolve.Remaining fixes in #352 are for extension TextFieldWithToolBarString.Coordinator: UITextFieldDelegate {
which this PR does not address, so there should be no conflict.
extension TextFieldWithToolBar.Coordinator
in this PR though.Thanks for the quick reply. So I think #352 can be closed and #356 will not be affected - if this is tested and approved and fixes the issue in full?
So I think #352 can be closed
No, #352 has fixes to the Note textfield which THIS PR does not address so that is a separate fix and assuming test and works, should be merged. #352 ALSO has a few lines in its code that this PR also has very similar code for the thousand separator symbol. What I can do is merge #352's thousand separator code into this PR so that it is exactly the same and hence there would be no conflicts. Then you can merge this PR and afterwards merge #352. Would that work?
OR alternatively, #352 author could remove the thousand separator code fix since it is unrelated to the Note field. Then both of these PRs can be merged w/out conflict.
OR alternatively, #352 author could remove the thousand separator code fix since it is unrelated to the Note field. Then both of these PRs can be merged w/out conflict.
Okay. This has now been removed from my PR.
There are places where you cannot type #.0# and get anything other than ##. Perhaps none the places should accept those values, but if people type them, their entry does not match what was typed.
my CLI:
dff37ac2 (HEAD -> dev, origin/dev, origin/HEAD) Merge pull request #359 from kskandis/dev
1016 git apply ~/dev/git_local/trio-patches/trio-pr-362-uitextfield-issue.patch
1017 git apply ~/dev/git_local/trio-patches/trio-pr-356-mmol-fix.patch
1018 git apply ~/dev/git_local/trio-patches/trio-pr-352_deleting-text-bug.patch
Work my way through adding information to a fresh build - remark if there are issues.
Notifications;
Statistics
Preferences
Pump Settings
Meal Settings
These use picker wheels: basal profile, ISF, CR, Target Glucose
Log Insulin
Log Glucose (mmol/L)
Carb Entry
Enact Temp Target
Enact Bolus
Meal Settings
- some are ok with #.0#
Fat and Protein conversion settings are not ok
- for delay in minutes, type 60.5 and get 605.
Thanks, Marion, as always, for your thorough testing. I actually only tested with Bolus Enact Entry
, Meal Settings
, and Carb Entry
, all of which appeared to work for me.
For the Meal Settings - Delay in Minutes/Max Duration in Hours/Interval in Minutes
, I believe should NOT accept a decimal symbol, since their View code specifically says it is an intFormater
with allowsFloats=false
- see my first comment in the corrsponding issue report. So that is how I coded it. Should they allow fractions?
Meal Settings
- Override With A Factor Of
has formatter with formatter.maximumFractionDigits = 1
. To my understanding, this means data entry should allow only 1 digit entered to the right of the decimal separator. Hence, entering '1.05' would not be allowed. Once you enter 1.0
, the textfield will drop the 0
and display 1
, so if you then enter a 5
, textfield will correctly display as 15
. Am I misunderstanding the requirements?
I suspect the other fields that you tested have similar issues, esp anything whose View formatters have maximumFractionDigits = 1
(eg., Carb Entry, TT Entry) or allowsFloats=false
. What are the expected requirements for each of these fields? Perhaps the Formatters need to be reviewed for each field?
This fixes the one issue, #362, so I'm adding an approval. As one of the comments, I went through all the data entry fields for others to review.
Please see above comment! I think this PR would apply to all NumberFormat textfields but maybe we need to clarify data entry requirements for each field. Eg., should maxFractionDigits be 1, 2, 3, etc., should decimal entry be allowed. I added code specifically to support the View formatters but the View formatters (for each field) need to be defined appropriately for the field. I did not change any of the formatters which are defined on each field in various files.
As one of the comments, I went through all the data entry fields for others to review.
I removed the code which addresses your other comments in your review.
You should now be able to enter decimal for the Integer fields in Meals Settings but upon returning to the screen, due to allowFloats=false, the number will revert to an Integer.
Success - thank you Using "." as the decimal separator:
1028 git apply ~/dev/git_local/trio-patches/trio-pr-352_deleting-text-bug.patch
1029 git apply ~/dev/git_local/trio-patches/trio-pr-356-mmol-fix.patch
1030 git apply ~/dev/git_local/trio-patches/trio-pr-362-uitextfield-issue.patch
Repeated the testing from this comment.
One minor nit - when using "." as a decimal separator, when I have ##.# and hit back space, I am presented with ## with no decimal separator. Most people hitting backspace to modify a number will notice, but seems like the decimal separator should not be removed until hitting the keyboard symbol or hitting backspace. This will not prevent me from approving this.
One minor nit - when using "." as a decimal separator, when I have ##.# and hit back space, I am presented with ## with no decimal separator. Most people hitting backspace to modify a number will notice, but seems like the decimal separator should not be removed until hitting the keyboard symbol or hitting backspace.
Thank you, again, for your thorough testing!! Yes, I agree with this comment. Hwr, it does behave the same as in Loop - Add Carb Entry.
- If an entry must be an integer, typing in x.yz becomes x', where x' is rounded up or down depending on 0.yz.
AFAIK, only the Meal Settings (top 3 under Conversion Settings displaying # of Hours or Minutes) contain what appear to be Integers (allowFloats=false).
Merging based on rigoros testing by Marion and Mike and 2 approvals (formerly 3, but changes since Mike tested).
Resolves Incorrect bolus amount entered due to data entry problem #358