obsidian-tasks
obsidian-tasks copied to clipboard
Temporarily stop updating queries editing/adding a task [until a fixed period after user stops typing]
⚠️ 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
When a note contains a query, if you start adding a new task or edit a task in the same note, it causes the page to refresh every 2 seconds, which I believe is done by the plugin to keep queries up to date. But, this makes an unpleasant and frustrating experience seeing the page content refreshed frequently.
✔️ Solution
I think one of the possible solutions could be to stop refreshing the queries for some period of time if a new task is being added or an existing one is being edited. The condition could be: if the user has stopped typing for 10 seconds, it can be safely assumed that they're done with the new entry, so the plugin can now refresh the queries on that page.
❓ Alternatives
The alternative is to switch to edit mode, which works fine, but I wish the Live view also worked just fine (without the "extra" refreshes). Would greatly appreciate it if you could implement this (or something to this effect)
📝 Additional Context
No response
What platform are you on?
There is a way to do this already.
Edit the query with a line like this:
# limit 1
Or even:
# limit 0
Then, if you want to speed up redraws, un-comment that line (remove the #
) temporarily.
Thank you for a very helpful suggestion. Above is a suggested workaround, in the meantime.
What platform are you on?
Linux
Hi @ma-sadeghi
Linux
Great, then if you want to track down the source of the performance problems, I suggest opening Obsidian's Developer Tools, viewing the console, and looking at the output generated when you edit a task.
You will see which files are getting updated, and how many tasks are being displayed in query blocks in which file.
If in Live Preview, there is what I believe to be an Obsidian bug which is that previously-viewed files remain 'open' in the Tab's history and these can accumulate over time.
If it happens, the workaround is to close the current file in a tab, and the retained files will then be closed.
There is a way to do this already.
Edit the query with a line like this:
# limit 1
Or even:
# limit 0
Then, if you want to speed up redraws, un-comment that line (remove the
#
) temporarily.
Thanks, but this only leaves one entry. I do want to see all the other entries. I find the other workaround, i.e., switching between edit/live mode more handy, especially that there's already a shortkey for it (ctrl+L), and it doesn't require modifying the queries. But, thanks anyway.
Hi @ma-sadeghi
Linux
Great, then if you want to track down the source of the performance problems, I suggest opening Obsidian's Developer Tools, viewing the console, and looking at the output generated when you edit a task.
You will see which files are getting updated, and how many tasks are being displayed in query blocks in which file.
If in Live Preview, there is what I believe to be an Obsidian bug which is that previously-viewed files remain 'open' in the Tab's history and these can accumulate over time.
If it happens, the workaround is to close the current file in a tab, and the retained files will then be closed.
Thanks for the suggestion, here's the output:
[Violation] Forced reflow while executing JavaScript took 38ms
plugin:obsidian-tasks-plugin:133 At least one task, its line number or its heading has changed in Journal/2022/11 November/2022-11-28.md: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.
20plugin:obsidian-tasks-plugin:162 Render tasks called for a block in active file "Journal/2022/11 November/2022-11-28.md", to select from 373 tasks: plugin state: Warm
5plugin:obsidian-tasks-plugin:162 4 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 5 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 9 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 33 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
plugin:obsidian-tasks-plugin:133 At least one task, its line number or its heading has changed in Journal/2022/11 November/2022-11-28.md: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.
20plugin:obsidian-tasks-plugin:162 Render tasks called for a block in active file "Journal/2022/11 November/2022-11-28.md", to select from 373 tasks: plugin state: Warm
5plugin:obsidian-tasks-plugin:162 4 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 5 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 9 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 33 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
plugin:obsidian-tasks-plugin:133 At least one task, its line number or its heading has changed in Journal/2022/11 November/2022-11-28.md: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.
20plugin:obsidian-tasks-plugin:162 Render tasks called for a block in active file "Journal/2022/11 November/2022-11-28.md", to select from 373 tasks: plugin state: Warm
5plugin:obsidian-tasks-plugin:162 4 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 5 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 9 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 33 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
plugin:obsidian-tasks-plugin:133 At least one task, its line number or its heading has changed in Journal/2022/11 November/2022-11-28.md: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.
20plugin:obsidian-tasks-plugin:162 Render tasks called for a block in active file "Journal/2022/11 November/2022-11-28.md", to select from 373 tasks: plugin state: Warm
5plugin:obsidian-tasks-plugin:162 4 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 5 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 9 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 33 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
plugin:obsidian-tasks-plugin:133 At least one task, its line number or its heading has changed in Journal/2022/11 November/2022-11-28.md: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.
20plugin:obsidian-tasks-plugin:162 Render tasks called for a block in active file "Journal/2022/11 November/2022-11-28.md", to select from 373 tasks: plugin state: Warm
5plugin:obsidian-tasks-plugin:162 4 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 5 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
5plugin:obsidian-tasks-plugin:162 9 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
plugin:obsidian-git:7420 simple-git [GitExecutor] [SPAWN] git (7) ['-c', 'core.quotepath=off', 'status', '--porcelain', '-b', '-u', '--null'] +0ms
plugin:obsidian-git:7420 simple-git [GitExecutor] [HANDLE] retrieving task output complete +32ms
plugin:obsidian-git:7420 simple-git [GitExecutor] [SPAWN] git (5) ['-c', 'core.quotepath=off', 'branch', '-v', '--no-color'] +0ms
plugin:obsidian-git:7420 simple-git [GitExecutor] [HANDLE] retrieving task output complete +23ms
5plugin:obsidian-tasks-plugin:162 33 of 373 tasks displayed in a block in "Journal/2022/11 November/2022-11-28.md"
Thank you. That's not what I expected at all. It's not picking up any other tasks blocks in other files to redraw.
That looks like a reasonable about of redraws and I would have predicted that Tasks and Obsidian could have coped with this. It obviously isn't, but that leaves me stumped for suggestions right now.
How are your tasks blocks created? Are they vanilla tasks blocks, or are they generated by dataviewjs?
They are generated by dataviewjs
. I don't mind sharing them, so there you go (these are the exact same blocks in the note whose debug information I shared with you earlier):
Later
not done
(path does not include 2022-11-28) AND (tag includes later)
hide backlink
hide edit button
Leftover
not done
(((path includes Journal) AND (path does not include 2022-11-28)) OR (tag includes todo)) AND (tag does not include later) AND (tag does not include errand)
hide backlink
hide edit button
Done today
done 2022-11-28
hide backlink
hide edit button
hide done date
Errands
not done
(tag includes errand) AND (path does not include 2022-11-28)
hide backlink
hide edit button
hide done date
Try setting the Dataview setting Refresh Interval. Mine is on 5 seconds.
Try setting the Dataview setting Refresh Interval. Mine is on 5 seconds.
I just noticed that I don't even have dataview
installed!
They are generated by dataviewjs
I just noticed that I don't even have
dataview
installed!
I am confused! What am I misunderstanding?
Sorry for the confusion, I wasn't aware of the jargon! I wasn't sure if my queries count as dataviewjs
. Anyway, I don't have the "dataviewjs" plugin installed, I'm just using the "tasks" plugin typical queries.
Sorry to bug you again, @claremacrae can we proceed with the triage? I'd be happy to help if you further need information on my side.
Sorry, I am working hard on other areas of Tasks at the moment and supporting others who are contributing to this plugin.
I just don’t have the time and capacity to take on anything more.
Once the next release is out, @ilandikov and I intend to prioritise what we will work on next.
If it includes improving performance, then I already know of some first steps to take.
And then, if you still have a problem after we have released some performance improvements, then we can examine specifically what is going on in your setup.
Awesome, I don't have any particular issue at the moment, I just saw this open thread and thought I could chip in, only if it's providing you guys with some extra input to debug. So it's all good :) And thanks for working on this!
I think there might be another related issue: When multiple tabs are open (some with and some without task queries), Tasks plugin seems to be running in the background even when the active tab doesn't contain any task queries. This makes Obsidian choppy, which is noticeable when typing. I can open up a new issue if you'd like.
Hi @ma-sadeghi,
I think there might be another related issue: When multiple tabs are open (some with and some without task queries), Tasks plugin seems to be running in the background even when the active tab doesn't contain any task queries. This makes Obsidian choppy, which is noticeable when typing. I can open up a new issue if you'd like.
Thanks for the comment.
Looking at the issues labelled with scope: performance issues, I don't think that this suggestion has been recorded before.
So yes please, a new issue would be very welcome. Thank you.