Merged
Conversation
Owner
|
Thanks for the change (and the bias for action 🙌). I'll take a look at the requirement and the change in the next few days. |
Owner
|
Hi! Once again, thanks for sending in the change. I think adding this feature makes sense. Although, I would prefer to do this via a single flag that accepts a value for the task status to be used for filtering. That way we leave scope for another task status that hasn't been added yet. I've created a first draft PR with changes that I thought made sense here. Lemme know what you think about it :) |
Contributor
Author
|
LGTM! |
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.
Closes #55.
I took the liberty to refactor the interface to
getStatsso it's a bit cleaner to pass arguments for different situations (i.e. w/ interval or not).Feel free to change stuff around; you might want to rename some stuff or re-format (I don't like long lines since I sometimes use split panes/windows and line wraps make code less readable IMO, but you're the boss here).
✨ Copilot summary
This pull request introduces a new feature to filter tasks based on their active status in the
hoursapplication. The changes span multiple files and add functionality to view active, inactive, or both types of tasks in various reports.New Feature: Task Active Status Filter
cmd/root.go: Added flags--activeand--inactiveto filter tasks based on their active status in thestatscommand. UpdatedRenderStatscall to include the new filter parameter. [1] [2] [3]internal/types/types.go: IntroducedTaskActiveStatusFiltertype and constants to represent active, inactive, and both task filters. Added methods to check the filter status.internal/persistence/queries.go: ModifiedFetchStatsandFetchStatsBetweenTSfunctions to accept the new filter and apply it in SQL queries. [1] [2]internal/ui/stats.go: UpdatedRenderStatsfunction to use the new filter and refactored to use astatsFetcherstruct for fetching stats based on the filter. [1] [2] [3] [4]internal/ui/cmds.go,internal/ui/initial.go,internal/ui/log.go,internal/ui/model.go,internal/ui/report.go,internal/ui/update.go: Updated various functions and models to pass and handle the newactiveFilterparameter. [1] [2] [3] [4] [5] [6] [7] [8] [9]These changes collectively add the ability to filter tasks by their active status, enhancing the usability of the
hoursapplication by allowing users to focus on specific types of tasks in their reports.