franciskafieh / obsidian-list-modified

🪨 The advanced and adaptive changelog for Obsidian. Links all modified files meeting certain criteria to a timed (daily, weekly, monthly) note.
MIT License
85 stars 7 forks source link

[BUG] File names don't change properly #53

Closed ghost closed 1 year ago

ghost commented 1 year ago

First Steps

Describe the bug

I installed 2.0.1 version and had "- [[name]]" as output format. If I rename note and do not change note's text AFTER renaming, I have old note's name on list modified files

Expected behaviour

On list modified files note`s name should changes after renaming

Reproducing

My setup

franciskafieh commented 1 year ago

Unfortunately, this is intentional. There is no good way to get around this. The code listens to the vault rename event and updates the tracked list to have the correct name, but it does not write it to the daily note. This is because of Obsidian's default behaviour that automatically re-names links. If I save the file write to the list while Obsidian is re-naming the link, it causes a mess of brackets.

I could possibly check if the template contains [[link]], and if not, write the contents to the file. This would fix your problem using the [[name]] template. I can't think of a good way to fix the same problem for link templates. Otherwise, you can save absolutely any file (not only the one you re-named) and it will trigger a re-write of the daily notes file. Let me know what you think of this solution, or if saving any file is good enough for you (ctrl/cmd + s)

Relevant code snippet: https://github.com/franciskafieh/obsidian-list-modified/blob/b7d8481dc581c97833c6687af8363f732c8af525/src/main.ts#L116

ghost commented 1 year ago

Yes, checking for [[name]] looking good. Saving doesn't work correctly on phone, I suppose,

franciskafieh commented 1 year ago

Ah, right... Gonna need to look into saving on phone ---- On Sat, 10 Sep 2022 06:30:31 -0400 @.*** wrote ---- Yes, checking for [[name]] looking good. Saving doesn't work correctly on phone, I suppose,

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

franciskafieh commented 1 year ago

Going to be added before the official 2.0 release. I've made the change locally.

franciskafieh commented 1 year ago

@TaardeT added in release 2.0.2