blacksmithgu / datacore

Work-in-progress successor to Dataview with a focus on UX and speed.
MIT License
1.4k stars 14 forks source link

[Feature Request] Inline Fields on a Per-Note Basis #51

Open iamrecursion opened 3 months ago

iamrecursion commented 3 months ago

Currently we have the ability to enable/disable inline fields globally. Many notes I never care about having indexed for inline fields, but some I absolutely do.

To that end, I was wondering if any thought has been given to allowing notes to opt-in selectively using a key in the (always indexed) frontmatter. Something like datacoreParseInlineFields: true or similar.

blacksmithgu commented 3 months ago

I'm curious if you want this because of inline fields causing you notable performance problems, or just as a cleanliness thing. If it's purely performance than there is some other stuff I can improve to make this less annoying.

iamrecursion commented 3 months ago

A bit of both, but primarily performance. My vault is ~12k notes and so takes a noticeable amount of time to index. On mobile it takes a significant amount of memory that will sometimes crash the app.

blacksmithgu commented 3 months ago

There is a flag that disables all inline fields - if you disable dataview (so only datacore enabled) with that flag, is indexing much faster? (It would not surprise me, given skipping inline fields allows skipping a LOT of parsing logic).

Is a frontmatter entry the right level of abstraction here? Would a tag be better? Or something in the "settings" menu that you can have a list of files for?

cdloh commented 3 months ago

IMO a frontmatter field is the best. Using tags for things over then tagging notes always feels like overloading the field to me. Having a specific field designed just for this sounds like the biggest win to me.

I also prefer it over a field in settings because then I can just add notes for indexing as I create them rather then having to go into the settings every time.

iamrecursion commented 3 months ago

Yeah it's noticeably faster to index if I disable that toggle in settings!

I would also think that frontmatter is the best solution. It's something I feel like I would want to decide on the fly, rather than something I can easily determine up front.

blacksmithgu commented 3 months ago

My stance on this - for performance problems I'd like to just try and make general performance better than offering too many precise levers for manipulating performance, since having to explicitly remember to set this on pages seems like pretty annoying user experience. I'm going to try improving some of the import logic to make the performance here generally better, but if it doesn't work, I'll add some sort of option for conditional parsing of inline fields.

iamrecursion commented 3 months ago

Okay, sounds like a plan!