Closed rohanpurohit closed 3 years ago
@ethanjli if all good then maybe we can push this to 0.11?
Observations from testing:
onClick
button handlers to sanitize the values to enforce that lower <= upper
.onClick
would also enforce lower <= upper
for the rotary encoder, but I'm not sure.Do you think we should address these issues in this PR, or in a future PR?
Observations from testing:
- When I have SpO2 upper alarm limit at 90 and I rapidly click the "increment" button for the lower limit, I'm rarely able to set the lower limit to 91 (but the button is disabled afterwards) - but I'm unable to reproduce this consistently. I suspect there's a slight delay between when the value reaches 90 and when the button is disabled. I think we need an additional check in the
onClick
button handlers to sanitize the values to enforce thatlower <= upper
.- I am always able to use the rotary encoder to set the lower alarm limit above the upper alarm limit. I believe having the check in
onClick
would also enforcelower <= upper
for the rotary encoder, but I'm not sure.Do you think we should address these issues in this PR, or in a future PR?
I will try to fix the rotary one in this PR, and the other one depending on how often I can reproduce it, I'll either do in this or future PR 👍🏽
- When I have SpO2 upper alarm limit at 90 and I rapidly click the "increment" button for the lower limit, I'm rarely able to set the lower limit to 91 (but the button is disabled afterwards) - but I'm unable to reproduce this consistently. I suspect there's a slight delay between when the value reaches 90 and when the button is disabled. I think we need an additional check in the
onClick
button handlers to sanitize the values to enforce thatlower <= upper
.
Although, I could not reproduce this, I have made a change to onClick callback, can you try to reproduce with the latest changes @ethanjli ? thanks!
- I am always able to use the rotary encoder to set the lower alarm limit above the upper alarm limit. I believe having the check in
onClick
would also enforcelower <= upper
for the rotary encoder, but I'm not sure.
So with the current change there is a regression, it will stop changing once it reaches the disabled
limit but it won't change the opposite way unless clicked by mouse/touch, you could maybe test this behavior and let me know if we should revert the change and fix properly in a future PR!
just to give an example (decrement the upper limit <= to lower limit, it won't go further down, try incrementing the upper limit via rotary encoder -> that fails, click the increment button then rotary works)
This regression is introduced by automatically disabling the Rotary Encoder Controller when the value reaches a limit, which isn't the approach I had in mind. Assuming you tried simply adding a check in the onClick
button handlers to sanitize the values to enforce that lower <= upper
(i.e. clamping the input to onClick
to be within valid ranges such that lower <= upper
), which I think should prevent the rotary encoder from breaking lower <= upper
, what issues did you encounter with that approach? We already enforce this kind of check for the outer limits on the sliders (e.g. 0 - 100 for SpO2 alarms) - currently how does the frontend prevent values from being adjusted outside those limits by the rotary encoder?
This regression is introduced by automatically disabling the Rotary Encoder Controller when the value reaches a limit, which isn't the approach I had in mind. Assuming you tried simply adding a check in the
onClick
button handlers to sanitize the values to enforce thatlower <= upper
(i.e. clamping the input toonClick
to be within valid ranges such thatlower <= upper
), which I think should prevent the rotary encoder from breakinglower <= upper
, what issues did you encounter with that approach? We already enforce this kind of check for the outer limits on the sliders (e.g. 0 - 100 for SpO2 alarms) - currently how does the frontend prevent values from being adjusted outside those limits by the rotary encoder?
Ya it was just a temporary approach, mainly we will have to disable change in one direction(where it's disabled) and pass onClick with changed value in the other, i think it gets tricky there, definitely something I did not think about is, RotaryEncoderController should be aware of which direction is blocked, so passing just disableChange
boolean is not right.
This PR fixes #373