CalDav tasks/todo support

I don’t know how far this is implemented on the CalDav synchronisation side already, but being able to view, edit and complete tasks on your phone would be immensely useful.

And being able to view them from the events view, just like calendar items would be great!

6 Likes

Some technical insights about tasks and synchronisation using CalDAV from the Open source parts of SailfishOS:

  • events and tasks are handled by KCalCore project, which is also used (in a more up-to-date form) in KDE. I’m working on switching to upstream KDE version in SailfishOS, but it’s a long task because our version of KCalCore is still using KDateTime from KDE when QDateTime from Qt4 was not properly handling time zones. So all the stack need to be migrated and the API between KDateTime and QDateTime is not 1:1. There is a high risk of introducting bugs and regressions. Anyway, current ancient KCalCore used in SailfishOS can perfectly handle events and tasks, no problem.
  • storage of events, tasks and notes is done by mKCal which is a SQlite backend for storage interface in KCalCore (originating from Nokia and separated from KCalCore). KDE is not using it since it is using Akonadi to store events, tasks and notes. I think SailfishOS is the last to use this piece of code from Nokia era. But I’m not sure Akonadi can provide a lightweight storage backend as mKCal is. So not problem to store tasks (besides code paths that have been never used for a long while).
  • synchronisation is done via a plugin to Buteo framework. This plugin was supporting events only up to 2019, when I removed the peculiarities in the code and generalised it to use events, tasks and notes (see commits ecc2a763 and 4db2e6fb). The last bit that requires to be switched is this line in the resource request to the server: <c:comp-filter name="VEVENT"> where we actually ask the server to filter the returned components on events only. I’ve kept the filter up to now because changing it would mean that the synchronisation can be done also on tasks and notes, but these new tasks and notes will not be visible in any UI, just saved in the local database on device. And doing so will use code paths that have never been used yet, with potential issues. It would be a shame to fail synchronisation for something that is not visible.
  • Having tasks visible would require to update the QML bindings for KCalCore. Because even if upstream KCalendarCore (its new name) is providing bindings nowadays, it was not the case ten years ago. So we have this nemo-qml-plugin-calendar to do the job. And these bindings have been written for events only… There is a merge request to extend its capabilities to todos done by a community member: @rubdos. But it has never been accepted up to now. With it we would have possibilities to also display todos in QML.

Which brings me to the last bit, that is not Open Source. The calendar application. It is mostly QML files, so community can try to contribute there with patches, but it’s not really convenient. But besides, what the community can do it to provide mockups and ideas on how the calendar app could be adjusted to display tasks. I’ve access to calendar application sources through an NDA, if I see nice mockups or ideas, I could try to implement them. The simpler the modifications are and the less intrusive to the current design, the higher is the possibility that they would be accepted. It happened already for instance with the new recursive options that have been proposed by @bongo and @peterleinchen (see this TJC thread) and that are now available in 3.4.0.

Finally, I think we may have the task displayed for almost free in event view as soon as QML files can cope with tasks (cf. my bullet on nemo-qml-plugin-calendar). The reminders are also for free since they are handled at mKCal level.

6 Likes

Nothing valuable here, I’m afraid, just what I’d like as the tasks display.

I’m not sure if the task of displaying tasks :wink: should be calendar’s job at all. For one, task are not necessarily tied to any given date. Still they can be displayed in calendar in pretty simple way:

  • month view: there is already event list below the calendar grid; tasks may be listed here, just instead of colored bar there may be colored circle - empty for uncompleted, filled for completed tasks; maybe partially filled (by sectors, as in pie-chart) if we want to track progress for long-duration task.
    Due dates might be indicated on calendar grid with dots over day number – they would be clearly visible, different from events’ underline and the dots would correspond to circles – so, underlines/bars for events, dots/circles for tasks. But I’m not sure if such additional indicator is needed…
  • day view: today’s tasks at the top, just below “previous event”. I don’t think future tasks belong to day view at all. If the task has due hour specified, I’d see it at the top if the hour is not visible, on its proper place otherwise.

Lifetime of a task (so, when should it be displayed):

  • a task with start and due date: should be shown from start day to day of completion, and then stay on the day it was completed, for reference. When still not completed at due date, the task should be visually promoted; shown first, maybe bold to indicate its status. Overdue task should be visible after their due date, if not completed.
  • no start date: should be visible since when it was entered (start date = creation date)
  • no due date: visible from start date until completion, never overdue
  • neither start nor due date: visible since creation until completion.

Recurrence is a must (webOS, otherwise excellent as PIM, has no task recurrence. Useless).

Tricky part is ordering displayed tasks. I think that user-provided priority should be (at least by default) mixed with time-until-due, so effective sort priority should slowly rise as due date gets closer, maybe in non-linear way.

2 Likes

I don’t see a need to implement the tasks into calendar app. Even apple decides calendar and tasks into different apps while the sync protocol in the background is the same. Microsoft does the same in Windows 10: Events in calendar, tasks in To-Do.
I’d prefer it this way. So if I get @dcaliste right it would be easier to create a separate task app than implement tasks I to the calendar, correct? And even for those who prefer tasks in calendar app: right now we have no synced tasks app - getting one as standalone would be better than none…

3 Likes

Interesting post. I’ve begun creating an app for nextcloud tasks (which basically is caldav tasks aka VTODO’s). I posted earlier with some questions, and your post provides some insights in the answers to my questions.

I did look at nemo-qml-plugin-calendar, and concluded that it indeed does not support tasks, just events. When exploring the service by interacting over dbus I also seem to get only ‘get’ access to that service, is that expected? I’m probably missing some permission-related thing here, i’m quite the newbie in Sailfish development and still finding my way.

Anyway, implementing tasks into the calendar app is one way, but not optimal since it shuts out the community from working on it I guess. And I agree with @cryx that it makes a lot of sense to have one calendar app and another tasks app. I’m quite used to that seperation already, even in nextcloud they are different apps (using the same calendar storage backend). I’m hoping I can adapt the app i’m working on to use the nemo-qml-plugin-calendar if/when that provides read/write access to tasks, but for now the best seems to be to include the account handling / caldav interactions local to the app.

I really like the way its done in Nextcloud right now. Seperate Apps, but you can see Tasks in Calendar ond things from Deck in both calendar and tasks. But for editing/working it’s good to have different apps. Would like this in Sailfish too.

1 Like

I’m on vacation at the moment. I cannot help you much. Next week we can interact directly if you wish so. For modifications you can do it via DBus, as for creation. I don’t have in mind the method though. It’s explained on old together.jolla.com