mathisdt/trackworktime

-5 min button

Opened this issue · 4 comments

I'd like to add an -5 min button which would substract 5 minutes from the timestamp of the last event. My use case for this is that sometimes I forget to clock in/out and I only realize that 15 minutes later. Tapping -5' three times would be easier than going to the list of events, clicking the last one and editing the start time with the clock.

I can implement this myself (I think) in a fork, but if there is a chance that it could get upstreamed to here I'd like to imedatly do it in a way thay would be accepted here.

Any feedback is welcome,

Very quick sketch of the idea::
image

Nice idea, I can imagine this could come in handy. But why stop at just "subtract 5 minutes"? Maybe there could be a "+" button and a "-" button, which each open a menu or a dropdown with some options, maybe like this (for "minus" case):

  • -15
  • -10
  • -5
  • previous quarter hour

The buttons would have the effect of reducing the clocked time by the mentioned amount, but if the last interval is smaller than the amount, then the logic would have to remove the last interval and move the end event of the previous interval to match the amount wanted by the user. For example: interval A is 10:00 - 11:00 and interval B is 12:00 - 12:02 => "minus 5 minutes" would have to remove interval B and make interval A go from 10:00 to 10:57.

The option "previous quarter hour" (or "next quarter hour" respectively in case of the "+" button) would match the total time to quarter hours. For example: interval A is 10:00 - 10:50 and interval B is 12:00 - 12:15 => "previous quarter hour" would have to make interval B go from 12:00 to 12:10 so the total worked time is 1 hour. "next quarter hour" would make interval B go from 12:00 to 12:25 so the total worked time is 1 hour and 15 minutes.

As to where the buttons should be: maybe it would be nice to have them right under the table in an extra row above the "start tracking" / "stop tracking" buttons, so it's clear that they operate on the data shown in the table. And probably there should be a short title before the buttons, e.g. like "edit last clocked interval:", so the user knows what the buttons do.

Also, it's important that the buttons act responsibly when another week than the current week is shown in the table - in this case they should operate on the shown week. Or perhaps they should be disabled if an old week is shown?

This way it would definitely be something I'd really like to accept as a pull request (of course with attribution in the history except if you don't want that). 😃

If you only want to implement a subset of the above, that would also be fine. It can be extended later (not necessarily by you, if you don't want that).

It's on my todo list to only implement the -5 and +5, I would not add the -10 etc as these can be done by tapping the same button multiple times, your finger is on the button anyway.

But it might be some weeks before I start on this. So if you already want to do it yourself, you shouldn't wait for me 😅

Feels like this feature should be added to the screen that shows after long pressing "start tracking".

Similar feature already exists, but only for adding event in future. I guess it would be possible to add an event in the past there and improve UX a bit, for quick +5 or -5.