Open micxer opened 6 years ago
That's definitely a feature to implement, thanks for the suggestion.
I am not sure if this is the same or I should open another issue:
Toggle started
command adds @lasted
when stopping an in-progress task.@lasted
tags.This is useful because it enables people to use time tracking when work on a task is split over multiple sessions, e.g.: you're working on something and are interrupted (phone call, lunch break, urgent stuff to do, work on a task across two days); or you can re-open a "done" task if you need to revisit it with a little extra work.
If this is OK with you I could PR this feature.
@jods4 there are a few differences between your proposed solution and @micxer's. Yours has the ability to re-open a "done" task
, but it deviates from PlainTasks' behavior, and being as much compatible as possible with PlainTasks is important for this extension.
I'd be willing to consider a PR that implements the ability to toggle the timer the same way that PlainTasks does it.
Could you elaborate? I'm not familiar with PlainTasks.
@jods4 you should just try it. I'm not sure I can explain it clearly, but basically each odd @toggle(date)
pauses the timer and each even @toggle(date)
resumes the timer. So the time between a pause and a resume is subtracted from the lasted/wasted time.
@fabiospampinato I don't have Sublime and I'm happy with VS Code.
Sooo.... given TODO+ doesn't use @toggle
, something like this?
Task @started(10:00)
Task @started(10:00) @stopped(12:00) @lasted(2h)
Task @started(10:00) @stopped(12:00) @started(13:00) @lasted(2h)
Task @started(10:00) @stopped(12:00) @started(13:00) @done(14:00) @lasted(3h)
Bonus points:
@started
and @stopped
except the last started. What I imply here is: you can delete them if you don't care and just keep @lasted
and it still updates properly.@started
and @stopped
, leaving only @lasted
and @done
on the item.@jods4 we are currently appending @done
/@cancelled
if the task is completed, and, respectively, @lasted
/@wasted
if time tracking for that task was active.
If we are going to implement this I want it done the way PlainTasks does it, no @stopped
, no multiple @started
. What you're proposing, if I'm understanding it correctly, might be easier to read (but I don't think this matters much in this case) but it will make it more difficult for folks to switch from PlainTasks to Todo+, which I'm more interested in.
Being able to track time across multiple work sessions is very useful to me. I can try to produce a PR if you spec the behavior you'd like.
@jods4 I would like it to work like this:
☐ Rename the `Todo: Toggle Timer` command to `Todo: Toggle Status Bar Timer`
☐ Maybe we should also assign this to `alt+shift+t` 🤔
☐ Add a `Todo: Toggle Timer` command
☐ Assign it to `alt+t`
☐ If the item where it's being used is not a todo (comment, project) it displays an error
☐ Else if the todo is completed it displays an error
☐ Else if the todo is not started it displays an error
☐ Else it adds the `@toggle(date)` tag
☐ `date` is formatted using `todo.timekeeping.started.format`
☐ an uncompleted todo with `@started` and an odd number of `@toggle` _after_ its `@started` tag is considered not active
☐ an uncompleted todo with `@started` and an even number of `@toggle` _after_ its `@started` tag is considered active
☐ the first active started todo is the one whose timer is being displayed in the status bar
☐ when a started todo is completed the `@lasted`/`@wasted` time is computed like this:
FYI IIRC there is a bit of code in there to synchronize the seconds with the current ones (in order to avoid displaying weird stuff into the status bar timer), unless the seconds are specified in `date`
☐ [PAUSE] If there is a `@toggle` tag _after_ `@started` do `elapsed += ( difference between this toggle and started )`
☐ [RESUME] If there is another `@toggle` tag resume counting from it's date
☐ [PAUSE] if there is another `@toggle` tag do `elapsed += ( difference between this toggle and the previous toggle )`
☐ and so on...
☐ [END] if there isn't another `@toggle` and the timer is not paused do `elapsed += ( difference between the last toggle, or the started date, and now )`
☐ Update the readme
Let me know if there are unclear points.
@jods4 That's a bigger change than I expected. I'm interested but won't have the time to tackle that right now. Maybe later, I'll stay in touch.
Hey, just wondering if any progress on this has been made?
Hey guys, another year later i want to revive this. I don't know what would be easier to implement:
@paused(_time_)
and @resumed(_time_)
started(_time)
and @stopped(_time)
If i'd know how, i'd offer my help, but i've never done any work on extensions.
Being compatible with PlainTasks @toggle(<datetime>)
would be awesome, particularly when migrating over, but I wonder if that design could also be improved upon, because as often as I jump between tasks my toggles would stack up, which is kinda messy.
What do you think of an option (for those of us that don't share the same todo file between both) to gather those toggles into a @pausedFor(<duration>)
. ie. calculate the elapsed pause duration with each toggle action and rewrite with that instead of leaving all the toggles listed one after the other? That is ..
@pausedFor
duration replaces the toggles.@pausedFor
duration.@pausedFor
duration replaces them, and a new toggle is added.In each case, the duration(s) of any existing @pausedFor
s would be summed together along with the latest calculated duration, and replaced with just one entry.
Then, at the end, the entry would look something like this instead
Plus, if I'd need to manually update my pause time for those times I forget to toggle the pause on or off (happens a lot), it would be easier to edit just one duration value instead (before pressing my next toggle or done).
Or, actually, I guess the pausedFor duration would map directly to the @wasted
label when it's done.
@arkadianriver
@pausedFor
and hide all of the @toggle
and automatically wrap them together on the @done
/ a VSCode command - i.e. Todo: Calculate paused time
Just switched from SublimeText and PlainTasks. I am missing the option to toggle the time tracking on a task when switching to another one. That would make the time tracking even more useful.
Otherwise the extension made the migration to VS Code a least possible. Thanks.