You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/Code/How do I add a new field to the Task class.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,19 @@ For example, It's fine to have a first release of a feature without `sort by` an
17
17
18
18
### Store the field
19
19
20
-
- Add the field to [src/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task.ts)
20
+
- Add the field to [src/Task/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task/Task.ts)
21
21
22
22
### Read and write the field
23
23
24
24
- Update all supported formats in [src/TaskSerializer/](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/src/TaskSerializer)
25
25
26
26
### Detect edits to field value
27
27
28
-
- In [tests/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task.test.ts):
28
+
- In [tests/Task/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task/Task.test.ts):
29
29
- Add a new failing block to the `'identicalTo'` section.
30
30
- Here is an existing example: ['should check path'](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/5b0831c36a80c4cde2d64a6cd281bb4b51e9a142/tests/Task.test.ts#L834-L840).
31
-
- In [src/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task.ts), update `Task.identicalTo()`:
32
-
- Once you have a failing test in [tests/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task.test.ts), implement the check for changed value of your new field in `Task.identicalTo()`.
31
+
- In [src/Task/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task/Task.ts), update `Task.identicalTo()`:
32
+
- Once you have a failing test in [tests/Task/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task/Task.test.ts), implement the check for changed value of your new field in `Task.identicalTo()`.
33
33
- This important method is used to detect whether any edits of any kind have been made to a task, to detect whether task block results need to be updated.
34
34
- Here is the code for the method as of 2022-11-12:
35
35
-[Task.identicalTo() in 5b0831c36a80c4cde2d64a6cd281bb4b51e9a142](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/5b0831c36a80c4cde2d64a6cd281bb4b51e9a142/src/Task.ts#L732-L802)
@@ -70,4 +70,4 @@ Can be added in later releases
70
70
- Update `dates.md`
71
71
- Handling invalid dates
72
72
- Add the new field to all sections of [resources/sample_vaults/Tasks-Demo/Manual Testing/Invalid Dates.md](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/resources/sample_vaults/Tasks-Demo/Manual%20Testing/Invalid%20Dates.md)
73
-
- Update the query in the 'invalid dates' section of [docs/queries/filters.md](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/docs/queries/filters.md)
73
+
- Update the query in the 'invalid dates' section of [docs/Queries/Filters.md](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/docs/Queries/Filters.md)
Copy file name to clipboardExpand all lines: contributing/Code/How do I add a new task filter.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ For help on writing and running the tests, see [[About Testing]]
27
27
- Add to [tests/Query/Filter](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/tests/Query/Filter) a new test file.
28
28
- This should focus on testing whether or not individual Task objects, with carefully selected sample date, match the filter.
29
29
- Think about edge cases.
30
-
- Add the new instruction(s) to 'Query parsing' test in [tests/Query.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Query.test.ts)
30
+
- Add the new instruction(s) to 'Query parsing' test in [tests/Query/Query.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Query/Query.test.ts)
31
31
- This verifies that the new filter instruction has been correctly wired in to the Query class.
| 1 | using the **command** (may be bound to a hotkey). |[src/Commands/ToggleDone.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Commands/ToggleDone.ts)| toggles the line directly where the cursor is in the file inside Obsidian's vault. |
8
-
| 2 | clicking on a checkbox of an **inline task** in **Live Preview**. |[src/LivePreviewExtension.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/LivePreviewExtension.ts)| toggles the line directly where the checkbox is on the "document" of CodeMirror (the library that Obsidian uses to show text on screen).<br>That, in turn, updates the file in Obsidian's Vault. |
9
-
| 3 | clicking on a checkbox of an **inline task** in **Reading mode**. | uses a checkbox created by `renderTaskLine()` in [src/TaskLineRenderer](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/TaskLineRenderer.ts).<br>There, the checkbox gets a click event handler. | The click event listener of 3. and 4. uses `replaceTaskWithTasks()` in [src/File.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/File.ts).<br>That, in turn, updates the file in Obsidian‘s Vault (like 1, but it needs to find the correct line). |
8
+
| 2 | clicking on a checkbox of an **inline task** in **Live Preview**. |[src/Obsidian/LivePreviewExtension.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Obsidian/LivePreviewExtension.ts)| toggles the line directly where the checkbox is on the "document" of CodeMirror (the library that Obsidian uses to show text on screen).<br>That, in turn, updates the file in Obsidian's Vault. |
9
+
| 3 | clicking on a checkbox of an **inline task** in **Reading mode**. | uses a checkbox created by `renderTaskLine()` in [src/Renderer/TaskLineRenderer](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Renderer/TaskLineRenderer.ts).<br>There, the checkbox gets a click event handler. | The click event listener of 3. and 4. uses `replaceTaskWithTasks()` in [src/Obsidian/File.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Obsidian/File.ts).<br>That, in turn, updates the file in Obsidian‘s Vault (like 1, but it needs to find the correct line). |
10
10
| 4 | clicking on a checkbox in **query results** (same for **Reading mode** and **Live Preview**). | As 3 | As 3 |
11
11
| 5 | via 'Create or edit task' **modal** Status dropdown |[src/ui/EditTask.svelte](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/ui/EditTask.svelte) and [src/Commands/CreateOrEdit.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Commands/CreateOrEdit.ts)| Not yet implemented: see [#1590](https://github.com/obsidian-tasks-group/obsidian-tasks/issues/1590)|
0 commit comments