obsidian-tasks-group / obsidian-tasks

Task management for the Obsidian knowledge base.
https://publish.obsidian.md/tasks/
MIT License
2.37k stars 224 forks source link

Native reminder support #1854

Closed Erik-Handeland closed 3 months ago

Erik-Handeland commented 1 year ago

โš ๏ธ Please check that this feature request hasn't been suggested before.

๐Ÿ”– Feature description

There is user demand for notifications based on task dates see #432. However this requires the use of another obsidian plugin which was not designed to be used with tasks first, instead adding support later in development.

โœ”๏ธ Solution

Create a native implementation of reminders build into the tasks plugin. See my current ideas for it under Additional Context.

โ“ Alternatives

Do nothing, and use the currently existing reminder plugin

๐Ÿ“ Additional Context

Setting Reminder Date

How to set the reminder date:

  1. create a new date field called reminder:
    • Con: starts to bloat the modal UI with two many dates
    • Pro: probably the easiest to implement
  2. Convert and existing one to reminders name and all
    • scheduled -> reminders (personally never found this one useful)
      • regardless should maybe add a setting to hide unused element in modal. Or add page on publish for CSS snippets
    • Con: could mess with existing work flows if converting
  3. Treat and existing field due, startโ€ฆ as the reminder date via a selector in settings or a toggle next to the date โฒ๏ธ
    • Pro: could enable multiple reminders, one on Start and another on Due
    • Pro: could set this on by default via a global setting, low friction for user
    • Con: Could complicated existing tests and would require a new data fields to be added of type bool: isRemind

While option one is probably the easiest I think three is the most interesting to implement while also offering the most expandability with multiple reminders and a minimally clutter UI. I do believe a PR should be created to hide elements from the modal see #1853.

claremacrae commented 1 year ago

Thanks very much indeed for picking this up @Erik-Handeland.

claremacrae commented 1 year ago

Earlier references and requests:

claremacrae commented 1 year ago
  1. Create a new date field called reminder

Yes, this needs to be the approach.

In case you haven't seen it, this page will be very useful when adding the field :

In the interests of keeping the steps manageable, perhaps the first version could not support reminder times, and could instead have a setting the user says what times of day they would like that day's reminders.

claremacrae commented 1 year ago

Tasks is in the fortunate position of PRs coming in very often now, and long-lived PRs have a high chance of conflicting with main by the time they are merged.

For example, there are incoming PRs to add support for dataview format, and a new SQL-based search engine. Both of which would overlap with a PR adding a new field.

And the larger a PR is, the longer it takes me to review, and again the more potentially conflicting other edits come in.

Therefore, ideally, it would really help for this feature to be done in small chunks, for example adding the storage and editing of reminders in one PR and the actual Reminder modal in a different one - at each stage, providing enough documentation and tests that Tasks could be released as soon as the PR is merged.

Erik-Handeland commented 1 year ago

Indeed, having too many PRs is a nice problem to have. I had some time to look at the existing reminders plugin and the key functions for notifications seems fairly straight forward (famous last words). I've also taken a look at the two mentions pending PRs and will keep them in mind, hopefully they can be merged in here soon. Love to see all this momentum

stevendkwtz commented 6 months ago

FYI I forked this repo and built this myself. I'd like to properly contribute to this project by making a PR, writing the tests, etc, but have very little bandwidth at the moment. I would really welcome anyone that wants to help get this over the very final lap.

Obligatory use at your own risk if you really want to

The branch with Reminder support is here: https://github.com/stevendkwtz/obsidian-tasks/tree/develop

You can clone my fork, yarn run build:dev, then copy over the main.js, manifest.json, and styles.css files to your $VAULT_DIR/.obsidian/plugins/obsidian-tasks-plugin folder. If you don't know what this means or how to do it, probably better to wait for official support from this repo :)

NOTE that branch contains other changes I've made to this repo, including an API to toggle tasks. Would need to be decoupled from the reminder changeset to be properly merged into this repo.

claremacrae commented 6 months ago

Hi @stevendkwtz

FYI I forked this repo and built this myself. I'd like to properly contribute to this project by making a PR, writing the tests, etc, but have very little bandwidth at the moment. I would really welcome anyone that wants to help get this over the very final lap.

Thanks very much for this.

Things I've noted from reading through the code, if/when this is picked up:

task.reminderDate?.format(
                    isDateTime(task.reminderDate)
                        ? TaskRegularExpressions.dateTimeFormat
                        : TaskRegularExpressions.dateFormat,
                ),
stevendkwtz commented 6 months ago

@claremacrae

There was an earlier, incomplete PR that may already have answered some of the following: #1925

๐Ÿ˜ฎ I have not seen this before commenting on this issue even though its linked above.

With Reminder having been added to Recurrence, I think it should probably be added to the happens query, and to Task.happensDates()

I was wondering myself whether it made sense for Reminders to be added to happens or not. I added it to recurrence because I assumed that if a user adds a reminder to a recurring task, they'd normally like to be reminded about that task at each recurrence.

There is also type HappensDate in Postponer.ts - how should Reminder interact with the Postpone facility - or vice versa?

Not sure myself ๐Ÿ˜…. TBH I would defer to you / the other plugin owners and maintainers, any user feedback you may have collected about this, or copy whatever Todoist may do.

In Recurrence.ts, what was the thinking behind putting Reminder before Scheduled and Start in the priority order? This would be quite a significant change that would need clear documentation....

No thinking at all and not purposeful, I just hacked this together quick and dirty and can update this. I use this plugin differently than probably every other user, so I built reminders for my use case first, and haven't properly tested or given much thought to most of the other functionality. What I mean by that is:

Example Source:

jsx codeblock

Becomes:

rendered tasks

My personal end goal workflow is tasks+reminder support+global notification support (using ntfy since obsidian doesn't have notifications?!)

Let me know what you think some next steps are here, and where the best channel to continue the conversation is as well.

claremacrae commented 5 months ago

Hi @stevendkwtz, wow, thanks for a really interesting reply.

Let me know what you think some next steps are here, and where the best channel to continue the conversation is as well.

Definitely a video call to explore how to move forwards... It's way higher bandwidth than to-and-fro here...

My email is in my GitHub profile.... Hope to hear from you...

claremacrae commented 3 months ago

We will add support for a Reminder field.

But we are not going to implementation a Reminder mechanism in Tasks - that is best done by other plugins or tools.

Background: This request falls within a set of areas that we have decided not to support in Tasks.

Closing as wontfix.