SkepticMystic/breadcrumbs

Bug: "Type mismatch, expected text" in properties field

andresgongora opened this issue ยท 17 comments

Describe the bug
Breadcrumbs writes the properties as down: ['My File'] instead of down: "[[My File]]", causing Obsidian to create a small warning with the message Type mismatch, expected text. The name of the referred file in the property does not appear as a link either, but breadcrumbs seems to work otherwise as expected and can be navigated in the matrix view.

To Reproduce
In a new Obsidian vault, with only breadcrumbs installed, and a default configuration where we enable writing all relationships to the files.

Given two files My Parent File and My Child file, if I set the relationship of both files by writing only to the child the following:

---
up: "[[My Parent File]]"
---

and then ask breadcrumbs to regenerate the indices and write to all files, the content of the parent file is written as:

---
up: ['My Child File']
---

Expected behavior
Links are written to the property field in the "[[Name of file]]" format instead, such that obsidian recognizes it as a working link. In the above example, I would have expected up: "[[My Child File]]" instead of up: ['My Child File'].

Screenshots
image

Desktop (please complete the following information):

  • OS: Manjaro (Linux)
  • Obsidian 1.5.3
  • Breadcrumbs 3.6.11

Additional context
After some more experimenting, if the files are located in folders and subfolders, writing the hierarchy can become quite mangled. I believe this can be because BC likely checks if the files are already written in the hierarchy, but because the strings "[[File]]" and ['File'] are not the same, it writes it twice. However, this bug might be unrelated and warrant its own issue ticket.
image
This is from another vault. The blue links I added manually and are of the type "[[File]]" , the white links are the ones added by BC and are of the type ['File']

On the other hand, I'm completely new to Obsidian. I've searched thoroughly for this bug, but maybe I don't know the correct keywords to identify it and google yields no useful results.

Hey, thanks for the detailed issue!
I'm rewriting the plugin from scratch, please see the V4.md file in the root of the repo for more info.
A couple of the issues you mentioned here are resolved in the new version

Ohh that's so good to hear. I'm looking forward to the new release :)
Should I close this issue to keep your tray clean?

Of course feel free to test the beta version using BRAT, and let me know your thoughts :)
Keep it open for now. I'll go through and close out any resolved issues once v4 is live.

I'm playing around with v4 and it seems to do exactly what I expected from it. I haven't had time to go in-depth but it looks promising.

I'm migrating an extremely large wiki (believe me, it's VERY big, at least in terms of file count) from TiddlyWiki into Obsidian. I'll give feedback if I experience any slow-downs or related performance issues. So far so good! :)

That's great to hear!
The code should be alot more performant now as well. I don't know how many notes you've got, but it should handle them better

I can confirm that with 1100 .MDs its working nicely :D It never takes more than 10-30 ms to regenerate the breadcrumbs (on a 11th gen i7 laptop).

Sorry that I hijack this thread. Can you confirm that Folders can be used as the source of edges? I can't find where to enable this option but it shows as done in v4.md. If it should indeed be enabled, I'll open a new ticket with a full report :)

That's great to hear :)

Folders can be used, yes. Please refer to the v3 docs here: https://breadcrumbs-wiki.onrender.com/docs/Alternative%20Hierarchies/Folder%20Notes

They work mostly the same in v4, except:

  • The field used to specify the BC-field to use is now BC-folder-note-field
  • You can add the BC-folder-note-recurse field to your note (with any truthy value), and that will tell breadcrumbs to recurse subfolders as well. The limitation here being that the subfolder notes will point to the original, top-level folder note in the relation (because it's ambigous where else to point to).

Let me know if that makes sense!

Great! I can confirm it works! :D
I haven't found a way to refresh + freeze all pages at once, so I'm doing so as I go, but so far v4 works like a charm

UPDATE
I have to retract myself. It's not working. If I set the property BC-folder-note: up in a folder note (a note with the same name as a folder), I expected all other notes in said folder to get ad edge with the former. Is it still spelled BC-folder-note in v4?

UPDATE 2 (for whomever reads this after the fact)
It was my bad. Read comments immediately following this one. It's BC-folder-note-field now!

That's one of the breaking changes, it's now BC-folder-note-field.
If you open up the Obsidian console, then rebuild the BC graph, you should see a log about explicit edge sources, or something similar. If you open that up, you should see errors for Folder Notes telling you about the breaking change (but there's no big notification letting you know, it's pretty hidden)

btw, Breadcrumbs doesn't give special meaning to files with the same name as their parent folder (like the Folder Notes plugin does). That would help solve a specific problem actually, but it isn't currently implemented.
Breadcrumbs Folder Notes just mean: "Whichever note the BC-folder-note-field is in, all other notes in the folder should point to it"

Oh no! This is my bad. I read you, then went on with my usual stuff, and when I came back to this i had a nagging feeling I was forgetting something about how the property was spelled (hence my question). Thanks! I can confirm that it does indeed work :)

As for giving a special meaning to the name of the file, maybe it's now even needed if the user sets up a template. Once everything is in place, there is no need to recurse downwards

Please clarify your point about folder notes and templates, I don't follow

Please clarify your point about folder notes and templates, I don't follow

I think some of the plugin that handle folders, such as AidenLx's Folder Note, have an option* to define the default content of new Folder Pages when they are added (ie a template for new folder notes). Meaning that I could add BC-folder-note-field: down to this template and incorporate it seamlessly into my workflow

*At least I believe I've seen this template option somewhere. Maybe it was a different Folder Note plugin

UPDATE

image

Yes! There is indeed an option for templates!

Oh cool! Yeah, that integrates really well, thanks for sharing.
Gonna point to this issue #504 for when I update the docs on this feature

You can further customize your template with something like this

---
folder-note-field: down
---


# {{FOLDER_NAME}

\```
breadcrumbs
type:tree
dir:down
depth: 0
content: closed
\```

My markdown-jutsu is still unpolished, I didn't know how the escape the nested codeblock. But yeah, the idea is you get a nifty folder page :)

I've noticed that the Tree View is a list, that is, no collapsible (content: closed/open has no effect)

Yeah, nice :)

Indeed, the content field isn't implemented yet!

I'm gonna close out the original issue as complete. V4 isn't fully live, but is quite stable at this point. Thanks again for all the detail! Please do share any V4 feedback, it's really helpul :)