Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MxKnox
Copy link

@MxKnox MxKnox commented Nov 17, 2023

  • 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.

- 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
@MxKnox
Copy link
Author

MxKnox commented Nov 19, 2023

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:

  • moved around some bits just to help the initial index not have to create a new todo parser for every file and instead have them injected.
  • added a skip feature for done todos since they aren't visible anyway. Instead of parsing done todos and indexing them, they are discarded early. This can be toggled on the class but not through the settings.

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✌

@MxKnox MxKnox closed this Nov 19, 2023
@MxKnox MxKnox reopened this Nov 19, 2023
@larslockefeer
Copy link
Owner

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:

  • The system you are using (operating system, memory)?
  • Characteristics of your vault? What is the total size of your vault in megabytes?
  • The ways in which the plugin / Obsidian are incredibly slow for you?

Thanks a lot!

@MxKnox
Copy link
Author

MxKnox commented Jan 7, 2024

Hi Lars,

here's my specs:
system: windows 10 Pro N
cpu: ryzen 3900X
ram: 64GB

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)
unchecked items: 586 across ~40 files (This is after I removed a lot, not sure how much though sorry!)

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.
I added an path match to just block out sections of the vault that I didn't want this to load into the to-do list which helped me just not worry about needing to clean all that up before the plugin could be useful.

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.

@MxKnox
Copy link
Author

MxKnox commented Jan 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants