Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataview view containers change size on auto-reload #2482

Open
fcskit opened this issue Nov 19, 2024 · 3 comments
Open

Dataview view containers change size on auto-reload #2482

fcskit opened this issue Nov 19, 2024 · 3 comments
Labels
bug Something isn't working.

Comments

@fcskit
Copy link

fcskit commented Nov 19, 2024

What happened?

I use custom dataview view containers a lot in my notes to create renderings of my notes metadata. I like to have the auto-reload option activated so that changes of the metadata will be updated in the view. However, there is a catch. Dataview's auto-reload option updates the views in a fixed time interval even if the metadata has not changed. Performance wise this is not a big issue but the view containers change size while the content is updated. This causes the view of the current note to jump around, which is annoying when you edit the note.

Suggested fix
Do not updated the dataview view containers on every reload but only if the metadata of the file has been changed. I don't know if this is somehow directly supported by the obsidian api, but if not, although a little dirty, a deep comparison of the old and new metadata should probably do the trick.

DQL

No response

JS

No response

Dataview Version

0.5.67

Obsidian Version

1.7.6

OS

MacOS

@fcskit fcskit added the bug Something isn't working. label Nov 19, 2024
@holroy
Copy link
Contributor

holroy commented Dec 28, 2024

I'm not sure if this qualifies as a bug per se, but I can see the annoyance. In recent version of Dataview you could consider another option, and that is to increase the time before a query is refreshed, and then if needed rather trigger the command Dataview: Rebuild current view to do the refresh. You could even assign that command to a hotkey, and extend the refresh period even more.

@fcskit
Copy link
Author

fcskit commented Jan 21, 2025

Thanks, for your answer. Is there a way to call Dataview: Rebuild current view through the dataview api? That would allow me to disable the refresh globally and set refresh intervals independently for each dataviewjs or dataview view container, if needed.

@holroy
Copy link
Contributor

holroy commented Jan 23, 2025

It's a command so you could trigger that command any way you like. Preferably though from something connected to the active view, as it'll most likely fail in other cases. You could use a button in the current document to trigger the command, but I mostly use hotkey.

If you like Commander, you could also set up a ribbon icon to trigger the command, so there are many options. I'm not sure if I would link it to the document directly, as that might trigger a multitude of potential refreshes all over your vault, which again might lead to some instability issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants