-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Label with Templater function will blink #198
Comments
@Moyf Thanks for reporting the bug! Let's dig into that first:
|
@Moyf Regarding your suggestion, supporting a mix of fixed strings and variable expressions is a nice idea -- I'll add it to the roadmap. As it stands, the entire label/tooltip/URI is evaluated as an expression/command, so any text to output must be part of the expression/command (as you noted). I've added a note to the docs about this. |
This issue has been noted in this discussion as well, per @amsam0
|
Sorry I just came back from a vocation, here is an example of the blinking NTB toolbar.
But actually it's: |
Actually, I just tried different position settings and it would all blinks. (Below Properties/ Top Fixed) I can also share it as a url so that it's easier to import with the original content: |
@Moyf I've released a fix that should improve the blinking, by not showing the expression first before replacing it. I'm leaving this issue open as I think it can still be improved, by delaying rendering of the toolbar until all expressions can be resolved. But hopefully this should help for now. |
I just updated, and it did improve the experience much, thank you! : ) |
@Moyf Hmm, can you share the toolbar you're experiencing this with? Do you mean you're seeing blinking when expressions are being replaced? Or when switching between notes? Or something else? |
No problem, I can provide the toolbar and the recording: bandicam.2024-12-16.21-37-45-983.mp4I'm not sure if it's related but I'd like to share as much info as possible: And I put the note in my left sidebar. |
I encountered another issue that I believe may be related to the loading of the toolbar. Here’s the scenario: However, the Note Toolbar currently displays the message: bandicam.2024-12-17.20-49-35-647.mp4 |
@Moyf Are you able to provide the template you use to do this (even just the part that renames the file)? And how exactly is that script/template triggered? I tried assigning a hotkey to a template that renames a note, but wasn't able to recreate the issue. |
Obsidian Sandbox - TP and NTB.zip Need more digging 🤔 I suspect it might be because my vault is too large (and with many plugins), and going through the processes of "creating a new tab, applying a template, renaming a file" takes several hundred milliseconds. During this time, NTB tries to add the toolbar or parse the template, but it is still processing the old note path from before the renaming, and the path is lost after the renaming. I added a break point and found out that:
|
@Moyf I'm not sure what's causing this but I've added back in toolbar removal in 1.16-beta-02. Let me know how it goes and I may have to undo some other changes if you're still experiencing the intensified blinking. |
Update: I also found a case I missed when the metadata cache changes, so that may help as well. |
@Moyf When you have some time, would you be able to test the latest beta in your vault, and let me know how it performs? I'd like to make sure there hasn't been a step back with respect to the flickering, before I release this version. Thanks! |
Of course! Just tested with v1.16-beta-8 and... now the whole Toolbar would blink 😂 bandicam.2024-12-24.10-53-25-103.mp4 |
|
@Moyf Thanks, I'll see what I can recreate on my end. The fade-in transition is interesting. I'll have to think where that might be useful. |
Description of the bug
When clicking in a note with toolbar with TP in the label, the text will blink.
Steps to reproduce
Set the Note Toolbar for a note (by frontmatter)
Use templater as the label:
Click in other note, then click back note with NTB, the label will quickly flash from "<%xxx%>" to the result
Expected behavior
I hope it will not blink
Screenshots (if you think it will help)
In sandbox vault, the blinking will be much quicker, I guess it's related to Obsidian's performance:
https://github.com/user-attachments/assets/4d4b6d42-db3d-4688-bddb-0825ac91bb02
Desktop environment:
Additional context
I used to post a PR as "Global NTB Button", and I'm trying to use a Note in sidebar to do the similar work 😄
In that case, no matter what note I'm writing, I can always quickly interact with this "Toolbar Page" NTB 👍🏻
BTW, would it be possible to use mixed markdown text and templater?
for example,
[[<%tp.date.now("YYYY.MM.DD")%>]]
and render it as a link?For now it seems I need to put all the text inside the
<% %>
, otherwise, the render will fail:The text was updated successfully, but these errors were encountered: