feat: extract summary into its own command and refine list output - #18
Merged
Conversation
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.
What changed
summaryis now its own command (breaking change)list --summaryis replaced by a dedicatedsummarycommand. The flag mixed two different reports into one command, which produced silent no-ops:--summary --output jsonignored the summary and exported individual entries, and--summary --idsignored the flag entirely. Splitting them removes those invalid combinations.summaryaccepts the same period selection aslist(--from/--to,--period, and the--today/--yesterday/--week/--last-week/--month/--last-monthshortcuts) plus--work-item.Shared period resolution
The date-range logic — including the mutual-exclusion rules between the period shortcuts,
--periodand--from/--to— was extracted intoUtils/PeriodResolverbehind a newIPeriodOptionsinterface implemented by bothListOptionsandSummaryOptions. This avoids duplicating non-trivial validation across the two commands and shrinks the list handler by roughly 60 lines.Output refinements
--ids, the entry ID now appears as the last column, taking the place of the comment column instead of leading the row.DAYcolumn is nowWEEKDAY, making it clear it holds the day of the week rather than a date.Migration
Replace
timetracker list --summarywithtimetracker 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),--idsand--outputonlist, and that the removed flag now fails as an unknown option.