obsidian-task-collector
obsidian-task-collector copied to clipboard
support for dataview task view
Given that the latest beta support alternate checkboxes https://github.com/blacksmithgu/obsidian-dataview/issues/812, would it be possible to change their status via this plugin's right click menu ?
I'll have to try it.
I'm wondering about the same thing! I can put in some of the work to make this happen, I think, with some guidance...
It seems like it's not super straightforward. If I'm reading the TC code right, the plugin picks up the task to complete by reading the line that's activated by the right-click action (line 112):
https://github.com/ebullient/obsidian-task-collector/blob/75640e7ec5a2d3b1232cedf8a23693cab2d26fb5/src/taskcollector-Plugin.ts#L103-L116
Dataview items, though, aren't really on "lines," are they?
And yet, when I look under the hood at the HTML in Reading mode, I can't see a difference between Dataview Tasklist-generated checkboxes and "regular" checkboxes. Why is Task Collector adding this menu to a regular checkbox....

... but not this dataview-generated checkbox?

Dataview tasks are not added using the markdown renderer, so the markdown post-processor doesn't see them (which means I can't add the event handler to them). It creates the input boxes directly, and uses its own click handler (which TC would be in a race with, effectively).
In the end, I need some help from dataview to get this to work. I added some comments here: https://github.com/blacksmithgu/obsidian-dataview/issues/812
I was able to get pretty close, but there was a bit of fighting between my handler and the dataview handler. I was also missing the dataview context, so while I could update the source correctly, the task view wasn't updated to show that...
How funny that that conversation happened less than a day ago. Serendipity! I had no idea anyone else was thinking about this 'til I started poking around this morning.
It looks like @blacksmithgu might get it the rest of the way. Fingers crossed. 🤞
I was playing with it yesterday. Great minds... ;)
This is .. a way: https://github.com/blacksmithgu/obsidian-dataview/pull/1048
My hero!
I think the outstanding user question is which way it should go. I have a BRAT release with a Task Collector API (so things can invoke the modal w/ complete/incomplete task completion characters defined), that's how the above PR works.
Alternately, Dataview could provide a hook so that I can override the event listener. The advantage there is that Task Collector can consolidate marking tasks (complete/reset, etc), which would make things more consistent across Dataview and elsewhere.
Not sure which is better or which makes more sense.
I'm adding the ability for plugins to override or extend the default dataview task hook in the next beta :)