eatgrass / obsidian-pomodoro-timer

A pomodoro timer that helps manage your daily focus
MIT License
92 stars 5 forks source link

Focusing on a specific task does not log the task timings #30

Closed GanapathyRaman closed 5 months ago

GanapathyRaman commented 5 months ago

Tested Version - v1.1.8

P.S: I have tested with Simple, Verbose and Custom log format. Does not work in all three formats.

eatgrass commented 5 months ago

Hi, @GanapathyRaman, sorry about this bug The bug has been fixed in the latest update. Please let me know if it's resolved.

GanapathyRaman commented 5 months ago

Thanks @eatgrass for swiftly fixing the bug. I did a quick test on v1.1.19. It seems to work fine. Pomodoro count increases and logs with start & end time appear in the log file. But one quick suggestion: Is it possible to append the logs below the task rather than appending the new log at the end of the file? Example, let say we have two task Task-1 and Task-2: [ ] Task-1 [ ] Task-2

If I focus on Task-1, and the timer ends, log appear at the end of the file. [ ] Task-1 [ ] Task-2

Now I have to manually move the log below Task-1 so that if I run dataview query, logs can be counted as part of a particular task.

After manual movement: Example: [ ] Task-1

Can this be done automatically? Thanks in Advance!

eatgrass commented 5 months ago

Yes, here is another issue also mentioned about this #21

And I've tried to implement this feature, appending the log right under the task as a sublist, which means I need to write the log with correct indentation, but the indentation might vary depending on the user's setting, so... I just got stuck in retrieving the correct indentation

GanapathyRaman commented 5 months ago

Ah I see the challenge now. But what if we extend the log format (for focused tasks) to have the task name after (pomodoro::WORK). Then we can write the dataviewjs query to sum the duration based on task name. Other (un-focused tasks) can be categorized into General/Miscellaneous. Doing this way probably we might not have to worry about the indentation. What's your thought on this idea?

eatgrass commented 5 months ago

Sure, a custom log format can be used to extend the log as needed, and here's an example for reference: https://github.com/eatgrass/obsidian-pomodoro-timer?tab=readme-ov-file#custom-log-template-optional.

WGretz commented 5 months ago

Yes, here is another issue also mentioned about this #21

And I've tried to implement this feature, appending the log right under the task as a sublist, which means I need to write the log with correct indentation, but the indentation might vary depending on the user's setting, so... I just got stuck in retrieving the correct indentation

What if you make a setting where we can pick our tab size and then either use that or strip the white space up to the start of the task and add our tabsize to that?