obsidian-tasks: Show Tree Fails to Paint/Show Children Tasks When Fourth Header is Folded
⚠️ Check issue is valid.
- My request is about the Tasks plugin for Obsidian.
⚠️ Check that this issue hasn’t been reported before.
- I searched previous Tasks plugin Bug Reports didn’t find any similar reports.
Steps to reproduce
This is hard to describe and I’m not sure I have the issue fully isolated. When using four "Header 1"s each with their own query if the Fourth Header is folded when swapping from Source mode to Reading view, it can cause “show tree” to not show the children tasks for one of the tasks in the First Header’s query.
- Create “TaskFile” From The Below Data (or use the Attached File)
- [ ] Task A
- [ ] Task A 01
- [x] Task B ✅ 2025-03-14
- [ ] Task B 01
- [x] Task B 02 ✅ 2025-03-14
- [ ] Task C
- [ ] Task C 01
- [x] Task C 02 ✅ 2025-03-14
- [ ] Task C 03
- [ ] Task D
- [ ] Task D 01
- [ ] Task D 02
- [ ] Task D 03
- [x] Task D 04 ✅ 2025-03-14
- [ ] Task E
- [ ] Task E 01
- [x] Task E 01 A ✅ 2025-03-14
- [x] Task E 01 B ✅ 2025-03-14
- [ ] Task E 02
- [x] Task E 02 A ✅ 2025-03-14
- [x] Task E 02 B ✅ 2025-03-14
- [ ] Task F
- [ ] Task F 01
- [ ] Task F 01 A
- [x] Task F 01 B ✅ 2025-03-14
- [ ] Task E 02
- [ ] Task F 02 A
- [ ] Task F 02 B
- [ ] Task G
- [ ] Task G 01
- [ ] Task G 01 A
- [ ] Task G 01 B
- [ ] Task G 02
- [ ] Task G 03
- [ ] Task G 04
- [ ] Task G 05
- [x] Task G 06 ✅ 2025-03-14
- [x] Task G 07 ✅ 2025-03-14
- [x] Task G08 ✅ 2025-03-14
- [ ] Task H
- [x] Task H 01 ✅ 2025-03-14
- [x] Task H 02 ✅ 2025-03-14
- [x] Task H 03 ✅ 2025-03-14
- [x] Task H 04 ✅ 2025-03-14
- Create “QueryFile” From The Below Data (Or Use the Attached File)
# First Header
``` tasks
(filename includes TaskFile)
hide task count
hide backlink
show tree
sort by function task.lineNumber
```
# Second Header
``` tasks
(filename includes TaskFile)
hide task count
hide backlink
show tree
sort by description
```
# Third Header
``` tasks
(filename includes TaskFile)
hide task count
hide backlink
show tree
sort by priority
```
# Fourth Header
``` tasks
(filename includes TaskFile)
hide task count
hide backlink
show tree
```
- View the Query File With All Headers Unfolded in Read Mode
- Swap to Source Mode then swap back to Reading Mode (Don’t use Split screens)(This Step may not be needed)
- Swap to Source Mode
- Fold the “Fourth Header”
- Swap to Reading Mode
The First Header’s query should have a task that does not show its children. If you click on the task to mark it complete, the children will abruptly show. In my case, First Header’s Task G no longer shows its children (see 4th image below)
Expected Behavior
All tasks in the First Header’s query should show their full tree regardless of the Fourth Headers folded status.
Current behaviour
Task G, under the First Header when the Fourth Header if folded, no longer shows Task G’s children tasks (Task G 01, Task G 02, Etc.). This seems to only occur when swapping from Source Mode to View Mode. Also, the bug doesn’t seem to appear when editing and viewing in different windows.
Which Operating Systems are you using?
- Android
- iPhone/iPad
- Linux
- macOS
- Windows
Obsidian Version
Version 1.8.9 (Installer 1.8.7)
Tasks Plugin Version
7.17.0
Checks
- I have tried it with all other plugins disabled and the error still occurs
Possible solution
I have no idea how to fix this bug. Isolating it to a repeatable scenario took me several hours.
Tasks is the only plugin I have installed and the problem persisted using the default theme. This bug is subtle, but it caused me to lose faith that my tasks were showing.
Sometimes changing the query order fixed it until I closed/opened Obsidian then swapped between Source Mode back to View mode. Sometimes putting a comment in the First Header’s query between “Show Tree” and “Sort by Function task.lineNumber” fixed it until I restarted Obsidian and swapped between edit/view modes.
Also, editing and viewing the query in split screen didn’t trigger the issue until the split screen was closed (forcing a save of the underlying query file?).
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15
I can reproduce it.
Many thanks.
I’ve tweaked the original report to use numbered lists and fenced code blocks, so the text can be copied via GitHub’s
Copyicon…I will try to reproduce it, hopefully later today.
Reading mode.
Knowing the prefered terms, I would say the issue happens when swapping from “Source” to “Reading” mode.
I edited the original bug report to reflect the terminology better.