danielo515 / obsidian-modal-form

Define forms for filling data that you will be able to open from anywhere you can run JS
https://danielorodriguez.com/obsidian-modal-form/
MIT License
175 stars 13 forks source link

[BUG] Fuse rating for FileSuggest #272

Closed revolvermann76 closed 1 month ago

revolvermann76 commented 1 month ago

In suggestFile.ts you use a Fuse rating of

            keys: [
                { name: "path", weight: 2 },
                { name: "tags", weight: 1 },
                { name: "frontmatter.aliases", weight: 2 },
            ],

That makes the path-name success over the actual file-name.

It is not easy for the user, to pick a file "place.md" if there exists alot of files within a path like "a/place/somewhere/".

A better Fuse rating would be

      keys: [
        { name: "name", weight: 3 },
        { name: "frontmatter.aliases", weight: 2 },
        { name: "path", weight: 2 },
        { name: "tags", weight: 1 }
      ],

A simple change. But it makes life much more easy for the user in some cases ;)

danielo515 commented 1 month ago

I completely agree. Was wondering why was so hard for me to find the right files. Willing to open a pull request? What do you think about giving path and tags the same weight? Aliases seems more important to me

revolvermann76 commented 1 month ago

I created a pull request. I gave path and tags the same weight (as you suggested).

Have a nice day