Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ideas for timetrace report #88

Open
dominikbraun opened this issue May 28, 2021 · 26 comments
Open

Ideas for timetrace report #88

dominikbraun opened this issue May 28, 2021 · 26 comments
Labels
help wanted Extra attention is needed question Further information is requested topic/reports

Comments

@dominikbraun
Copy link
Owner

dominikbraun commented May 28, 2021

I'm planning for a timetrace report command which should generate a report of the tracked time. This issue is a small idea collection for the new command.

@FelixTheodor, @rocar, @rknizzle, @aaronsheah, @joshuaherrera, @Gealber, @KonstantinGasser, @adzo261, @obnoxiousnerd, @aligator and @nrobinson2000 should feel free to add their suggestions here!

@dominikbraun dominikbraun added help wanted Extra attention is needed question Further information is requested topic/reports labels May 28, 2021
@dominikbraun
Copy link
Owner Author

  • Reports should be exportable as JSON.

@dominikbraun
Copy link
Owner Author

  • There should be a --billable flag to generate reports only for billable records.

@KonstantinGasser
Copy link
Contributor

Does the report needs to follow a specific structure in order to be import it into some other software? If so, providing CSV output might also be useful in addition to JSON, right?
timetrace report where the default could be JSON and report can have a csv flag?

@dominikbraun
Copy link
Owner Author

I'd suggest that timetrace report prints a table as usual, and a --output option accepts json and csv as values.

@KonstantinGasser
Copy link
Contributor

Ok I see.
If timetrace start project has not been stopped yet should this ongoing period be ignored in the report or be included?
I guess another question would be whether the user defines the output directorty/file or if the report.json/csv will be stored in a ~/.timetrace directory?

@dominikbraun
Copy link
Owner Author

If timetrace start project has not been stopped yet should this ongoing period be ignored in the report or be included?
I guess another question would be whether the user defines the output directorty/file or if the report.json/csv will be stored in a ~/.timetrace directory?

Good questions - especially the latter one should be discussed.

@KonstantinGasser
Copy link
Contributor

Since timetrace provides an interface to its config one other option could be to let the user change the lets say report-dir config field to whatever directory. The default could be in for example the ~/.timetrace/reports directory?

@retronav
Copy link
Contributor

If timetrace start project has not been stopped yet should this ongoing period be ignored in the report or be included?

I think it would make sense to give an alert about the ongoing tracking and then tell them to stop tracking before creating the report.

@joshuaherrera
Copy link
Contributor

I like the idea. I'd imagine we could implement different commands / flags to customize the created report.
We could use a --project <key> flag to grab all time logged on a project, or filter the report by time, e.g. a --month <month>, --week <weekNumber> or use a combination of --start and --end flags to get all time tracked for the month or week, or within some time frame, irrespective of project.

Thoughts or concerns?

@dominikbraun
Copy link
Owner Author

dominikbraun commented May 29, 2021

Since timetrace provides an interface to its config one other option could be to let the user change the lets say report-dir config field to whatever directory. The default could be in for example the ~/.timetrace/reports directory?

@KonstantinGasser Yes, we could introduce a config value for that, or an --output/-o flag, or even both.

@KonstantinGasser
Copy link
Contributor

@dominikbraun I would be happy to implement a first proposal if that's ok.

@KonstantinGasser
Copy link
Contributor

@dominikbraun for clarification I have one more question. The generated report is only for one project, right? So the user would call the command with the project name like so report <ProjectKey> and the report would hold all recorded records for this project? Or would report hold a list of all projects with its records?

@dominikbraun
Copy link
Owner Author

@dominikbraun for clarification I have one more question. The generated report is only for one project, right? So the user would call the command with the project name like so report <ProjectKey> and the report would hold all recorded records for this project? Or would report hold a list of all projects with its records?

Both use cases would make sense: Generating a report of all projects I've been working on from date X to date Y, as well as generating a report for a particular project.

