SebastianMC / obsidian-custom-sort

Take full control over the order and sorting of folders and notes in File Explorer in Obsidian
GNU General Public License v3.0
302 stars 23 forks source link

1.6 breaks plugin #145

Closed Wildphinn closed 6 months ago

Wildphinn commented 6 months ago

Apparently some classes were deprecated with the introduction of Obsidian 1.6, breaking the plugin. I dearly hope it’s fixable! best of luck and thank you for your work.

SebastianMC commented 6 months ago

In Obsidian 1.6.0 they deprecated the global field app which was holding the instance of App class. They stated this in the official Release notes. Refactoring to accommodate to this specific change was easy - the handle to App can be easily acquired via other means.

A side note: despite hiding it from the official API, the global handle still exists in underlying implementation of Obsidian. This will help in backward compatibility of some plugins which don't manage to update in time

Unfortunately, the actual reason which breaks the custom-sort plugin is yet another significant refactoring of the internal mechanics of file explorer introduced in Obsidian 1.6.0. A round of reverse engineering revealed some breaking changes in the sorting logic, which prevent the plugin integration point from working correctly. Fixing the custom-sort is feasible, it is about changing the integration point with Obsidian. At the same time it is tricky and requires a fresh head and a significant amount of time. Hopefully I can manage to find such a timeslot until some official 1.6.x Obsidian is released.

Such approach of Obsidian isn't friendly for plugins, especially in the light of the plugin-based ecosystem, which I assumed Obsidian to be.

Wildphinn commented 6 months ago

Totally agreed – I feel your pain. I know you had to adapt to one such breaking change recently in the past, did the work, and now you have to face yet another overhaul, which is decidedly not great.

I cannot help with development as I know nothing about JS, but if you need an Insider license to access beta builds, I'd be happy to donate one as I love your work and rely heavily on it.

SebastianMC commented 6 months ago

Hi @Wildphinn

(re)approached it with fresh head and done! Please update to 2.1.9 and test.

Wildphinn commented 6 months ago

Already updated and tested! Everything seems to be working fine. Thanks for doing it so quickly, you rock!