-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
feat: Add Reminder Field Support #2750
base: main
Are you sure you want to change the base?
Conversation
It was only testing due date and no other date fields, so wasn't the best place to add a test for any new date fields.
src/Renderer/TaskLineRenderer.ts
Outdated
@@ -13,7 +13,7 @@ import { StatusMenu } from '../ui/Menus/StatusMenu'; | |||
import { TaskFieldRenderer } from './TaskFieldRenderer'; | |||
|
|||
/** | |||
* The function used to render a Markdown task line into an existing HTML element | |||
* The function used to render a Markdown task line into an existing HTML element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 if you're wondering where this came from. git rebase --continue wouldn't work during an ongoing massive rebase because it kept saying no file changed. so I had to make a small edit to get it to continue.
src/ui/EditTask.svelte
Outdated
<!-- --------------------------------------------------------------------------- --> | ||
<!-- Reminder Date --> | ||
<!-- --------------------------------------------------------------------------- --> | ||
<label for="reminder" class="accesskey-first">Reminder</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little tricky...
The class accesskey-first
says 'mark the first letter as the shortcut'..
However, as all the letters in Reminder are already used as shortcuts, the key c
is chosen...
Which leaves two questions:
- How do we convey to users that
c
is the access key? - How do we ensure that we do not mark the wrong character...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is now a pattern for doing this on main, for the Done and Created fields IIRC.
@@ -83,6 +86,10 @@ function summarizeTaskDetails(t: TaskDetails | null): SummarizedTaskDetails | nu | |||
scheduledDate: t.scheduledDate?.format(TaskRegularExpressions.dateFormat) ?? null, | |||
dueDate: t.dueDate?.format(TaskRegularExpressions.dateFormat) ?? null, | |||
doneDate: t.doneDate?.format(TaskRegularExpressions.dateFormat) ?? null, | |||
reminderDate: | |||
t.reminderDate?.format( | |||
isDateTime(t.reminderDate) ? TaskRegularExpressions.dateTimeFormat : TaskRegularExpressions.dateFormat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern of isDateTime() ? ... : ...
is going to grow and grow....
we could save our time by introducing a helper function that does the check and the formatting...
src/ui/EditTask.svelte
Outdated
@@ -393,7 +406,7 @@ | |||
Availability of access keys: | |||
- A: Start | |||
- B: Before this | |||
- C: | |||
- C: Reminder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am about to use C
on main
for Created Date
, so this will need to be changed...
tests/Suggestor/Suggestor.test.ts
Outdated
it('offers specific due date completions', () => { | ||
// Arrange | ||
const originalSettings = getSettings(); | ||
const line = `- [ ] some task ${dueDateSymbol} to`; | ||
const line = `- [ ] some task ${reminderDateSymbol} to`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an accidental edit.
@@ -247,6 +251,11 @@ export class TaskBuilder { | |||
return this; | |||
} | |||
|
|||
public reminderDate(reminderDate: string | null): TaskBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to do parseDateTime()
And remove a change that was not relevant to parsing lines beginning with a hyphen..
… docs The docs will be updated automatically later on, closer to merge.
…support. Added failing test.
…sing and reminder date time parsing.
I'm such a n00b but I have no idea how to start a conversation on my latest pushed commit to my forked reminders branch. Here is what we've done today There are likely a lot of follow ups on your mind @claremacrae, for me I want to note some down so I don't lose track. Remind @ilandikov about my ApprovalsJS PRPriority: High TasksDate - refactor class formatter instance method logic into Moment formatting utils filePriority: High My opinion:
stronger string formatting
chrono - remove dependency from projectPriority: Low
Consider remotely configurable feature flags in this projectPriority: Low, out of scope |
Thanks - good guess, but when I speak with @isidore later - Llewellyn Falco - I'll remind him about that PR... :-) |
… DateTools for reminder parsing
In the Edit Task modal
Description
This teaches Tasks to read and write a Reminder field, which is expected to be compatible with the Reminders plugin.
Problems found in exploratory testing
EditTask modal
C
Recurrence
Search filters
happens 2024-04-05
does not match this task- [ ] #task reminder ⏰ 2024-04-05
tests/Query/Filter/HappensDateField.test.ts
Task.happensDates
Postpone mechanism
Questions from a comment elsewhere to be resolved:
Things I've noted from reading through the code, if/when this is picked up:
before
andafter
in date searches interact with values that have times on - inReminderDateField.ts
- and whether this will give confusing results... as the entire search mechanism is built around times being at midnight...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....Reminder
having been added toRecurrence
, I think it should probably be added to thehappens
query, and toTask.happensDates()
HappensDate
inPostponer.ts
- how shouldReminder
interact with the Postpone facility - or vice versa?withAllRepresentativeReminderDates()
would benefit from having some values with times in too@stevendkwtz notes from our pairing sessions
https://gist.github.com/stevendkwtz/9b2758642f151219b8a3f3753eee9e9d
Motivation and Context
Related PRs:
How has this been tested?
Screenshots (if appropriate)
Types of changes
Changes visible to users:
feat
- non-breaking change which adds functionality)docs
- improvements to any documentation content for users)vault
- improvements to the Tasks-Demo sample vault)Internal changes:
test
- additions and improvements to unit tests and the smoke tests)Checklist
yarn run lint
.Terms