liamcain / obsidian-things-logbook

Sync your Things 3 Logbook with Obsidian
MIT License
120 stars 22 forks source link

Cancelled tasks show as completed in logbook #29

Closed els-pm-mattstratford closed 2 years ago

els-pm-mattstratford commented 2 years ago

Describe the bug

Cancelled tasks show as completed.

Alt-clicking a task strikes it through in Things, whereas in Obsidian the task is marked complete like any other complete task.

Steps to reproduce

  1. Open Things
  2. Move focus to a to-do
  3. Alt-click to strike it through
  4. Wait for sync to Obsidian
  5. To-do will display as completed

Expected behavior

  1. To-do is displayed as cancelled

Screenshots

image image

Environment (please specify)

OS

macOS

Obsidian Version (e.g. v0.10.6)

v0.12.19

Theme (if applicable):

Minimal, by Kepano

djbowers commented 2 years ago

I second this, would love for cancelled tasks to show up as crossed out or something that is different from completed tasks.

kurtharriger commented 2 years ago

I also ran across this issue and thought it would be useful to have canceled tasks recorded differently.

I created a simple PR that will query the status and mark canceled tasks with a c instead of an x. https://github.com/liamcain/obsidian-things-logbook/pull/30#issue-1077901415

By default, obsidian will render a task with any character in between the [ ] as complete which includes a strikethrough, so changing the mark does not in itself change the appearance, but now can be targetted with css using the data-task attribute.

I thought about using CSS to replace the icon, but I don't much like that obsidian rendered a strike-through on completed tasks as the checkbox itself is sufficient for me, so I opted to add the following more simple CSS snippet which rendered canceled items with a strikethrough.

ul > li.task-list-item.is-checked[data-task] {
    text-decoration: none;
}
ul > li.task-list-item.is-checked[data-task="c"] {
    text-decoration: line-through;
}
liamcain commented 2 years ago

Hi! I just noticed that while I cut a release for your change @kurtharriger, I never bumped the version in the manifest.json.

This fix should finally be released now, sorry for the long wait 😢


If you want, you can modify your data.json inside the plugins/things-logbook folder which keeps track of the last synced time (latestSyncTime). If you remove that line, the plugin will override all historical entries and will automatically fix it so that canceled entries show properly as canceled.