kelszo / obsidian-file-explorer-plus

A plugin for https://obsidian.md, which enables the ability to hide and pin specific files and folders in the file explorer by applying custom filters.
GNU Affero General Public License v3.0
60 stars 3 forks source link

Make.md breaks plugin #5

Open ashworksco opened 11 months ago

ashworksco commented 11 months ago

What happened?

Files do not get pinned or hidden, but the plugin thinks they have.

What did you expect to happen?

I expect files to either be pinned or hidden based on right clicking and selecting from the pop-up menu.

Can you reproduce the bug, if so how? As detailed but minimal as possible.

Yes, and I have done so several times now with installing/uninstalling.

Other?

No response

Plugin version

1.1.3

Obsidian version

1.5.3

OS

macOS

kelszo commented 11 months ago

Can you provide some more details? Currently working as expected on both my devices, cannot replicate

kelszo commented 11 months ago

According to the latest Changelog for Obsidian:

File Explorer and Tags pane both received a small code refactor. This might affect some plugins that rely on the internal JS structure. Themes should not be affected.

However, I am currently also running Obsidian v1.5.3 and it works. Do you have any other plugins that affect the File Explorer? Has the plugin worked before?

zenus260 commented 11 months ago

Can you provide some more details? Currently working as expected on both my devices, cannot replicate

I have the same issue and I'm on v1.5.3 too. I tested it on a new vault and it worked fine so it most likely is caused by a conflicting plugin. The only plugin I have that affects the File Explorer is make.md.

What ashworksco is probably referring to by the plugin thinking that files are hidden or pinned is that if you pin a note using the right click menu and then open that menu again, the option is now to unpin the note, however the note has not been pinned.

kelszo commented 11 months ago

Thank you for the vital information @zenus260!

I tested installing make.md and I found that File Explorer++ stopped working on reload. If @ashworksco can confirm they are also running make.md I think we can confirm the cause.

Make.md seems to be a really cool plugin, wouldn't mind testing myself. However, looking through their code they have some aggressive code practice. Seems like the cause is that they override the base Obsidian function getLeavesOfType so when trying to fetch the File Explorer leaf it returns their leaf instead. See: patches.ts in the make.md code.

TLDR: To be honest, nothing we can do on our side. They make it impossible to fetch the file-explorer leaf and thus break our integration. The make.md team should consider a less invasive approach to their patching method for interoperability with other plugins.

UPDATE: Actually found a fix, make.md has a Compatibility Mode in it's settings. Activating that seems to make File Explorer++ work as expected.