Link Lens - relationships between links at block level (help needed with refactoring!)

I created a plugin which is heavily inspired by the backlinks filtering of Roam Research (I wrote my master’s thesis thanks to that fucntion). I strongly needed it since 2023 and I explained the reasons in this post and this post.

It suits my workflow where I “tag” the paragraphs or bullet points of my notes with links that refer to specific concepts. With this plugin I am able to find every block that contains specific links, hence every block that refers to specific concepts. The best part is that the plugin tells you which other links are contained in the blocks that you found, so that you can start your search without knowing what you are looking for. You just need to want to see which concepts are related to a specific one.

I hope that this can fits other workflows, too.

I didn’t upload it to the community plugins becase I have no idea how to code. This entire plugin has been vibe coded with AI (check the README). I would like a lot to publish it but it needs some serious refactoring and I’m not able to implement the Plugin guidelines. If someone of you wants to adopt this little monster of a code and make it shine (maybe because you actually need it) please do it! You can contact me on Telegram at @mortacci

Here are some improvements that can be made (you find it in the README, too):

  • CSS code is a complete mess with plenty of repeated classes and it is inside main.ts. The external css file is not used (I think).
  • Custom sorting of results preview (by name, date of creation, date of last edit, ecc.).
  • Add the possibility that, if searching for a term that doesn’t exist as link, this search is performed as a simple regex search, looking for items that contains an exact match to that term.
  • Add the possibility to search for tags. I don’t use tags so much in my note-taking workflow, so I didn’t implement this in this initial version.
  • Add a command to open the search panel with the current note already selected as search term (and start the research).
  • Add the possibility to customize the research by adding the search terms with AND, OR or NOT operators, and the UI should be re-made accordingly (the container of the search terms tagsContainer should be divided in three sections, one for each operator). It can work like this:
    • if you click a Related link it is added with AND operator
    • if you Shift-click a Related link it is added with OR operator
    • if you Alt-click a Related link it is added with NOT operator

Plugin link: GitHub - Taccimor/linklens: A plugin for Obsidian to find relationships between links and/or properties at block level.

I just uploaded a new release adding most of the features I suggested (including refactoring). I don’t think I will modify the code further.

I wrote some known issues, whoever would like to help is welcome!