-
Notifications
You must be signed in to change notification settings - Fork 939
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
Add option to set default value for habits on unknown days #1106
Conversation
This seems to indicate that with the current implementation, if I create a new habit today with a default value, this default value will be applied to all the previous days (yesterday, etc.). I don't think that should be the case, IMHO the default value should apply to every day starting from the creation date, if possible. Other things:
|
I would rename the box to "Check (or tick) by default", with gray background if not, and highlighted if yes, or something like this.
In what sense? I've left the question mark working, but it does have color if by default you complete the habit. |
@iSoron now that |
Hi @KristianTashkov, could you please clarify what feature request is this PR trying to address? It's still unclear to me why is this feature needed. Is this #125? If so, note that is only applies to YES/NO habits, instead of numerical ones. |
As long as you enable a default value for YES/NO, I see no reason to not have the same functionality for numerical habits as well. If you are wondering about use cases:
|
It seems like this PR was originally designed to address #125, so maybe additional functionality, even if it's related, should be in a separate pull request. |
@iSoron what do you think of @KristianTashkov's points? FWIW I could use the default numeric values myself, and I think the |
Hi @hiqua, I have not taken any action on this feature because there are still many open questions to me. At this point, I'm still not sure if the added complexity (both in the code and in the UI) justifies adding this feature.
Answering @KristianTashkov questions:
Currently, AT_MOST starts at 100% score because: (i) the default value is zero; and (ii) we assume that all missing entries (including the ones before the habit was created) has the default value. If this feature is implemented and the user sets a default value to a large number (beyond the habit target), then the score should start at 0%. If the suggestion, however, is to allow both a low default value, and low starting score, I don't think we can do it consistently.
OK, our understanding is the same.
This could also be implemented at the UI layer, by having the picker default to the last entered value. No changes to the database, or to the data classes, are required. This solution doesn't have any of the issues above, and we could easily merge it (in a separate PR). |
In pseudo-code, more or less:
|
A few questions/comments about this solution:
|
No
In the UI, the default value can only be set to
It can even be a global task iterating over all habits with just one To summarize, I suggest that the default value implementation is just like the user setting the default value as early as possible, but automatically. So no change in the underlying data model. |
I think that could work. A PR implementing it would be very welcome. |
@KristianTashkov do you have all your answers / are you fine with the suggestions above? |
Hey @hiqua . At this point this PR is very stale and I would probably have to redo it anyway so I'm closing this. |
I don't know how it is currently, but I think we should consider all unknown entries as failing for numerical habits, which would solve this problem. |
Currently, all UNKNOWN entries are treated (and displayed in the UI) as zero. For AT_MOST habits, that's a success, so AT_MOST habits currently start at 100% score, which is what @KristianTashkov dislikes. I'm also not sure that the current behavior is the best. |
Exactly, I'm advocating for a failing value which depends on the habit goal. |
Implements: #125
This change propagates to a lot of places so list of things:
Implemented
Things to do left
I expect some tests to crash, but I prefer some guidance on the above before I continue@iSoron Waiting on some guidance for all of this before I continue cause it's a lot and don't want to spend more effort if you don't like where this is going.