obsidian-tasks
obsidian-tasks copied to clipboard
Include sub-items when a condition clause is applied
⚠️ Please check that this feature request hasn't been suggested before.
- [X] I searched previous Ideas in Discussions didn't find any similar feature requests.
- [X] I searched previous Issues didn't find any similar feature requests.
🔖 Feature description
Desired behaviour
Given a list of tasks When that list of tasks has child elements/sub-items
- [ ] Item one ⏳ 2023-06-08
- [ ] Sub-item A
- [ ] Sub-item B
- [ ] Item two
And I execute a query
```tasks
scheduled = 2023-06-01
```
Then the rendered result of the query should include the child elements/sub-items of parent tasks that match the query.
- [ ] Item one ⏳ 2023-06-08
- [ ] Sub-item A
- [ ] Sub-item B
i.e.
- [ ] Item one ⏳ 2023-06-08
- [ ] Sub-item A
- [ ] Sub-item B
Present behaviour
When executed, this query only yields
- [ ] Item one ⏳ 2023-06-08
i.e.
- [ ] Item one ⏳ 2023-06-08
✔️ Solution
When executing a where clause, child elements should be included in the results
Child tasks that explicitly break the expression
If sub-items explicitly break the condition e.g. by setting their own contradictory value, they should be excluded
Example
In the below instance I would not expect sub-item B to be rendered
- [ ] Item one ⏳ 2023-06-08
- [ ] Sub-item A
- [ ] Sub-item B⏳ 2023-06-09
- [ ] Item two
Introducing this behind a flag
This could be optionally enabled by through an additional clause e.g.
```tasks
scheduled = 2023-06-01
include sub-items
```
❓ Alternatives
No response
📝 Additional Context
No response
Hi, thanks for using Tasks.
I don't know what you mean by a WHERE clause
in the subject line...
As noted in the docs, the current design and core code of Tasks is to store each task independently, so each task does not know about child and parent tasks, so they cannot be rendered as nested, and there is no information to search.
If you could please clarify what you mean by a WHERE clause, then I will mark this issue as 'needs core redesign', meaning it is worth doing, but not possible unless and until the core storage of Tasks is re-written.
Apologies meant to say 'condition' rather than a where clause 😅 Does that make it clearer?
Apologies meant to say 'condition' rather than a where clause 😅 Does that make it clearer?
Yes it does make it clearer. Thank you for updating the title.
I have an idea where the child elements/sub-items are solely for display purposes, and the rest of the logic remains unchanged. use the 'show sub-items' command to control this.
I have an idea where the child elements/sub-items are solely for display purposes, and the rest of the logic remains unchanged. use the 'show sub-items' command to control this.
Hi @gig168, sorry, I don't know what you mean, and how it relates to this ticket.
There's no plan to implement this feature?
I use this concept a lot in my notes I'd love to see this
There's no plan to implement this feature?
Doing this is a lot of work.
As it happens, yes there is a plan to do something in this area. We have been working towards it for some months.
It is impossible to say how many weeks or months until it is released.
I have an idea where the child elements/sub-items are solely for display purposes, and the rest of the logic remains unchanged. use the 'show sub-items' command to control this.
Hi @gig168, sorry, I don't know what you mean, and how it relates to this ticket.
What I mean is to handle it in a way similar to 'dataview', you can refer to its approach.