Skip to content

feat: extract summary into its own command and refine list output - #18

Merged
jonas1307 merged 4 commits into
mainfrom
feat/summary-command
Jul 22, 2026
Merged

feat: extract summary into its own command and refine list output#18
jonas1307 merged 4 commits into
mainfrom
feat/summary-command

Conversation

@jonas1307

Copy link
Copy Markdown
Owner

What changed

summary is now its own command (breaking change)

list --summary is replaced by a dedicated summary command. The flag mixed two different reports into one command, which produced silent no-ops: --summary --output json ignored the summary and exported individual entries, and --summary --ids ignored the flag entirely. Splitting them removes those invalid combinations.

summary accepts the same period selection as list (--from/--to, --period, and the --today/--yesterday/--week/--last-week/--month/--last-month shortcuts) plus --work-item.

Shared period resolution

The date-range logic — including the mutual-exclusion rules between the period shortcuts, --period and --from/--to — was extracted into Utils/PeriodResolver behind a new IPeriodOptions interface implemented by both ListOptions and SummaryOptions. This avoids duplicating non-trivial validation across the two commands and shrinks the list handler by roughly 60 lines.

Output refinements

  • The period header and the totals footer now render in grey, so the table stands out as the actual result while the surrounding context recedes. Grey was chosen over the relative dim style because it renders more predictably across terminal themes.
  • With --ids, the entry ID now appears as the last column, taking the place of the comment column instead of leading the row.
  • The DAY column is now WEEKDAY, making it clear it holds the day of the week rather than a date.

Migration

Replace timetracker list --summary with timetracker summary (all period options carry over unchanged).

Verification

Validated locally: both commands across all period options, the shared error paths (mutually exclusive shortcuts, shortcuts combined with --from/--to, invalid --period), --ids and --output on list, and that the removed flag now fails as an unknown option.

@jonas1307
jonas1307 merged commit 6965429 into main Jul 22, 2026
1 check passed
@jonas1307
jonas1307 deleted the feat/summary-command branch July 22, 2026 15:35
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