Repository navigation
Conversation
A WHOOP 4.0 has no on-chip step counter; its steps come only from the live 100 Hz stream, so a walk with the phone left behind leaves no steps at all and users report it as "not tracking steps". On a day the band counted nothing, the steps screen now says so, after the phone footnote and on the no-steps card. Only for a known gen4 band, never on a day it counted.
Reviewer's GuideImplementationTrack whether the paired band is a known WHOOP 4.0 when loading the day, and use the current pairing state plus the day’s source to decide whether the hint is accurate.
UIAppend the WHOOP 4.0 live-data explanation to the phone-only and no-steps messages, with translations for the supported locales.
TestsCover the hint on phone-only and zero-step days, and verify it is suppressed for counted days and other pairing states.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@abdulsaheel could you approve the
Each was analyzed and tested locally (details in each description). Thanks! |
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="lib/ui2/screens/day_steps.dart" line_range="449" />
<code_context>
- : whyFromNote(d.note, unit: 'days') ??
- (l?.dayStepsNothingCounted(when) ??
- 'Nothing that can count steps recorded $when.'),
+ : _withNoCounterHint(
+ c,
+ d,
</code_context>
<issue_to_address>
**Hint contradicts saved band count**
When the paired band is a WHOOP 4.0 and a historical day has phone coverage spans plus a positive strap-counter day result, when a day has phone coverage spans but its published total comes from a strap counter, `_honesty` sees `d.strap == 0` and appends the WHOOP 4.0 hint. The screen then says the band added nothing even though the saved day records a band count.
Do not append the hint when the day result records a positive strap-counter total, even if resolved coverage contains only phone spans.
</issue_to_address>
### Comment 2
<location path="lib/ui2/screens/day_steps.dart" line_range="286" />
<code_context>
final d = await DayStepsData.load(repo,
- bandLabel: bandLabel(context), want: _day);
+ bandLabel: bandLabel(context),
+ bandHasNoCounter: pairedBandHasNoCounter(context),
+ want: _day);
if (mounted && token == _loadToken) {
</code_context>
<issue_to_address>
**Stale band guidance remains visible**
When the paired band is unpaired or replaced while the steps detail remains mounted, `DayStepsData.load` snapshots `pairedBandHasNoCounter(context)` into `_d`, and `DayStepsDetail` does not reload when `AppState` changes, so the screen keeps showing guidance for the previous band.
Update or reload the day data when the paired band changes, or derive the hint from the current paired-band state.
Also at `lib/ui2/screens/day_steps.dart:287`.
</issue_to_address>
### Comment 3
<location path="test/ui2_day_steps_test.dart" line_range="98" />
<code_context>
+ spans: [_span(0, 60, 1200)],
+ total: 1200,
+ phone: 1200,
+ bandHasNoCounter: true,
+ ),
+ );
</code_context>
<issue_to_address>
**Paired-band wiring goes untested**
When the paired-band lookup or its wiring in `_load` is broken, if the repository-loading path stops passing `pairedBandHasNoCounter(context)` or returns the wrong value for a paired WHOOP 4.0, the new widget tests still pass: they pump `DayStepsDetail(data: d)` with the flag set directly, so `initState` skips `_load`; the “other band” case also supplies no paired-band state.
Exercise the repository-backed loading path with paired WHOOP 4.0 and non-gen4 device state rather than supplying the precomputed flag.
Also at `test/ui2_day_steps_test.dart:108`, `test/ui2_day_steps_test.dart:131`.
</issue_to_address>Sourcery assessment
Approval pending. 3 findings to address first.
Blocking findings: lib/ui2/screens/day_steps.dart:449, lib/ui2/screens/day_steps.dart:286, test/ui2_day_steps_test.dart:98
| spans: [_span(0, 60, 1200)], | ||
| total: 1200, | ||
| phone: 1200, | ||
| bandHasNoCounter: true, |
There was a problem hiding this comment.
🟡 Medium · Paired-band wiring goes untested
When the paired-band lookup or its wiring in _load is broken, if the repository-loading path stops passing pairedBandHasNoCounter(context) or returns the wrong value for a paired WHOOP 4.0, the new widget tests still pass: they pump DayStepsDetail(data: d) with the flag set directly, so initState skips _load; the “other band” case also supplies no paired-band state.
Exercise the repository-backed loading path with paired WHOOP 4.0 and non-gen4 device state rather than supplying the precomputed flag.
Also at test/ui2_day_steps_test.dart:108, test/ui2_day_steps_test.dart:131.
Prompt for AI agents
In `test/ui2_day_steps_test.dart` at line 98:
**Paired-band wiring goes untested**
When the paired-band lookup or its wiring in `_load` is broken, if the repository-loading path stops passing `pairedBandHasNoCounter(context)` or returns the wrong value for a paired WHOOP 4.0, the new widget tests still pass: they pump `DayStepsDetail(data: d)` with the flag set directly, so `initState` skips `_load`; the “other band” case also supplies no paired-band state.
Exercise the repository-backed loading path with paired WHOOP 4.0 and non-gen4 device state rather than supplying the precomputed flag.
Also at `test/ui2_day_steps_test.dart:108`, `test/ui2_day_steps_test.dart:131`.…e-hint # Conflicts: # lib/l10n/app_en.arb
An older day whose total came off a WHOOP 5.0 / MG's own counter was counted by a band that has one, so the hint would contradict it.
|
@coderabbitai review |
Action performed
|
Why
A WHOOP 4.0 has no on-chip step counter ("gen4 has no counter",
derivation_engine.dart). Its steps come only from the live 100 Hz movement stream, which is counted while the app receives it and never stored. So a walk with the phone left at home leaves no steps from the band and none from the phone, and users report it as a bug. A recent support report, verbatim: "Walked but it's not tracking the steps. it did from my phone but I don't carry my phone all the time."The steps screen already explains each sensor's limits in one footnote, but never says the band itself can't count on its own.
What it looks like
With a WHOOP 4.0 paired, on a day the band counted nothing:
Unchanged: any day the band did count (it evidently could), any other band, or no band paired.
What changes
lib/ui2/screens/day_steps.dart:DayStepsData.bandHasNoCounter, set from a newpairedBandHasNoCounter()next tobandLabel(). True only for a paired band whose generation is known to begen4; false when nothing is paired or the generation is unknown, so it never guesses. One helper appends the sentence in both places.dayStepsWhoop4NoCounterin all eight locales that already translate this screen (en, de, es, fr, hi, ru, th, zh).No metric or derivation change, so no
kAlgoVersionbump.Tests
test/ui2_day_steps_test.dart: three new widget tests. A phone-only day with a WHOOP 4.0 shows the hint; a no-steps day with a WHOOP 4.0 shows it; it never shows on a day the band counted or without a WHOOP 4.0.flutter analyze: no issues.gen-l10n: no new untranslated messages.ui2_day_steps_test,day_steps_counter_session_test,spanish_coverage_test: 14 passed. The full suite was not run locally.🤖 Generated with Claude Code
Summary by Sourcery
Clarify WHOOP 4.0 step-counting limitations in the daily steps screen without changing metrics or derivation behavior.
New Features:
Enhancements:
Tests:
Chores:
Summary by CodeRabbit