Repository navigation
feat: week_start counts week_seconds for the calendar week - #53
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Week start window docs/API.md, src/routes/v1/stats.ts, test/stats-overview.test.ts |
The route accepts week_start=0 for Sunday and week_start=1 for Monday, and rejects other values. Without the parameter, it retains the seven-day window. Tests cover total and language-grouped weekly seconds for each case. The API documentation describes the parameter and behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Possibly related PRs
- crosspoint-reader/crosspoint-sync#43: Changes the data sources used by
/stats/overview, including time values used in grouped results. - crosspoint-reader/crosspoint-sync#42: Adds filters and
group_byresults to/stats/overview; this change applies the week-start behavior to every group.
Suggested reviewers: itsthisjustin
Merge Risk: 
Minimal · up to c3df4
-
No merge-blocking issue is identified for the optional week-start behavior; it is ready for normal merge checks.
Pre-merge checks: 
4
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
GET /api/v1/stats/overviewgivesweek_secondsfor the last 7 days. A reader that shows the calendar week can't get that number from the digest, so it would show a different week than the device's own stats.This adds
week_start=0(week from Sunday) andweek_start=1(from Monday):week_secondsthen counts the days since the week started, through today, at the top level and in everygroupsentry. Without the parameter nothing changes. Any other value is refused like the other invalid parameters.Tested: a new case in
test/stats-overview.test.ts(Wednesday 2026-10-21, reading last Thursday, Sunday, Monday and today: 1540 rolling, 1440 from Sunday, 840 from Monday). Also checked against a local server with mock X4 uploads. Full suite passes,tscclean.docs/API.mdupdated.