Instead of pre-defined statuses, a more flexible approach is to allow tags to hold a value. For example, #status(delegated), #status(skipped) or #status(wait) and so on. Then the query could be something like: status is "wait" or status is not "skipped".
Similarly for due and defer dates, one could have #due(2021-06-18) or #defer(2021-06-18) and then query with operators such as due < 2021-06-19 or defer > 2021-06-18.
The general form of a query is: tag followed by operator or comparator followed by a value.
Of course, this is not a new idea. Taskpaper does this using @ to denote tags instead of #.
This is really an incredible plugin, @schemar. Thanks for making it! Can you say a little bit about how it worksā¦ how does it do its magic? I ask because (a) Iām curious and (b) Iād like to get an idea of how scalable it is. Suppose I have a file with one query block. When I generate a preview, does it scan through all my markdown files to find the ā-[ ]ā lines that meet the query criteria? Alternatively, does the plugin maintain a database (e.g., sql) of ā- [ ]ā lines from which it pulls out the items matching a query? The database is updated whenever a file is created, edited or deleted.
Let me start by saying that there are definitely parts that can be optimized. However, so far it seems it works for most (all?) vaults without further optimization.
Also: all the event handling and dynamic updates of the rendered markdown preview are only possible due to Obsidianās amazing plug-in API/infrastructure.
Obsidian has s.th. called a metadata cache. When you start obsidian, it scans all files and stores some metadata for each file. For example all tags or checklist items. The Tasks plugin waits for the metadata cache to finish. Then, or every file in the vault, Tasks asks the metadata cache for checklist items. If a file has checklist items, Tasks goes through all of them and parses them. So simplified: when you start Obsidian, Obsidian scans your whole vault for checklist items and then Tasks scans all checklist items (from the files in the vault).
During the inital scan, the Tasks plugin builds an in-memory cache of all tasks (with the additional data like due date, done date, and so on). After the initial scan, Obsidian will tell the Tasks plugin whenever a file has changed. Every time that happens, Tasks re-scans the checklist items of that file for tasks. In its in-memory cache, tasks replaces the old tasks from that file with the new tasks.
When you have a query block, it takes all tasks from the Tasks plugins in-memory cache and searches for all tasks that match the query. All matching tasks are sorted and then added to the markdown preview.
When a file changes and therefore the in-memory task cache changes, Tasks tells all rendered query results that there has been an update and each rendered query updates itself based on the existing query and the updated tasks. When a rendered query is removed, e.g. due to a closed file/panel, it wonāt update anymore.
Hope this helps! Feel free to ask for more details! (the source is open too, of course )
Thanks very much, @schemar, for that detailed and very clear explanation. The reason I had asked the question was scalability. I wanted to be sure that I use the plugin in a way that minimizes workload and scales well as my vault grows. Iāll probably have follow-up thoughts/questions which Iāll post here. Thanks again for a great plugin!
Hi,
I just started with Obsidan and the Tasks plugin - mindblowing and awesome. Congratulation to this plugin.
Simple beginnerās question: I canāt find find out how to write the signifier for date and recurring. Is there any shortcut?
Thanks,
Simon
I just returned to Obsidian after a brief flirtation with Craft. This plug-in is awesome. Is there anyway to have task dependencies? So task 2 is available when task 1 is done?
First of all, thank you for this plugin. I am relatively new to Obsidian and appreciate the functionality the task plugin provides.
I was wondering if you had considered adding a tag support to the task queries for often-used tag combinations in tasks.
For instance, I could configure the task plugin settings to include andā:house: for high-priority home and low-priority home tasks, respectively. Then when I create a task using the Create/Edit Task menu, I can easily choose from these (via a dropdown?) so that the tags are appended to the task and I can query against them.
Examples of emoticon tag combinations and a query:
I was just wondering whether it might be possible to display the days remaining until a given task? This is something I have setup in my Notion workflow, and have used in other task manager applications. It really helps to visualise deadlines, etc.
Yes, exactly! I wonder if that could be added next to the date in the task itself?
I can appreciate that the view might become a little cluttered so perhaps it might be useful to include separators between the various details of the task.
Toggles in the plugin settings could be used to enable/disable different views to the userās liking.
Iāve attached an image to demonstrate how this might look in practice below:
Another suggestion would be the option to view dates in the reverse order (DD-MM-YYYY). That would be great for those of us in the EU/UK.
I guess a toggle in the settings to change this could work. Can you please add the idea to the GitHub discussions? That would help me a lot: Discussions Ā· schemar/obsidian-tasks Ā· GitHub
Iām stuck on v1.3.0 and canāt update. Clicking āUpdateā does nothing. Iāve tried to uninstall Tasks, check that its files are deleted from the .obsidian-directory and restarted my computer. Then installed again but v1.3.0 gets installed, not 1.4.1.
Would you know how to troubleshoot this or should I rather check with the Obsidian-devs?