Maybe it would be sufficient to generate a report for all projects by default and generate a report for a single project using a --project flag?

@KonstantinGasser
Copy link
Contributor

Yes I feel this would be intuitive to have the ---project flag and else make a report for all records between the time frame.
When it comes to the json output do you have anything special in mind here or would the following json ok?
For all project: {key_1: [{},{}], key_2:[{},{}]...}
For one project {key: [{},{}]}

@dominikbraun
Copy link
Owner Author

Yes, that should work if I'm not missing something 😄

@KonstantinGasser
Copy link
Contributor

KonstantinGasser commented May 31, 2021

@dominikbraun I am almost done with this issue I just wanted to cross check the results with you and clarify one question.

When it comes the to output table I included a total time for each project. However, I am not sure whether each record-row in the table needs to display its total. Below I have three tables as an example. (for the project timetest I forgot to stop the tracking that's why it shows such a high total time 😄). I prefer the last table version as it looks more organised and structured - easy to understand

All rows with total
+-----------+---------+-------+------------+---------------+
|  PROJECT  |  START  |  END  |  BILLABLE  |     TOTAL     |
+-----------+---------+-------+------------+---------------+
| test      | 00:37   | 00:37 | no         | 0h 0min 9sec  |
| test      | 00:37   | 00:37 | no         | 0h 0min 9sec  |
| test      | ---     | ---   | ---        | 0h 0min 18sec |
| edittest  | 12:35   | 12:41 | no         | 0h 6min       |
| edittest  | 12:35   | 12:41 | no         | 0h 6min       |
| edittest  | 09:10   | 09:10 | no         | 0h 0min 20sec |
| edittest  | ---     | ---   | ---        | 0h 13min      |
| time      | 14:46   | 15:10 | no         | 0h 23min      |
| time      | 14:46   | 15:10 | no         | 0h 23min      |
| time      | ---     | ---   | ---        | 0h 47min      |
| seconly   | 15:10   | 15:11 | no         | 0h 0min 22sec |
| seconly   | 15:15   | 15:49 | no         | 0h 33min      |
| seconly   | 15:10   | 15:11 | no         | 0h 0min 22sec |
| seconly   | 15:15   | 15:49 | no         | 0h 33min      |
| seconly   | ---     | ---   | ---        | 1h 8min       |
| timetest  | 15:52   | 15:53 | no         | 0h 1min       |
| timetest  | 16:00   | 15:55 | no         | 23h 54min     |
| timetest  | 15:52   | 15:53 | no         | 0h 1min       |
| timetest  | 16:00   | 15:55 | no         | 23h 54min     |
| timetest  | ---     | ---   | ---        | 47h 50min     |
+-----------+---------+-------+------------+---------------+
Only project total
+-----------+---------+-------+------------+---------------+
|  PROJECT  |  START  |  END  |  BILLABLE  |     TOTAL     |
+-----------+---------+-------+------------+---------------+
| test      | 00:37   | 00:37 | no         |               |
| test      | 00:37   | 00:37 | no         |               |
| test      | ---     | ---   | ---        | 0h 0min 18sec |
| edittest  | 12:35   | 12:41 | no         |               |
| edittest  | 12:35   | 12:41 | no         |               |
| edittest  | 09:10   | 09:10 | no         |               |
| edittest  | ---     | ---   | ---        | 0h 13min      |
| time      | 14:46   | 15:10 | no         |               |
| time      | 14:46   | 15:10 | no         |               |
| time      | ---     | ---   | ---        | 0h 47min      |
| seconly   | 15:10   | 15:11 | no         |               |
| seconly   | 15:15   | 15:49 | no         |               |
| seconly   | 15:10   | 15:11 | no         |               |
| seconly   | 15:15   | 15:49 | no         |               |
| seconly   | ---     | ---   | ---        | 1h 8min       |
| timetest  | 15:52   | 15:53 | no         |               |
| timetest  | 16:00   | 15:55 | no         |               |
| timetest  | 15:52   | 15:53 | no         |               |
| timetest  | 16:00   | 15:55 | no         |               |
| timetest  | ---     | ---   | ---        | 47h 50min     |
+-----------+---------+-------+------------+---------------+
With blank row between projects
+-----------+---------+-------+------------+---------------+
|  PROJECT  |  START  |  END  |  BILLABLE  |     TOTAL     |
+-----------+---------+-------+------------+---------------+
| test      | 00:37   | 00:37 | no         |               |
| test      | 00:37   | 00:37 | no         |               |
| test      | ---     | ---   | ---        | 0h 0min 18sec |
|           |         |       |            |               |
| edittest  | 12:35   | 12:41 | no         |               |
| edittest  | 12:35   | 12:41 | no         |               |
| edittest  | 09:10   | 09:10 | no         |               |
| edittest  | ---     | ---   | ---        | 0h 13min      |
|           |         |       |            |               |
| time      | 14:46   | 15:10 | no         |               |
| time      | 14:46   | 15:10 | no         |               |
| time      | ---     | ---   | ---        | 0h 47min      |
|           |         |       |            |               |
| seconly   | 15:10   | 15:11 | no         |               |
| seconly   | 15:15   | 15:49 | no         |               |
| seconly   | 15:10   | 15:11 | no         |               |
| seconly   | 15:15   | 15:49 | no         |               |
| seconly   | ---     | ---   | ---        | 1h 8min       |
|           |         |       |            |               |
| timetest  | 15:52   | 15:53 | no         |               |
| timetest  | 16:00   | 15:55 | no         |               |
| timetest  | 15:52   | 15:53 | no         |               |
| timetest  | 16:00   | 15:55 | no         |               |
| timetest  | ---     | ---   | ---        | 47h 50min     |
+-----------+---------+-------+------------+---------------+

@dominikbraun
Copy link
Owner Author

dominikbraun commented May 31, 2021

Thanks, @KonstantinGasser! I'd also prefer the last one as it is the cleanest and simplest approach.

Tablewriter also supports table footers and cell merging. Maybe there is a way to make use of this for the individual projects or for all projects? In the current state of main, out.Table supports footers.

@KonstantinGasser
Copy link
Contributor

@dominikbraun Cool I fetched the latest main and will try it out! Preferable would be to have a cell merging for each project and each project again as a "footer" with its total + a "group" total of all projects at the end, right?

@dominikbraun
Copy link
Owner Author

@dominikbraun Cool I fetched the latest main and will try it out! Preferable would be to have a cell merging for each project and each project again as a "footer" with its total + a "group" total of all projects at the end, right?

Yes, something like this. But you're totally free to choose the best looking variant 😎

@KonstantinGasser
Copy link
Contributor

Ok I will experiment a little 😄

@panmanio
Copy link

panmanio commented Jun 27, 2021

Hi all,

two ideas for timetrace report:

  • can we have a --nonbillable / -B flag for non-billable entries only (the opposite of --billable / -b)?
  • are there plans for --project to include project modules? Currently (v0.11.0) modules are not included when --project is present. Could be done with another flag (--modules / -m).

@dominikbraun
Copy link
Owner Author

@maniowy Thanks for your suggestions! They both make sense and I created two issues for them: #140 and #141.

@KonstantinGasser
Copy link
Contributor

just opened a PR closing #141

@KonstantinGasser
Copy link
Contributor

also create a PR for filter by module, closing #140

@c-nv-s
Copy link

c-nv-s commented Nov 30, 2021

will tags be/optionally be output with the report as well?

@dominikbraun
Copy link
Owner Author

will tags be/optionally be output with the report as well?

There's issue #202 for that. If no PR will be opened, I'll implement that myself within the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested topic/reports
Projects
None yet
Development

No branches or pull requests

6 participants