Closed Navid200 closed 4 months ago
Shouldn't it be called "No Battery Optimization Prompt"?
Good change regardless.
@asavageiv In my opinion negative switches should not be used anywhere. If we were creating xDrip from scratch, I would suggest to change this switch to one that would enable the prompt and set it to be enabled by default.
But, making that change now is problematic. If we change it now, we will also have to deal with what happens if someone decides to go back to a release prior to this pr and that will make the pr more complicated.
I am open to suggestions. I don't want anyone to think we have made a change that we really haven't. So, I didn't want to make too many changes.
I agree with what you are saying. But, I am not sure if it will help someone who sees this for the first time or not. Because the question remains even if we set the title to "No optimization prompt". A user may wonder if I want no optimization, do I enable the switch or do I disable it.
We need a convention that we consistently follow. For example, no negative switches ever.
That makes sense. I agree with using positive settings and it would really be separate from this change. Can we keep it in the model layer as it is now but invert it in the UI only?
Can we keep it in the model layer as it is now but invert it in the UI only?
You will need an even number of inversions or else, you will be flipping the logic.
Without analytics we can't really know how much it's used, but I'd be fine with it being removed.
I was about to open a PR to remove this setting and I saw this.
I think we need to keep it.
When a switch has a visual representation, it is best to have a unique summary specifying what the switch does when enabled.
As an example, please have a look at the following screenshots of the speak reading switch.
The summary says "it will speak each new reading" regardless of if the checkbox is enabled or not.
This tells the user what the checkbox does if/when enabled. This is a reasonable expectation from the user to consider the summary to explain what the switch does when enabled.
If the switch did not have a visual representation, it would make sense to use the summary to tell the user what tapping on the switch will do.
But, when the switch already has a visual representation, making the summary change depending on the switch condition makes it a confusing setup.
The following shows what the battery optimization prompt switch does now before this PR.
Look at the summary for when the checkbox is disabled. It says "recommended". What if the user confuses that with us telling them that we recommend that they enable the switch?
This PR
This PR changes the summary to one statement regardless of if the checkbox is enabled or not as shown below.
Now, we are using the summary to tell the user what the checkbox does when enabled. And the checkbox representation (checkmark present or not) tells the user if the checkbox has been set or not. Exactly the same as the speak reading checkbox and almost every other checkbox in xDrip.