Skip to content

[codex] fix 7d report range to last7#33

Merged
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/fix-report-last7
Jun 8, 2026
Merged

[codex] fix 7d report range to last7#33
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/fix-report-last7

Conversation

@ericweichun

@ericweichun ericweichun commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Map Project Usage 7d to a trailing last7 report window instead of calendar week.
  • Keep week as the calendar-week report period for callers that want it explicitly.
  • Add --last7 to the report CLI and update the analyzer tests to cover the split.

Test plan

  • .venv/bin/python -m pytest tests/test_analyzer_pipeline.py tests/test_usage_cli.py tests/test_html_report_snapshot.py -q
  • .venv/bin/ruff check menubar.py analyzer/reporter.py usage_cli.py tests/test_analyzer_pipeline.py tests/test_usage_cli.py
  • .venv/bin/mypy menubar.py analyzer/reporter.py usage_cli.py tests/test_analyzer_pipeline.py tests/test_usage_cli.py
  • Manually verified in menu bar mode / TUI mode (if UI-related)

Notes for reviewer

  • This keeps the Project Usage label semantics aligned with the UI: 7d is recent seven days, while week remains a calendar-week period for any existing explicit callers.
  • The new last7 period gets the same comparison treatment as week and month, so the report still shows a previous-window comparison for seven-day ranges.

@ericweichun ericweichun marked this pull request as ready for review June 8, 2026 05:03
@aqua5230 aqua5230 merged commit ff4cb87 into aqua5230:main Jun 8, 2026
1 check passed
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.

2 participants