Streaks that cannot become a stick, plus household history - #11
Merged
Conversation
Streaks are the standard gamification lever in this category and they are almost always a punishment device: miss a day, watch a number you had been growing reset to zero, usually announced by a notification. That is exactly the tone this app exists to avoid, so the definition here is different. A day contributes one of three things. It counts if work was done. It bridges if nothing was ever asked of you - being given no chores on Tuesday is neither an achievement nor a failure. It breaks only if work was due and not done. Today never breaks a run, because the day is not over. Getting that rule right took two real corrections, both caught by tests. First an infinite loop: with nothing ever due, every day in the past counted as kept, so the backward walk never terminated and the suite hung for five minutes. The walk is now bounded by the first day the person did anything, before which there is simply no record. Then a subtler one. My first rule let empty days increment the count, so two days of work either side of a quiet week reported 'five days in a row'. That is a lie, and in an app about honest accounting it is a particularly bad one. Empty days now connect a run without padding it. Also adds household history: effort per week over the last eight weeks, and the chores the house keeps skipping. The chart is a single series, so no legend - the heading names it - and no categorical palette to validate; the check that applies is contrast against the surface, which the brand clears in both themes. Empty weeks are drawn as empty rather than omitted, because a chart that skips quiet weeks compresses time and makes a fortnight of nothing look like steady work. The same data is available as a screen-reader table. The skipped-chore list is framed as information about the chore, never about a person: a job skipped two times in three is usually a job the house does not need, and noticing that is more useful than nagging anyone. 156 tests, lint and typecheck clean. Verified against the running server: eight correctly bucketed weeks, accurate tooltips, and a streak reading '10 days running' from the seeded history.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Streaks are the standard gamification lever in this category — Sweepy, ChoreUs and Chore Wars all lean on them — and they are almost always a punishment device: miss a day, watch a number you'd been growing reset to zero, usually announced by a notification.
That's precisely the tone chorely exists to avoid, so the definition here is deliberately different.
The rule
A day contributes one of three things:
Today never breaks a run, because the day isn't over. Someone opening the app at 9am has not yet failed at anything.
Two real corrections, both caught by tests
An infinite loop. With nothing ever due, every day in the past counted as "kept", so the backward walk never terminated — the test suite hung for a full five minutes before I killed it. The walk is now bounded by the first day the person did anything, before which there's simply no record.
A subtler one, and the more interesting. My first rule let empty days increment the count, so two days of work either side of a quiet week reported "5 days in a row". The failing test was technically my test being wrong — the code matched my documented rule — but the right response was to change the rule, not the assertion. In an app whose entire pitch is honest accounting, a streak number that inflates itself is a particularly bad lie. Empty days now connect a run without padding it.
History
Verified
156 tests, lint and typecheck clean. Checked against the running server: eight correctly bucketed weeks (Monday-anchored, confirmed against the calendar), accurate per-bar tooltips, and a streak reading "10 days running" from the seeded history.