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

[Bug]: Three fatal interactions with date popup and tasks plugin

Open aubreyz opened this issue 2 years ago • 14 comments

Describe the bug

  • Reminder truncates the rest of the text line when entering (@ mid-line
    • This is regardless of the installation of the tasks plugin
  • Reminder (@ date) at the end is not allowed by the tasks plugin but is seeming required by reminder
  • There is an interaction between these two plugins in terms of keystroke recognition while typing in a task

Since the problem and various test of it are described in great detail on the issues page of the tasks plugin there is no merit summarising them further here - see https://github.com/obsidian-tasks-group/obsidian-tasks/issues/910

These are two great plugins and it would seem worthwhile trying to get them to cooperate, but at least in terms of the above most of the problem seems to be in the reminder court - with possible simple solution to make sure users avoid using the (@ popup if using tasks, and also warning them not to leave the (@ at the end of the tasks line but rather after the description only.

Expected Behavior

see https://github.com/obsidian-tasks-group/obsidian-tasks/issues/910

Steps to reproduce

see https://github.com/obsidian-tasks-group/obsidian-tasks/issues/910

Operating system

Windows

aubreyz avatar Jul 21 '22 09:07 aubreyz

There is an interaction between these two plugins in terms of keystroke recognition while typing in a task

Can you say what the basis of this is please?

It was theorised originally that the the problem was an interaction between Tasks and Reminders.

But everything that was described in that original issue was observable with only Reminders installed. See this comment: https://github.com/obsidian-tasks-group/obsidian-tasks/issues/910#issuecomment-1189204688

claremacrae avatar Jul 21 '22 15:07 claremacrae

Yes that bit is correct. The described behaviour in reminders is forced by the fact that tasks does not want anything at the line end. So that part is not a coding interaction, but it is a major incompatibility of two key plugins.

The bad interaction (at least at the task end) is that tasks does not like stuff at the end of the line (which reminder wants to do), and also has a due date without a time (necessitating workarounds such as the (@ and the use of yet more icons at the reminder end.

aubreyz avatar Jul 21 '22 15:07 aubreyz

One idea that might help: it would think it would be doable to make Tasks recognise and not damage this:

`Reminder (@ date) at the end is not allowed by the tasks plugin but is seeming required by reminder

My only hesitation is I’m nervous about pointing Tasks users towards Reminders whilst https://github.com/uphy/obsidian-reminder/issues/93 is still a problem, that is completing a recurring task via Reminders breaks the recurrence pattern.

However, there was a suggestion earlier today about Tasks maybe providing a TypeScriot API for use in other plugins, so maybe Tasks could expose a function that Reminders could use to do the recurrence calculation, and avoid duplicated code.

I know I’ve said this elsewhere, but I would still love to give those who use both Tasks and Reminders together to have a better experience, but I’m depending on someone who knows the Reminders code being able to work together with me on that, to make it happen.

claremacrae avatar Jul 21 '22 19:07 claremacrae

Here is the way that the Tasks says to use Reminders that are compatible with Tasks:

https://obsidian-tasks-group.github.io/obsidian-tasks/advanced/notifications/

Where to add the reminder date

The order is important when writing the task. You have to put the reminder date between the task name and the other fields :

- [ ] #task task name ⏰ YYYY-MM-DD HH:mm ⏫  🔁 every *** 🛫 YYYY-MM-DD ⏳ YYYY-MM-DD 📅 YYYY-MM-DD

claremacrae avatar Jul 22 '22 08:07 claremacrae

As an aside, the reminder plugin does all sorts of other horrible things to tasks

So if you have it set to use the tasks due date as the reminder date, and switch off its own mechanism and you have a task like this

  • [ ] #task Task due today 🔁 every week 📅 2022-07-22 🛫 2022-07-23 ⏳ 2022-07-29

The popup will give you the option to defer the task by some time. If you do defer it (in this instance by a week) then unless the due date was at end the, it does change the due date by a week but it wipes absolutely everything else out!!

  • [ ] #task Task due today 🔁 every week 📅 2022-07-29

aubreyz avatar Jul 22 '22 21:07 aubreyz

The reminder plugin is wonderful, but until these problems are sorted out I am going to have to be switching it off

So in summary the problems are: a) The (@ popup wipes out the rest of the line b) If reminder popup is used to change the due date (from tasks format) it wipes out half the task c) Tasks does not permit stuff at the end of the line, but if the (@ format is used it wants to be at the end of the line

aubreyz avatar Jul 22 '22 21:07 aubreyz

c) Tasks does not permit stuff at the end of the line, but if the (@ format is used it wants to be at the end of the line

As mentioned earlier, Tasks documents that if you want to use it with reminders, you should use the clock emoji, not (@: https://obsidian-tasks-group.github.io/obsidian-tasks/advanced/notifications/

claremacrae avatar Jul 22 '22 21:07 claremacrae

c) Tasks does not permit stuff at the end of the line, but if the (@ format is used it wants to be at the end of the line

As mentioned earlier, Tasks documents that if you want to use it with reminders, you should use the clock emoji, not (@: https://obsidian-tasks-group.github.io/obsidian-tasks/advanced/notifications/

Unfortunately the advice in the Tasks documentation doesn't work for exactly the same reason. If you set the clock emoji to be the relevant thing in the reminder settings, and then have a task like so:

- [ ] Task ⏰ 2021-07-25 00:10 ⏫ 🛫 2022-07-24 📅 2022-07-25

When the reminder pops up, if you reschedule the reminder it wipes the rest of the line (the priority, start date, etc).

Reminder does not permit any characters other than date/time between ⏰ and 📅 But the tasks editor dialog puts them there.

It sometimes only wipes some things, so for the exact example in the tasks documentation, the first time the task reminder is deferred the priority is wiped

- [ ] #task task name ⏰ 2021-04-04 12:00 ⏫  🔁 every 2 weeks 🛫 2022-05-05 ⏳ 2023-06-06 📅 2027-08-08

becomes

- [ ] #task task name ⏰ 2022-07-30  🔁 every 2 weeks 🛫 2022-05-05 ⏳ 2023-06-06 📅 2027-08-08

aubreyz avatar Jul 22 '22 23:07 aubreyz

@aubreyz @claremacrae Sorry for late reply. I've tried to improve the behavior. Can you check?

Wherever we insert the reminder date, the date will be inserted before the Tasks plugin tokens when we enabled Tasks plugin format and Distinguish between reminder date and due date options.

https://user-images.githubusercontent.com/1233373/200156092-44b97a25-8c3b-4c43-b2c5-1761157a9d6f.mov

uphy avatar Nov 06 '22 05:11 uphy

@uphy ~~Thank you! Which was the commit that included the fix please?~~ cancel that, I see the PR is draft and not merged.

I hope to have some time to fix it later today.

claremacrae avatar Nov 06 '22 07:11 claremacrae

Oh, I'm sorry for confusing you. I haven't release the feature yet. I just wanted to confirm my understanding is correct or not.

uphy avatar Nov 06 '22 09:11 uphy

Oh, I'm sorry for confusing you. I haven't release the feature yet. I just wanted to confirm my understanding is correct or not.

Ah right, brilliant. Yes, your understanding is correct and this should really help. Thank you so much for doing it.

Related: would you be interested in working together to see how I can share the Tasks plugin code for handling recurrence, for re-use in Reminders?

If we can enable Reminders to handle recurring tasks too, then there are smoke changes I would make in Tasks to play nicely with Reminders (like updating the Reminder date when completing a recurring task) and I think we could declare to our users that the two plugins are then fully compatible...

If you are interested in working together, my email address is in my GitHub profile...

claremacrae avatar Nov 06 '22 09:11 claremacrae

@claremacrae Thank you for checking! I release it today.

Related: would you be interested in working together to see how I can share the Tasks plugin code for handling recurrence, for re-use in Reminders?

I fixed recurrence handling issue today. (ref. #122) To expose Tasks plugin's recurrence handling API makes sense for me, but I feel it also brings complicatedness. e.g., the case where tasks plugin wasn't installed / compatibility issue due to version differences between Reminder and Tasks plugin, ... Reminder plugins is already complicated because it supports 3~4 reminder formats and I have not designed it very carefully... If there are no big issue on this(#122) fix, I would like to keep it that way for now.

But if you want to work together strongly for future changes, I will do my best.

uphy avatar Nov 06 '22 12:11 uphy

Hi @uphy

Many thanks for working on this.

If there are no big issue on this(#122) fix, I would like to keep it that way for now.

Here are the current tests for recurrence within the Tasks plugin.

https://github.com/obsidian-tasks-group/obsidian-tasks/blob/5b0831c36a80c4cde2d64a6cd281bb4b51e9a142/tests/Task.test.ts#L404-L780

(And the documentation is at https://obsidian-tasks-group.github.io/obsidian-tasks/getting-started/recurring-tasks/ )

It would be interesting to convert those tests to run in the Reminders code, and see what proportion of them pass.

That would inform whether there is any value in making the Tasks code re-usable by Reminders.

Some examples that I cannot see implementations of in Reminders (apologies if I have missed them)

  • the when done feature
  • all the recent special-case code when the next occurrence falls on a non-existent date

To expose Tasks plugin's recurrence handling API makes sense for me, but I feel it also brings complicatedness. e.g., the case where tasks plugin wasn't installed / compatibility issue due to version differences between Reminder and Tasks plugin, ...

I'm sure it could be implemented in a way that you didn't have to worry about those things.

Reminder plugins is already complicated because it supports 3~4 reminder formats and I have not designed it very carefully...

That's interesting. I didn't look too closely, but I did notice quite a lot of repetition in the changes in this PR: https://github.com/uphy/obsidian-reminder/pull/125/files

Helping people improve the design of existing code is one my specialities. I would be happy to help on that.

But if you want to work together strongly for future changes, I will do my best.

At the moment, I think that there are several aspects of recurring tasks that may not be supported correctly by Reminders, and I would love to be able to point users of Tasks to Reminders, if the recurrence behaviour of the two plugins matched.

I recommend you don't replicate all the behaviour yourself, it's far too complicated.

It's totally up to you. I'm happy to offer help to Reminders, if you would like to improve that area...

claremacrae avatar Nov 06 '22 18:11 claremacrae