c6p / logseq-habit-tracker

Habit tracker for Logseq
MIT License
95 stars 5 forks source link

TODO habits are being counted as "green" #20

Closed mikob closed 1 year ago

mikob commented 2 years ago

First of all, really like how user-friendly your plugin is, and love the visualization! I haven't been able to use it successfully, because it has always marked my TODO items as completed. Haven't done anything special in the settings.

Here are my settings: image

All the days that are green there are actually still in TODO and not marked DONE (so they shouldn't be green in the habit tracker): image

The days that are red are actually a separate issue where LogSeq isn't putting my journal template in some days that I manually create the journal page for. You can ignore that.

I'm on the latest version of your plugin and LogSeq 0.8.0.

c6p commented 2 years ago

Thanks, @mikob.

It seems the ignore pattern does not match entries where time is tracked (i.e. 0s on the right), due to newline characters. The plugin uses :block/content to match habits, you can observe LOGBOOK inserted after \n to track time by clicking (Dev) Show block data if developer mode has been enabled.

In the meantime, you can change your ignorePattern to TODO (.|\n)*.

I'll provide either a fix or a more sensible default for the ignore pattern in the next version.

Cheers

mikob commented 2 years ago

@c6p nice catch, yes that fixes it!