obsidian-tasks icon indicating copy to clipboard operation
obsidian-tasks copied to clipboard

cant UNDO "mark task as completed" in query display

Open garethfr opened this issue 2 years ago • 7 comments

Expected Behavior

I have a task that is displayed on a page in a query statement. I mark the task as DONE, The task disappears. I should be able to undo this action (^Z or Edit > Undo) to mark the task as not done and get the task back in my query view.

Current behaviour

If I mark the task done, the task dissapears from the query diplay. When I press Command-Z (on Mac) the action isnt undone, the task stays DONE.

Steps to reproduce

  1. Create a task in a note - [] Test task 📅 2022-08-12 (Use today's date)

  2. Display this task in a second note

```tasks
not done
due today ```
  1. Check the task as completed in the second note page

  2. UNDO the action (^Z / CMD Z)

  3. Watch as the action isn't undone

Which Operating Systems are you using?

  • [ ] Android
  • [ ] iPhone/iPad
  • [ ] Linux
  • [X] macOS
  • [ ] Windows

Obsidian Version

0.15.9

Tasks Plugin Version

1.11.1

Checks

  • [X] I have tried it with all other plugins disabled and the error still occurs

garethfr avatar Aug 13 '22 00:08 garethfr

I do agree that this would be nice, but I've just tested in a vault with Tasks turned off, and the built-in task completion mechanism has the same behaviour.

  • Create a task
  • Switch to reading mode
  • Toggle the task
  • Hit shortcut for Undo, and task does not get re-opened

However, switching back to editing mode makes the Undo work:

  • Create a task
  • Switch to reading mode
  • Toggle the task
  • Switch back to Source or Live Preview mode
  • Hit shortcut for Undo, and task does get re-opened

I'll leave this as an Issue, as I agree it would be a nice improvement, and it does feel like a bug, from a user perspective.

But whilst the behaviour is the same as Obsidian, we are unlikely to be able to fix it.

claremacrae avatar Aug 13 '22 08:08 claremacrae

thanks for the extra info @claremacrae I have created an obsidian bug report here https://forum.obsidian.md/t/cant-undo-mark-task-as-completed-in-reading-view/41776

garethfr avatar Aug 13 '22 15:08 garethfr

Hi @garethfr - super, thank you for the update.

claremacrae avatar Aug 13 '22 15:08 claremacrae

@claremacrae If the query is in a different file from the task, I suspect the undo behavior is even more complicated. Do you know?

AnnaKornfeldSimpson avatar Aug 13 '22 17:08 AnnaKornfeldSimpson

Oh ouch, the answer on the forum bug is:

There is no undo in reading mode

Since task query results are essentially displayed "in reading mode" (@garethfr if this doesn't make sense please let me know and I can explain further), this may mean that the internals of Obsidian may make this complicated to fix.

AnnaKornfeldSimpson avatar Aug 13 '22 17:08 AnnaKornfeldSimpson

Interesting @AnnaKornfeldSimpson. I know nothing of the internals of obsidian, but logically, even if the task is displayed in reading mode, there is definitely some editing going on, as the note is updated. Anyway as it seems to be an obsidian issue not noted plug-in I guess we have to wait and see if they reply

garethfr avatar Aug 13 '22 20:08 garethfr

@claremacrae If the query is in a different file from the task, I suspect the undo behavior is even more complicated. Do you know?

No, sorry I don't.

claremacrae avatar Aug 13 '22 20:08 claremacrae