joethei / obsidian-link-favicon

See the favicon for a linked website.
GNU General Public License v3.0
91 stars 3 forks source link

Don't reload when links are unaffected #23

Closed NomarCub closed 2 years ago

NomarCub commented 2 years ago

Favicons reload when anything is modified (in addition to when new things coming into view in #22).

reload

Even having heard the implementation reasonings in #22, I'm really skeptical that this is working as intended. Is a really long debouncing interval the best I can do? Couldn't the favicons only respond to their own links being changed, not anything in the document? Or at least the edited/active line/paragraph be checked before the reloading is initiated?

Scrolling unloaded documents already looks wonky in Obsidian so I guess #22 is as good as it will get, but I can't see why this one has to happen. What restrictions exactly do CodeMirror decorations have?

joethei commented 2 years ago

I only get the currently visible content, I don't know where there cursor currently is. The content I get is also in a raw format, without any information if there is an icon already present.

There is some caching already present, but I had changed that a bit to solve #21. Seems like I can either solve this or #21. Will investigate more.

NomarCub commented 2 years ago

It's not a happy compromise, but I guess I'll just switch back to 1.6.3 in the meantime. This problem doesn't exist there at all, and #22 is also noticeably faster there too, I guess due to no file caching. I'd take manual refreshing over this, really don't like distractions.

What changes in 1.7.0 necessitated the constant refreshing? Could that part be optionally turned off?

joethei commented 2 years ago

The refreshing is a side-effect of fixing #21, which seems to be a rare edge case.