nothingislost / obsidian-query-control

An experimental Obsidian plugin that adds controls to embedded queries
MIT License
278 stars 16 forks source link

Obsidian 1.2.0 (insider) breaks Query Control #28

Closed trainbuffer closed 11 months ago

trainbuffer commented 1 year ago

Obsidian 1.2.0 (insider) seems to have broken Query Control in the Search tab and embedded search queries. The Backlinks tab and Backlinks in document seem fine, markdown rendering works fine, etc. As functionality in Backlinks is working, I'm hoping it's just a display issue because of changes to Search. 🤞🏽

Thanks!

macOS v13.2.1, Obsidian v1.2.0 (1.1.16), Query Control v0.5.0

dcoales commented 1 year ago

Same on windows 10, Obsidian 1.2.1 Query Control 0.5.0

autonomygaps commented 1 year ago

I have this as well, and we're not alone:
https://forum.obsidian.md/t/search-interface-in-v1-2/57197/5

kmaustral commented 1 year ago

I'm now on Obsidian 1.2.5, Windows 11, Query Control 0.5.0 I miss controls on query control.

zhao414 commented 1 year ago

After some debug, I found that the reason of this issue is that the SearchHeaderDOM is no longer available in the Obsidian. I made a simple patch which comments the affected code to fix this issue. The fixed main.js can be found here: https://github.com/zhao414/obsidian-query-control/releases/tag/0.5_fix_fix_for_Obsidian_1.2.5

The good news is: now the plugin can work. The bad news is: the nice UI which is used for Native Search pane and Embedded Query are gone. But I think this is not unacceptable:

For the Native Search, the sorting and folding search results are already supported by the native search, one can use the native search parameters control menu to perform these actions. The rendering of the markdown in native search result works. The only inconvenience is that it is now controlled by default behavior of the plugin which is configured in the plugin setting pane, and a reload of Obsidian is needed if one wants the new settings to work.

For the embedded query, the additional query commands works. And thanks for this, most of the query control can be performed by changing the query code itself. The only inconvenience is that the button for copying the search results directly from the embedded query is no-longer available. But I think there is always a workaround such as using the native search panel as an alternative.

zhao414 commented 1 year ago

After some debug, I found that the reason of this issue is that the SearchHeaderDOM is no longer available in the Obsidian. I made a simple patch which comments the affected code to fix this issue. The fixed main.js can be found here: https://github.com/zhao414/obsidian-query-control/releases/tag/0.5_fix_fix_for_Obsidian_1.2.5

The good news is: now the plugin can work. The bad news is: the nice UI which is used for Native Search pane and Embedded Query are gone. But I think this is not unacceptable:

For the Native Search, the sorting and folding search results are already supported by the native search, one can use the native search parameters control menu to perform these actions. The rendering of the markdown in native search result works. The only inconvenience is that it is now controlled by default behavior of the plugin which is configured in the plugin setting pane, and a reload of Obsidian is needed if one wants the new settings to work.

For the embedded query, the additional query commands works. And thanks for this, most of the query control can be performed by changing the query code itself. The only inconvenience is that the button for copying the search results directly from the embedded query is no-longer available. But I think there is always a workaround such as using the native search panel as an alternative.

I am not an expert on developing, so currently, I haven't found a way to "build" a new control pane which works as the original one. Maybe some experts can continue this work, and, perhaps, to bring a new one which works as the new native search pane in Obsidian 1.2.x.

calmwaves111 commented 1 year ago

After some debug, I found that the reason of this issue is that the SearchHeaderDOM is no longer available in the Obsidian. I made a simple patch which comments the affected code to fix this issue. The fixed main.js can be found here: https://github.com/zhao414/obsidian-query-control/releases/tag/0.5_fix_fix_for_Obsidian_1.2.5

The good news is: now the plugin can work. The bad news is: the nice UI which is used for Native Search pane and Embedded Query are gone. But I think this is not unacceptable:

For the Native Search, the sorting and folding search results are already supported by the native search, one can use the native search parameters control menu to perform these actions. The rendering of the markdown in native search result works. The only inconvenience is that it is now controlled by default behavior of the plugin which is configured in the plugin setting pane, and a reload of Obsidian is needed if one wants the new settings to work.

For the embedded query, the additional query commands works. And thanks for this, most of the query control can be performed by changing the query code itself. The only inconvenience is that the button for copying the search results directly from the embedded query is no-longer available. But I think there is always a workaround such as using the native search panel as an alternative.

Thank you for your contribution. It is now barely usable, although it is still not easy to use compared to before

simonfossom commented 1 year ago

This is breaking my flow so much I had to roll back a version.

@nothingislost we would greatly appreciate update 🙏

filmgal commented 1 year ago

@nothingislost I do hope you use this plugin and miss it as much as I do. Wherever I can I use a query rather than dataview and boy am I missing this plug-in!

mardukbp commented 1 year ago

@zhao414 Thank you so much for your fix! Why don't you include all the files in the release, so that your plugin can be installed with BRAT? It's easier for everybody and cleaner than monkey patching the broken plugin.

nothingislost commented 11 months ago

Thanks @zhao414! I pushed https://github.com/nothingislost/obsidian-query-control/releases/tag/0.5.1 with your fix.

I'll take a look at restoring the lost features but the functionality provided by this plugin requires a lot of reverse engineering and patching of the internal Obsidian code so no guarantees around how fast that will happen.

nothingislost commented 11 months ago

0.5.2 should add the header controls back to embedded queries. working on adding controls back to the native search sidebar.

zhao414 commented 11 months ago

@nothingislost: the 0.6.0 is great! Thank you!