obsidian-tasks icon indicating copy to clipboard operation
obsidian-tasks copied to clipboard

Include sub-items when a condition clause is applied

Open ReidWeb opened this issue 1 year ago • 9 comments

⚠️ 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

ReidWeb avatar Jun 01 '23 13:06 ReidWeb

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.

claremacrae avatar Jun 01 '23 13:06 claremacrae

Apologies meant to say 'condition' rather than a where clause 😅 Does that make it clearer?

ReidWeb avatar Jun 01 '23 13:06 ReidWeb

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.

claremacrae avatar Jun 17 '23 14:06 claremacrae

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.

gig168 avatar Jan 12 '24 04:01 gig168

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.

claremacrae avatar Feb 05 '24 18:02 claremacrae

There's no plan to implement this feature?

I use this concept a lot in my notes I'd love to see this

Ethanol48 avatar Aug 18 '24 00:08 Ethanol48

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.

claremacrae avatar Aug 18 '24 03:08 claremacrae

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.

gig168 avatar Aug 18 '24 05:08 gig168