-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex matching for paths to include, regex for "someday" lines and a regex to hide TODOs without completing them. #86
base: main
Are you sure you want to change the base?
Conversation
- Added Pattern matching to hide individual TODOs - Added Pattern matching for the folder paths allowed to be indexed. - Added new parser to handle the json => regex patterns
I was messing around with some todo tracking plugins, I liked your plugin concept but it ran incredibly slow for me with the amount of undated, incomplete checklists floating around in my vault. To help this I added some regex checks for ignoring specific tasks (similar to #someday, but just completely ignored) and also switched the #someday feature over to a regex check too. I've made all of these work with either a single pattern or an array of patterns. This is the first obsidian code I've ever touched and I never really looked too deep into the plugin api so there is probably a better way to show the regexps, but for now if you want to use an array of them, the input in the settings needs to be a json stringified array so that it can be serialised into an array of strings representing the regexps. To help with the speed, I also:
After submitting this, I saw some other people have made similar feature changes for themselves already in PRs. Happy for you to ditch whatever from this in preference of other changes if you ever come back to maintain this. Thanks for the plugin, I hope this contribution helps improves it in some way✌ |
Hey @MxKnox, thanks so much for your contribution. There are definitely some things in there that I already had on my list to get to at some point for which this may serve as a starting point. I heard more reports of the plugin being slow (e.g. #87) and I have ideas for how to improve this, but I'd first like to have a reproduction scenario to test potential performance improvements against. I spent some time trying to generate large datasets that could lead to Obsidian and the plugin being slow but in my first attempts Obsidian and the plugin are holding up quite well. Could you share some more information with me maybe about:
Thanks a lot! |
Hi Lars, here's my specs: vault size: ~18MB (May have been larger at the time, I've removed 99% of the images and PDFs that I had in my vault to organise an application for something, but that would have had only a handful of .md files) I think this large number of unchecked, untagged to-dos was what it was slowing down on and trying to clean those up to make them disappear was where I think I was having issues at the time. This is mostly from checklists I made for work projects but then stopped using for whatever reason. This was my first time working with electron/obsidian so the settings controls were just kind of mashed together and I'm sure there would be a better way of handling the settings I was just trying to get this usable for myself and didn't spend too long trying to figure out the UI controls. |
I was trying to remember what the speed issue was but, I don't remember specifically what the issue I had at the time was. It was either around load times or trying to interact with all of the untagged items. One thing that may contribute to that is I keep this obsidian folder in google drive, so its easily accessible from anywhere, so that could contribute to load time issues but the vault isn't too crazy of a size so I'm not sure that was the problem. Sorry I couldn't give more specifics I really only had issues for an hour or two the first day I tried the plugin. I got annoyed with the speed and was procrastinating something else so I put a couple hours into this. I only point this at my daily to-dos now with my changes and have zero issues with it. |
Added patterns matching for 'someday' in place of fixed value.
Added Pattern matching to hide individual TODOs
Added Pattern matching for the folder paths allowed to be indexed.
Added new parser to handle the json => regex patterns
Added options in settings for each of these
For indexing the entire vault, moved the TodoParser initialisation out so it only gets created once.