I’m a big fan of the Obsidian-Query-Control.
I use embedded search to collect the assignment and information which are related to different topics and different people generated during a meeting or in a discussion. And then I export the collection as a report which will be submitted or distributed later. The report needs to be in an easy-to-read manner, and for this purpose, a rendered markdown is preferred and the Obsidian-query-control is my choice.
A brief introduction of the Obsidian-Query-Control can be found in the following post.
However, after the Obsidian updated to 1.2.x, the Obsidian-Query-Control stops working. And unfortunately, the author of the plugin has no time(temporally, I hope) to deal with this issue, right now. I think currently there is no alternative for the Obsidian-Query-Control, especially on the aspect of rendering the dynamically generated embeded search result, so, I have to do something, for example, find a workaround, to save my workflow.
My first attempt is rolling back the Obsidian to its previous version. It works. And I was pretty comfortable about this workaround for about 1-2 weeks. However, as the Obsidian updates very frequently, I think I will eventually give up this workaround for some new features or big-bug-fixing that I concerned. So I guess I should do something more to ease the worry and began to read articles and posts about the TS and the Obsidian Plugin Debug. It’s a little bit complex and even magical at beginning, but comparing to developing C++ in the old days, everything is pretty much easier and friendly for the beginner. Let’s skip this part.
After some going back and forth among the lines, I found that the cause of this issue is that the SearchHeaderDOM is no longer available in the Obsidian. So that every line related to this class may cause an error.
I made a simple and straight forward patch which comments the affected code to fix this issue. The fixed main.js can be found here:
As this code actually scales down the original plugin, I’m not sure whether I should send a pull request to the author of the original plugin.
The good news is: now the plugin can work. This is the screenshot of the rendered embedded search result using patched Obsidian-Query-Control.
The bad news is: as you can see in the screenshot, the nice control buttons which was in the Embedded Search are gone. The additional buttons for the native search pane are gone, as well. But I think one can live on these:
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/search, the additional query commands works. And thanks for the robust code provided by the author, most of the query control can be performed by changing the query code itself. The only inconvenience is that the button for copying the embedded 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.
As I am not the expert on developing, I have not found a way to fix the buttons. So if you are experienced and also interest in this plugin, may be you can help to find a way to create a new UI for this plugin include but not limited to:
- a switch on the native search pane to toggle the function of rendering the markdown in the search result
- a UI, such as the menu in the native search pane or the buttons in the backlink pane, can control the embedded search by mouse clicking.