ozntel / file-explorer-note-count

Obsidian Plugin for viewing the number of elements under each folder within the file explorer
101 stars 18 forks source link

Improve compatibility with novel-word-count-obsidian or other file explorer plugins #13

Open leoccyao opened 1 year ago

leoccyao commented 1 year ago

First there was this plugin, and I used it, and I was very happy with the extra information I was able to get in my file explorer. However, over time, more plugins that aim to provide a better file explorer started appearing, such as the Novel Word Count Plugin. However, when I enabled that plugin, all my folder note counts disappeared! Disabling and re-enabling each, it seemed that whichever one was enabled later would hide the counts of the previous. Digging into implementation a bit, I find that both plugins try to bind to .nav-files-container .nav-folder-title::after, while only one ::after can be defined on a single <div>.

The most general way I can see to mitigate the issue of file explorer plugins conflicting, without specifically referencing other plugins, is to add a setting for choosing which div to add the pseudo-element to (for now, either item.titleEl or item.titleInnerEl). This could be labeled as an advanced setting for troubleshooting interactions with other plugins; it would also allow this plugin to stay compatible with future file explorer plugins that may try to also add pseudo-elements to various divs.

I've opened a similar issue on the other plugin: https://github.com/isaaclyman/novel-word-count-obsidian/issues/14, though it would be best if all file explorer plugins were able to support other ones as well.

Windows 10, Obsidian v1.0.0, File Explorer Note Count v1.2.0.

isaaclyman commented 1 year ago

@ozntel The latest version of my plugin Novel Word Count includes Note Count as an option. It looks like your plugin hasn't updated in a year or so—as an open source maintainer myself I totally understand, no judgment here, but if you feel so inclined you're more than welcome to point people to my plugin as an alternative.