Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native reminder support #1854

Closed
2 tasks done
Erik-Handeland opened this issue Apr 9, 2023 · 10 comments · May be fixed by #1925
Closed
2 tasks done

Native reminder support #1854

Erik-Handeland opened this issue Apr 9, 2023 · 10 comments · May be fixed by #1925
Labels
scope: reminders Showing a reminder to do a task scope: task dates and times Requests for enhancements to types and formats of dates and times associated with tasks status: wontfix This will not be worked on type: enhancement New feature or request

Comments

@Erik-Handeland
Copy link

⚠️ Please check that this feature request hasn't been suggested before.

  • I searched previous Ideas in Discussions didn't find any similar feature requests.
  • I searched previous Issues didn't find any similar feature requests.

🔖 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.

@Erik-Handeland Erik-Handeland added the type: enhancement New feature or request label Apr 9, 2023
@claremacrae
Copy link
Collaborator

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

@claremacrae
Copy link
Collaborator

claremacrae commented Apr 10, 2023

@claremacrae
Copy link
Collaborator

  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 claremacrae added scope: task dates and times Requests for enhancements to types and formats of dates and times associated with tasks scope: reminders Showing a reminder to do a task labels Apr 10, 2023
@claremacrae
Copy link
Collaborator

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
Copy link
Author

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
Copy link

stevendkwtz commented Mar 14, 2024

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

  • Supports YYYY-MM-DD and YYYY-MM-DD hh:mm formats
  • Suggester autocomplete support
  • dataview and emoji style support
  • Integrates with reminder plugin (at least emoji style) so notifications (within the app) are scheduled as expected

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
Copy link
Collaborator

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:

  • There was an earlier, incomplete PR that may already have answered some of the following: feat: Add Reminders fields and Notifications  #1925
  • A significant concern - and area in need of thorough exploratory and automated testing - with this and similar implementations is how things like before and after in date searches interact with values that have times on - in ReminderDateField.ts - and whether this will give confusing results... as the entire search mechanism is built around times being at midnight...
  • 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....
  • With Reminder having been added to Recurrence, I think it should probably be added to the happens query, and to Task.happensDates()
  • There is also type HappensDate in Postponer.ts - how should Reminder interact with the Postpone facility - or vice versa?
  • The order of fields in Task lines needs review - I'm not sure where in the line Reminder should go, but Done date should definitely still be the last field on Task lines (which it looks like it might have done, from one of the tests)
  • The following code could be put behind a helper function somewhere, to avoid repetition and the risk of inconsistency....
task.reminderDate?.format(
                    isDateTime(task.reminderDate)
                        ? TaskRegularExpressions.dateTimeFormat
                        : TaskRegularExpressions.dateFormat,
                ),
  • withAllRepresentativeReminderDates() would benefit from having some values with times in too

@stevendkwtz
Copy link

stevendkwtz commented Mar 18, 2024

@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:

  • I actually I don't use this plugin's tasks query code block to search and render tasks
  • I wrote a JS class which adds a bunch of additional fields and functions on top the task struct, query and sorting helpers, etc.
  • I use obsidian-custom-js to load that class within a codeblock and query my tasks, and obsidian-react-components to render the queried tasks, so I can tweak and customize exactly how tasks are rendered.

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

@claremacrae claremacrae closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
@claremacrae claremacrae added the status: wontfix This will not be worked on label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: reminders Showing a reminder to do a task scope: task dates and times Requests for enhancements to types and formats of dates and times associated with tasks status: wontfix This will not be worked on type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants