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

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

Open
2 tasks done
RetriedAgain opened this issue May 28, 2024 · 4 comments
Open
2 tasks done

Comments

@RetriedAgain
Copy link

Pre-submission checklist

  • I am submitting a bug report, not a feature request.
  • I have searched for similar issues, but did not find any matches.

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 #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

  • Phone: Any, e.g. Pixel 3a
  • Phone Operating System: Android 14
  • App version: Newest as of this moment, i.e. 2.2.0

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.

@wobbba
Copy link
Contributor

wobbba commented Jul 20, 2024

I could be wrong but I think this is intentional since Loop uses a sliding window (there is no concept of a week or a month, these are just names used for input convenience). "every week", "1 times per week", and "once every 7 days" are synonymous. The streak is extended forwards by default and backwards if it would overlap with another streak extension otherwise (as far as I can tell). I think what you mean by the retroactive part is a domino effect of repeating after less than 7 days, which moves the previous back, which moves the one before that back etc. What you suggest (if I understand you correctly) would mean a change in the way streak extensions are placed. (not sure what they call "streak extensions" internally, I hope you get what I mean)

Personally, I agree that it would be more consistent with the naming to make it behave the way you suggest. I could imagine that some may raise the objection that it is confusing. We could retain the old funtionality by setting it in "x times in {7, 30} days" and get your functionality by setting it in the "x days per {week, month}". To avoid confusion, I would suggest adding the term "calendar" to the names, i.e. "x days per calendar-{week, month}". Alternatively, removing the "x days per {week, month}" options would also get consistency (not sure if you are just wanting naming consistency).

This seems like more work than you'd think, probably needs updates to the database structure, since (iirc) the frequency is stored as a fraction (enumerator and denominator separately) and you would have to add all the logic for placing which days are YES_AUTO about which I have no idea how it works.

Personally, I don't care about this feature (and I do think its a feature request so maybe post it in the discussion section), so I won't be working on it. I should not even be writing this, I'm just procrastinating lol

@MelissaBo13
Copy link

Wobbba- are you the developer for this app? You said you don't care about this feature and won't be working on it. I'm trying to figure out if that's coming from a developer and that means they won't do it, or if you're just commenting.

@wobbba
Copy link
Contributor

wobbba commented Jul 23, 2024

@MelissaBo13 I've only made one contribution so far but plan to add more when I have time. The project is mainly developed by iSoron and hiqua, but since everyone is working on it in their free time, don't expect too much. If you want a feature, you can code it up and make a pull request, but ultimately iSoron, who owns the repository, will have to approve it. Therefore, I wouldn't put in too much work unless you have his approval beforehand (that's what the feature requests in the discussion section are for). If you can't be bothered to code it up or to learn how to code it up, you can still create the feature request and hope that someone who is able and willing also likes the feature.

@MelissaBo13
Copy link

Wobbba- oh interesting, I didn't know that's how things like this worked. So apps like this are kind of like a wiki where anyone can contribute?

Unfortunately, I have no programming knowledge so that's something I wouldn't be able to do. 😞

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

No branches or pull requests

3 participants