Skip to content

fix(trends): respect configured day boundary - #638

Draft
Charlie284 wants to merge 1 commit into
simonoppowa:developfrom
Charlie284:fix/trends-day-boundary
Draft

fix(trends): respect configured day boundary#638
Charlie284 wants to merge 1 commit into
simonoppowa:developfrom
Charlie284:fix/trends-day-boundary

Conversation

@Charlie284

Copy link
Copy Markdown

Summary

Trends now anchor their date windows to the configured logical day instead of wall-clock midnight. Food totals, water buckets, chart windows, and streak calculations share the existing DayBoundaryCalc boundary and use calendar-date arithmetic across DST transitions.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • CI / tooling
  • Localization
  • Other

Related issues

Fixes #628

Changes

  • Use the configured day-start offset when loading the current and prior trends windows.
  • Bucket water entries into the same logical days used by food and diary data.
  • Keep chart and streak date ranges aligned with logical today and local calendar dates across DST.
  • Cover midnight and 08:00 boundaries, entries around midnight and the boundary, both aggregation paths, and a spring DST transition.

Screenshots / recordings

Not applicable; there are no visual changes.

Test plan

  • Described steps below were followed locally
  • Unit / widget tests added or updated (if applicable)
  • Manual check on Android
  • Manual check on iOS (if applicable)

Steps

  1. Ran the focused day-boundary, trends, and refresh tests: passed, 52 tests.
  2. Ran flutter analyze: passed with no issues.
  3. Ran just test: passed, 966 tests.
  4. Ran just format: completed. The pinned formatter also changes 259 files on an untouched develop checkout, so that unrelated repository-wide churn is not included here.
  5. Ran just ci: stopped at its format --set-exit-if-changed gate for the same 259-file baseline mismatch; codegen, tests, and analysis were not reached by that recipe. The separate test and analysis commands above passed.

Checklist

  • Code follows project style (just format / 120-char line width)
  • No new interactive widgets were added
  • No user-facing strings changed
  • No DBOs, DTOs, or environment fields changed
  • No secrets or .env values committed
  • PR title follows conventional commit style (e.g. feat:, fix:, chore:)

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.

1 participant