Add single-day review mode#380
Open
ozymandiashh wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Demo video for the macOS menubar day selector. |
Member
|
Nice I was thinking in same direction.. I will take this PR and try add some addtions like user can select range of days or select multiple random days and also tune the ui |
Contributor
Author
|
Lovely |
7 tasks
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.
Summary
Adds a single-day review mode so users can inspect CodeBurn usage for an exact calendar day after the day has passed.
This is meant for the common “worked past midnight, review yesterday later” workflow: the CLI, TUI, JSON output, and macOS menubar can now select one specific day instead of only fixed rolling periods.
Root cause
CodeBurn had fixed period selectors such as Today, 7 Days, 30 Days, Month, and All. That made it hard to review a specific previous day once midnight passed, especially in the menubar where the selected period always mapped to a moving range.
The menubar also needed separate handling for selected historical days: the menu bar icon should continue showing today's spend, while the opened popover can display a chosen review day.
What changed
--day <YYYY-MM-DD|today|yesterday>tocodeburn report.--day <YYYY-MM-DD|today|yesterday>tocodeburn status --format menubar-json.report --dayusage with--from/--to.report --dayis used.Behavior proof
I used a controlled Claude JSONL fixture with three adjacent days in the same session file:
Before this PR, on
origin/main, the exact-day selector does not exist:After this PR, the same fixture filtered with
--day 2026-04-10returns only the selected day. The day before and day after are excluded from the current report:{ "periodKey": "day", "period": "Day (2026-04-10)", "overview": { "cost": 0.000996, "calls": 1, "sessions": 1, "tokens": { "input": 222, "output": 22, "cacheRead": 0, "cacheWrite": 0 } }, "daily": [ { "date": "2026-04-10", "calls": 1, "turns": 1, "editTurns": 1, "oneShotTurns": 1, "oneShotRate": 100 } ], "topSessions": [ { "project": "myapp", "date": "2026-04-10", "calls": 1 } ] }The wider range over the same fixture proves there are three available days, so the single-day output above is actually filtering, not missing data:
{ "period": "2026-04-09 to 2026-04-11", "overview": { "calls": 3, "tokens": { "input": 666, "output": 66 } }, "daily": [ { "date": "2026-04-09", "calls": 1 }, { "date": "2026-04-10", "calls": 1 }, { "date": "2026-04-11", "calls": 1 } ] }The menubar JSON path uses the same selected day for the opened popover:
{ "label": "Day (2026-04-10)", "cost": 0.000996, "calls": 1, "sessions": 1, "providers": { "claude": 0.000996 }, "topProjects": [ { "name": "myapp", "sessions": 1, "sessionDates": ["2026-04-10"] } ] }Ambiguous CLI usage is rejected instead of silently mixing date modes:
The macOS menubar app was also installed locally and tested with the calendar selector. Demo video can be attached to this PR.
Validation
npm test -- --run- 65 files / 932 tests passed.npm run build- passed.npx tsc --noEmit- passed.swift build- passed.git diff --check origin/main...HEAD- passed.