-
Notifications
You must be signed in to change notification settings - Fork 8
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
(Feature) Unscheduled tasks #43
Comments
According to code Tasks.ts You could add a parameter in constructor and then adapt a bit:
Then use it to lead your process:
Maybe there are other places that needs to be adapted. Full example (not tested):
|
Hi @Blondwolf Great suggestion. I think a setting is a great idea, default to off to replicate the existing behaviour. If the setting is on, the code will append the VTODO block to the end of the iCalendar. I'm not sure if I need to implement the RELATED-TO property in the VEVENT and VTODO blocks. |
- Create new settign to enable todo items to be added to iCalendar. - If enabled, after generating the VEVENT block, also generate a VTODO block. - Support uid, summary, dtstamp and location just as we do during VEVENT. Add support for due and completed. Also add support for status proeprty based on the task status. - Update README to explain new setting.
Hi again @Blondwolf. I've created a branch and pull request for this one. Please review and let me know your thoughts. |
Ahah I was about to implement it from a fork of your projet. Great yeah, it looks nice. I like your code bro. It is readable. Oh well this RELATED-TO field is very interesting.
Probably not the scope for this ticket issue I think. We should open a new one if you want to work on this. |
Okey so, what you've done is ok but you still need to modify a line to include the tasks from your filtering. Task.ts line 81:
You need to include a variable based on the isIncludeTodo setting you've just added. So you need a new parameter for you TaskFinder. Something like: ignoreUnscheduledTasks. Just ref the setting with the class parameter
Then use it:
and propagate in Task.createTaskFromLine:
But then you need adaptation. That's why I proposed the code in previous post Just a comment on your architecture, there are some stuff I don't really understand why you made it such like the custom Mains.ts. I am pretty new to obsidian coding though I have a lot of programming experience so I don't know really what's the standart. Some parts just feels a bit overengineered. like createTaskFromLine would more belong to TaskFinder I think as you are still performing the text analysis. And so you don't have to pass all parameters again. Probably it's better that I wait on this milestone to have the unscheduled tasks completed, then I'll propose a refactored version from my fork and pull request. |
Hi @Blondwolf thanks for your input here. Very good pickup regarding missing VTODO blocks that don't have a date. I've committed a change to the PR to address this. Commit that allows for inclusion of Tasks without dates: ba0ab78 Whole PR: https://github.com/andrewbrereton/obsidian-to-ical-plugin/pull/45/files I've got a test Obsidian vault with files and tasks. The generated iCalendar file now includes tasks without dates as VTODO items. |
Regarding architecture, this is my first Obsidian plugin so I don't know if I'm doing things the right way or not. The Obsidian devs reviewed it, and gave some suggestions, and approved it so it can't be tooooo bad. It has grown organically though, so I will do a review at some stage. I'd like to have unit tests in place though so I can make changes with more confidence. In
Once these current issues/PRs are merged, I plan on storing the settings in a singleton similar to the Logger class. This will fix two issues:
|
Please don't get me wrong, the code is pretty clean. Furthermore if it's your first one. Anyway it's nearly impossible to implement the last version directly :p So you did right by implementing it somehow first. I have something to say for each subject so I opened new tickets. To keep subject on unscheduled tasks, let me just review it again. I need to quick adapt because I don't use Bun ahah |
There is still a problem. You have doubles. events are added as todos as well. For this:
I have those 5 where I should only have 3. 1 Task and 2 events:
|
I've implemented it so that every task with a date is a calendar event AND a todo, and every task without a date is only a todo.
This is your feature request. What are your requirements?
Does your use-case require this? |
You are too kind. I appreciate but I think that it is better to have something that fulfill the majority of people requirements. Not just mine.
Mine is event OR todo separated from each other. Well in fact my first main requirement is already completed by the plugin itself. Basically I use it to send the .ics directly to my Radicale server. Via a plugin I made for triggering changes on the .ics file, then APIRequest plugin to send the trigger to a NodeRED server which accept my API request, read the .ics file and send it to Radicale via a PUT on caldav. Having the possibility to synchronize the tasks as well would be nice.
So it would be a good idea to define another setting to specify if you want your event to be added as todo as well. |
Thank you for explaining your use-case, it is helpful. I'm glad to hear that your main requirement is completed. Throughout my life, something I try to avoid doing is building solutions for the assumed silent audience. Oftentimes I have found that it makes code more complex, and even more often, the assumed use-case does not exist in reality. (i.e.: ASSUME: makes an ASS of U and ME 😄). This is why I am a bit hesitant to implement something for a perceived problem. With that said, I think it is rather simple to add a new setting which asks the user to decide if they want tasks with dates added as a TODO, or just tasks without dates added as a TODO. And again quite simple to consider this setting when building the iCalendar file. For example: If
Options:
|
This is a good YAGNI feeling that you have. You should indeed always ask yourself if this is necessary. Furthermore comparing to old softwares architectures (used to be closed, non-standardized), where we have now plugins, API, and more standards, that leads to a way better program interoparability. Simply say it is way easier to make softs communicate so enhance modularity. In this case, this would be a bit hard to add a wrapper or an extension working with your plugin. Well it would possible to re-read the entire calendar file but that would be a bit an overkill. In this case, you are indeed generating the .ics file so it still make sens for me. |
What are your thoughts on this issue? Should I:
|
Egoistically I would say 2) But please, this is not urgent, so prioritize your needs |
This has been in 1.17.0 |
I need to test it more but it looks damn awesome. Thank you a lot. Sorry I haven't been able to help you since. |
Context: .ics, .icalendar
First, thank you a lot. I was searching for something to synchronize my tasks with my calendar and this plugin is just perfect.
This would be even more perfect if the .ics file would also be populated with unscheduled tasks as "todo". I've try with both .ics and .icalendar format but does not seem to load the tasks.
This is compatible with .ics and .icalendar format:
This could be then enabled with a boolean switch in settings.
Thanks in advance
The text was updated successfully, but these errors were encountered: