gioboa / jira-plugin

Jira plugin for VsCode
https://marketplace.visualstudio.com/items?itemName=gioboa.jira-plugin
MIT License
265 stars 41 forks source link

Allow the timer to run, even if VS Code is not in focus #8

Closed Sigggi closed 6 years ago

Sigggi commented 6 years ago

Great work so far. Thank you.

It would be nice to be able to track the time I have worked on an issue, not just the pure coding time.

Maybe with a setting?

gioboa commented 6 years ago

Hi, I'm really happy you like the plugin. :smile: I think your idea is a good improvement. We can create a setting for manage both cases:

gioboa commented 6 years ago

name: trackingTimeMode values:

@Sigggi What do you think?

Sigggi commented 6 years ago

Sounds good! Should be understandable for all, with a litte comment for the setting.

deftdawg commented 6 years ago

@Sigggi I'm also working on a patch that would add time away back to the counter if you came back to VScode within the timeout period. i.e. If you come back to VSCode within 20 minutes of it becoming inactive, it would add whatever amount of time you were away, if you were away longer it would not add any time when you came back. That way if you go off to a two hour meeting or leave for the day, it doesn't log time. This was my first attempt at that: https://github.com/jumpkick/jira-plugin/commit/5ae2a5f3681c6dd7a688f15361453c95a8a53fdb#diff-0922ea55b32cc9b36de80d4ae7b4bc1e, but it needs to be fixed up... Hopefully, I'll get a chance later on this week to work on it.

Sigggi commented 6 years ago

This is awesome! Never thought of that myself, but it makes perfectly sense.

Looking forward to it.

gioboa commented 6 years ago

Implemented this feature commit :stuck_out_tongue_winking_eye:

deftdawg commented 6 years ago

@Sigggi release 0.6.0 adds hybrid time tracking mode that behaves as I described... check it out :smile:

Sigggi commented 6 years ago

@jumpkick Works as described. Thanks!

One minor thing: If I lock the screen the timer keeps counting i.e. the away timer does not get triggered. I just have to remember to switch focus to something else, before locking. Would be cool, if there is an easy patch for that.

But nonetheless, I recommended this extension to my coworkers, mainly because of this new feature.

deftdawg commented 6 years ago

@sigggi that may or may not be a bug... The hybrid mode is designed to recover time if the interruption is under the timeout value (default 30 min), so even if you lock the screen and the away time is less (to go to get a coffee for 10 min or the bathroom for 5), that time would be added. That's intended behavior, I need to "recover" as close to 8 hrs of logged time a day again Jira tickets for billing/accounting reasons. If the 30 minutes timeout is too long, you can play with lowering that in the settings.

Now, if when you lock the screen vscode still adds time beyond the timeout elapsing, that would mean vscode doesn't know it's not focused.

You would be able to test that by switching to vscodefocus tracking mode and seeing if time is logged while the machine is locked.

If it turns out to be a bug in how vscode tracks focus while the machine is locked, file a bug and we can file a bug upstream and reference it.