iSoron / uhabits

Loop Habit Tracker, a mobile app for creating and maintaining long-term positive habits
GNU General Public License v3.0
7.47k stars 916 forks source link

"1 times per week"/"1 times in 7 days" defaulting to "Every 7 days" #1999

Open RetriedAgain opened 1 month ago

RetriedAgain commented 1 month ago

Pre-submission checklist

Description

When setting a Yes/No-habit to "1 times per week" or "1 times in 7 days", it automatically defaults to "Every 7 days." This is not the same functionality, as it does not allow for the flexibility of choosing which day to execute the day while being able to keep the habit. E.g. to see that the streak is not broken: Execute habit once on Monday, 2nd week on Tuesday, 3rd week on Wednesday.

Also discussed in https://github.com/iSoron/uhabits/discussions/1851 . Side-Note: I was unsure if to count this as a bug or a feature request, but as the functionality "1 times in 7 days" explicitly does not work as expected, as well as the discussion itself being unanswered so far, I counted it personally as a bug.

Steps to reproduce

  1. Go to Create/Edit a "Yes/No"-habit.
  2. Set frequency to "1 times per week" or "1 times in 7 days".
  3. Click "Save".
  4. See error, i.e. Frequency gets turned to "Every week", which is internally "Every 7 days" (as seen by clicking on the frequency again).

System information

Screenshots with example szenario of "Every 7 Days"

An example image, where one can see that the streak is not kept. image

Another example image, where the streak retroactively counts for the 23rd April, when finishing the habit on the 7th May image

A third example image, where the streak does not automatically count for the 14th May, though it was retroactively applied to the 23rd April. image

This seems to imply that as long as one equally uses all 7 days again and again, the habit will be fully registered, though only retroactively. As this only happens retroactively, and in this case sometimes weeks apart, I am not sure if this is to be intended behaviour, or if logic should/can be changed accordingly.

I tried to fix the problem myself by editing "EditHabitActivity.txt" and "FrequencyPickerDialog.kt", but sadly my coding skills weren't enough to reach the desired functionality, i.e. that executing the habit on any day in a week fulfills that complete week as satisfied.

Thank you for your work.