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

Issue 1316: Skip measurable habit #1319

Merged
merged 19 commits into from
Mar 24, 2022

Conversation

kalina559
Copy link
Collaborator

@kalina559 kalina559 commented Mar 9, 2022

Resolves #1316. My solution is to add a 'SKIP' button to the numerical habit dialog. If it's clicked, the entry value is set to Entry.SKIP / 1000 = 0.003 and it's displayed in the same way as a skipped yes/no habit.

@kalina559 kalina559 closed this Mar 9, 2022
@kalina559 kalina559 reopened this Mar 9, 2022
Copy link
Collaborator

@hiqua hiqua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

@hiqua
Copy link
Collaborator

hiqua commented Mar 9, 2022

The ktlint stuff can be a bit annoying, you can have a look at https://github.com/iSoron/uhabits/blob/dev/docs/GUIDELINES.md#code-style to make it less annoying. I use the commit pre-hook personally.

@iSoron
Copy link
Owner

iSoron commented Mar 10, 2022

Hi @kalina559, thank you for the PR. Besides the comments above, I have a few other questions:

  1. For numerical habits with daily frequency, how does a SKIP differ from an entry with value 0? It appears to me that the difference, at this point, is purely visual. Shouldn't SKIP also have an impact on the score and the "target" chart?
  2. For numerical habits with weekly or monthly frequency, does it even make sense to allow SKIP? When should the user enter this option, instead of entering zero? What's the impact on score and target in this case?

@kalina559
Copy link
Collaborator Author

Hi @iSoron,

  1. You're right, I'll look into how I can affect the score and target chart with this
  2. User can enter SKIP in the history chart or in the reminder dialog. Maybe if all entries in a week/month are skipped, then the score and target are affected somehow?

@iSoron
Copy link
Owner

iSoron commented Mar 12, 2022

You're right, I'll look into how I can affect the score and target chart with this

For scores, I suggest copying the behavior from boolean habits: a SKIP keeps the score the same as the day before.

For the target chart, one thing that may make sense is to reduce the total. For example, if you have a daily numerical habit with target of 10, then the chart by default would show a monthly target of 300 (for a 30-day month). However, if you skip one day, the monthly target for that month could drop to 290. This might be difficult to implement, though. We would need to count the number of skips in a certain interval.

Regarding skips in non-daily numerical habits, I suggest disabling them for now until we understand that use case better. They don't seem to make a lot of sense to me at this point, but I'm open to suggestions.

@ke352802081770314
Copy link

Regarding skips in non-daily numerical habits, I suggest disabling them for now until we understand that use case better. They don't seem to make a lot of sense to me at this point, but I'm open to suggestions.

As you explained, skip should reduce the multi-day targets. so if I have a target "150 per week" and I have a skip day in that week, the target should be 6/7 =(7-skip_days)/7 of that number, so it is really what you already suggested, only the user-supplied value is on a different scale (weekly given directly instead of calculated as 7*daily etc.).
I must admit scoring isn't that transparent to me so I can't explain how to adjust scoring in that case. My conceptual logic would be "skip days are treated like they didn't exist in the calendar" i.e. skipping 2022-03-13 would make the scoring think that the next day after 2022-03-12 is 2022-03-14 and everything else follows logically from that.

It could be argued that the skip supports laziness, because if I intended to achieve the cumulative number not by doing it daily anyway, skip could be used to lower the target. But honesty is always up to the user, and if I mark three days as skip because I was bedridden sick it is correct that my jogging target for that week should only be 4/7 of when I had been healthy.

@kalina559 kalina559 requested a review from hiqua March 20, 2022 19:48
Copy link
Owner

@iSoron iSoron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @kalina559. I think it looks mostly good.

@hiqua Please free to add any comments.

@kalina559 kalina559 requested a review from iSoron March 24, 2022 09:58
@iSoron iSoron merged commit 3b12ec4 into iSoron:dev Mar 24, 2022
@iSoron
Copy link
Owner

iSoron commented Mar 24, 2022

Looks good to me. Thanks, @kalina559!

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.

Skip days not available for measurable habits
4 participants