marcusolsson / obsidian-projects

Plain text project planning in Obsidian
Apache License 2.0
1.42k stars 57 forks source link

Added a filter option to search for parts of entries contained in lists #921

Closed Signynt closed 2 months ago

Signynt commented 2 months ago

When filtering projects, sometimes I want to be able to match parts of entries of lists. For example if files in a project have list properties containing california adventure, hotel california and californiacation, then under filter, I can select the option "contains part of" in the drop down, and enter in califorina. This will match any files which contain any of the above property entries.

I'm uncertain as to how this filter option should be named, and am open to suggestions that might be more descriptive of what the filter option does.

image

Acylation commented 2 months ago

Will be a QOL feature! Thanks for proposing and contributing. I suggest expressions like "has keyword" or "matches keyword" on this case. And the input component should use a text input rather than tags/multitext input.

Signynt commented 2 months ago

@Acylation Thanks. I've changed the wording to "has keyword".

Currently it seems to be implemented so that each property type only allows one input component type, and I'm not sure how I would elegantly change that. If it's something simple I'm missing I'd be happy if you could add it! Since it's only an aesthetic difference, I wouldn't mind too much if it stays the way it currently is.

Signynt commented 2 months ago

I saw the build failed, so I've updated the code to fix the issue.

Acylation commented 2 months ago

Yes I'll take care of refactoring to allow multiple input types with each field type. This is also a must to support dynamic date filters described in #918 and #835.

Acylation commented 2 months ago

Since the right part is now string rather than array, I've also change the matching functions accordingly. Please don't hesitate to reach out / contribute back if there are any problems.