kkga / tdx

CLI todo manager for iCalendar files.
The Unlicense
14 stars 1 forks source link

A new empty list prevents tasks to be created #14

Open tcassaert opened 2 years ago

tcassaert commented 2 years ago

Thanks for this awesome CLI tool! Was looking for something like this for a while.

As the title says, it's currently impossible to create a task in a directory that doesn't contain a file with an *.ics extension (or any other extension configured).

This method https://github.com/kkga/tdx/blob/main/vdir/vdir.go#L131-L139 seems to prevent it. Do we need to check the existence of a file?

tkapias commented 7 months ago

The issue is that in CALDAV, the VTODO availability is opt-in for each calendar.

Vdirsync does not know if a calendar will be dedicated or even available for VTODOs, when it proceed to discover/metasync a new or empty directory it will only copy the metadatas: color and displayname.

tdx will discover existing lists by scanning recursively to search for some existing BEGIN:VTODO/END:VTODO fields in a calendar and label them as a list (named as the content of displayname).

I like that tdx does not list every calendar as a list because I have a lot of holidays/birthdays calendars that I don't want to see listed. But then, it's hard to imagine a clean solution to get this information for empty an calendar.

I see 3 possibilities:

  1. Create some inital (and done) task in a new calendar: it's a little tedious and you have to be careful to not purge done tasks. tdx could include a command to generate that initial task and exclude them from the purge.
  2. Parse the displayname for some prefix/suffix: my VTODO calendars titles end with "- Journal". But it would mean some calendar renaming for most users.
  3. Use environment variables or a config file to force the listed calendars names or paths.

For now I use the first solution but I would like to see the second one implemented.

@kkga, thank you for tdx, I was looking for this kind of app for a long time, I use khal for calendars and nb for notes, but for todos I tried many things (Calcurse, taskwarrior, nb) and always missed a simple solution using CALDAV. Are you planning to continue working on this project?

kkga commented 7 months ago

@tkapias thank you for the detailed report, good to know that somebody uses this tool!

Unfortunately, it's been a very long time since I touched any Go code: at this point, I'm not even sure how to approach the problem.

As I don't plan on maintaining this project, I'd recommend trying out todoman, which is a much older and more mature tool that is still actively maintained.

tkapias commented 7 months ago

@kkga In fact, I've just realized that I tried todoman 2 years ago and found a problem with categories management. It's been solved in the meantime, but I'd completely forgotten it existed.

tdx seemed like a very good starting point and still seems to have a better formatting, but I'll work on that part with Todoman and see how it goes.

Thanks for the link.