Skip to content

Commit

Permalink
Migrated sorting from TaskAutomations to TaskSorting plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertheimer committed Mar 27, 2024
1 parent 381a21e commit f841a17
Show file tree
Hide file tree
Showing 29 changed files with 953 additions and 296 deletions.
8 changes: 8 additions & 0 deletions dwertheimer.TaskAutomations/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
## What's Changed in this Plugin?

NOTE: A COUPLE OF RELEASES AFTER 3.0.0 DELETE THE SETTINGS THAT PERTAIN TO TASKS

## [3.0.0] @dwertheimer 2024-03-26

- Migrate Task Sorting Commands to Task Sorter Plugin
- Rename this plugin from TaskAutomations - Overdue Task Processing

## [2.18.0] @dwertheimer 2023-12-??

- Changed commands from short command names to conform to new method
- Started saving most frequently used choices in prefs for future potential use in commandbar options sorting per user
- Refactored much of the overdue processing under the hood to make it more modular and testable for the future
- Bug fixes under the hood
Expand Down
123 changes: 48 additions & 75 deletions dwertheimer.TaskAutomations/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@
"noteplan.minAppVersion": "3.7",
"macOS.minVersion": "10.13.0",
"plugin.id": "dwertheimer.TaskAutomations",
"plugin.name": "✅ Task Automations",
"plugin.name": "Overdue Task Processing",
"plugin.description": "Automations for handling Tasks:\n- Overdue/Forgotten task scanning\n- Task sorting within a note\n- Copying #tags/@mentions from one task to another\n- Mark all tasks in note open/completed\n- Automatically opening URLs of task lines",
"plugin.author": "@dwertheimer",
"plugin.version": "2.18.0-notreleasedyet",
"plugin.lastUpdateInfo": "2.18.0: Overdue processing: stability/bugfixes.\n2.17.0: Overdue processing: added p1,p2,p3 options. Thx @george!",
"plugin.version": "3.0.0",
"plugin.lastUpdateInfo": "\n- Moved sorting to Task Sorting plugin.\n- Renamed this plugin Overdue Task Processing",
"DELETE_ME": "DON'T DELETE commandMigrationMessage or offerToDownloadPlugin until they are documented somewhere",
"commandMigrationMessage": "NOTE: Task Sorting commands have been moved from the Task Automations plugin to the Task Sorting plugin. This plugin has been renamed to 'Overdue Task Processing'.",
"offerToDownloadPlugin": {
"id": "dwertheimer.TaskSorting",
"minVersion": "1.0.0"
},
"settingsToCopy": [
"defaultSort1",
"defaultSort2",
"defaultSort3",
"outputOrder",
"sortInHeadings",
"tasksToTop",
"includeHeading",
"includeSubHeading",
"eliminateSpinsters",
"stopAtDoneHeading"
],
"plugin.dependencies": [],
"plugin.requiredFiles": [
"css.plugin.css",
Expand All @@ -18,83 +36,21 @@
"plugin.url": "https://github.com/NotePlan/plugins/blob/main/dwertheimer.TaskAutomations/readme.md",
"plugin.commands": [
{
"name": "Task Automations: Update Plugin Settings",
"description": "Preferences",
"jsFunction": "editSettings"
},
{
"name": "ts",
"description": "Tasks Sort - Sort tasks on the page",
"jsFunction": "sortTasks"
},
{
"name": "sth",
"description": "Sort tasks under heading (choose)",
"jsFunction": "sortTasksUnderHeading",
"alias": [
"tsh"
]
},
{
"name": "tsd",
"description": "Tasks Sort by User Default (in settings)",
"jsFunction": "sortTasksDefault"
},
{
"name": "tsc",
"description": "Tasks Sort by calendar due date",
"jsFunction": "sortTasksByDue"
},
{
"name": "tsm",
"description": "Tasks Sort by @Mention - Sort tasks on the page by mention/person",
"jsFunction": "sortTasksByPerson"
},
{
"name": "tst",
"description": "Tasks Sort by #Tag - Sort tasks on the page by hashtag",
"jsFunction": "sortTasksByTag"
},
{
"name": "tstm",
"description": "Tasks Sort by #Tag and then @Mention",
"jsFunction": "sortTasksTagMention"
},
{
"name": "tt",
"description": "Tasks to Top - Bring all tasks in note to top",
"jsFunction": "tasksToTop"
},
{
"name": "mat",
"description": "Mark All Tasks (choose open or complete)",
"jsFunction": "markTasks"
},
{
"name": "cta - Copy tags from previous line",
"description": "Copy #tags and @mentions from previous line",
"jsFunction": "copyTagsFromLineAbove"
"name": "TEST onUpdateOrInstall command - DELETEME",
"jsFunction": "testOnUpdateOrInstall",
"description": "Use xcallback to hit it",
"hidden": true
},
{
"name": "cth - Copy tags from heading above",
"description": "Copy #tags/@mentions from heading to all lines between",
"jsFunction": "copyTagsFromHeadingAbove"
},
{
"name": "ctm - Copy line for each mention",
"description": "Copy line for each @mention, listing it first",
"jsFunction": "copyLineForEachMention"
},
{
"name": "ctt - Copy line for each hashtag",
"description": "Copy line for each #hashtag, listing it first",
"jsFunction": "copyLineForEachHashtag"
"name": "Update Plugin Settings",
"description": "Preferences",
"jsFunction": "editSettings"
},
{
"name": "Task Sync",
"description": "Create synced copies of tasks containing a string in a new document",
"jsFunction": "taskSync",
"hidden": false,
"hidden": true,
"arguments": [
"search string",
"type of notes to search in (['calendar', 'notes'])",
Expand Down Expand Up @@ -178,6 +134,7 @@
"name": "Process Overdue Items in a Separate Window",
"description": "Mac-only - Uses HTML Popup/React",
"jsFunction": "processOverdueReact",
"hidden": true,
"alias": [
"react"
],
Expand All @@ -189,6 +146,7 @@
"name": "Process Overdue Items in a Specific Folder",
"description": "Uses HTML Popup/React",
"jsFunction": "processFolderReact",
"hidden": true,
"alias": [
"reactFolder"
],
Expand Down Expand Up @@ -269,6 +227,7 @@
"jsFunction": "openTasksToTop"
}
],
"SEP": "***********************************************************************************************",
"plugin.settings": [
{
"type": "hidden",
Expand Down Expand Up @@ -303,12 +262,16 @@
"default": "original task",
"required": true
},
{
"DELETE_ME_IN_FUTURE": "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv",
"DELETE_ME_IN_FUTURE2": "Task Sorter settings to be removed in a future release"
},
{
"type": "separator"
},
{
"type": "heading",
"title": "Task Sorting Default Settings"
"title": "Task Sorting Default Settings (these commands have been moved to the Task Sorting plugin. Settings remain here temporarily to migrate them if you auto-installed the new plugin)"
},
{
"key": "defaultSort1",
Expand Down Expand Up @@ -443,6 +406,10 @@
"default": false,
"required": true
},
{
"DELETE_ME_IN_FUTURE3": "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
"DELETE_ME_IN_FUTURE4": "Task Sorter settings to be removed in a future release"
},
{
"type": "separator"
},
Expand All @@ -457,7 +424,13 @@
"type": "[string]",
"default": 5,
"required": true,
"choices": ["0","1","3","5","10"]
"choices": [
"0",
"1",
"3",
"5",
"10"
]
},
{
"type": "hidden",
Expand Down
86 changes: 5 additions & 81 deletions dwertheimer.TaskAutomations/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Task Automations plugin
# Overdue Task Processing plugin
>
> Formerly known as "Task Automations"
## About

Expand All @@ -10,10 +12,6 @@ Automations for handling Tasks:

- Find and change overdue tasks (and change their status/reschedule them to a date in the future)
- Find (undated and potentially forgotten) tasks in a previous daily note or buried in a project note
- Sorting tasks (by various task fields or simply bringing tasks to the top of the note)
- Marking a task (or multiple) done and creating a follow-up/related task with a link to the done one
- Marking all tasks complete (or incomplete)
- Copying tags/mentions from previous lines when doing multiple task entry

## Overdue Tasks: Overview

Expand All @@ -28,12 +26,10 @@ If you remember to do that work every day and check those items, then bully for

### Command `/Review overdue tasks (by Task)`

Find all overdue tasks (tasks which have a >date of yesterday or earlier), and will ask you how you want to deal with that task. By default, the task will stay where it is but the new date you choose will be appended to it (so it will show up in that day's references). However, if you are on the desktop app, you also have the option of holding down the CMD key when you choose the new date/week, and the task in question will be moved to the daily or weekly note chosen.
Find all overdue tasks (tasks which have a >date of yesterday or earlier), and will ask you how you want to deal with that task. By default, the task will stay where it is but the new date you choose will be appended to it (so it will show up in that day's references). However, if you are on the desktop app, you also have the option of holding down the CMD key when you choose the new date/week, and the task in question will be moved to the daily or weekly note chosen.

>**NOTE**: If you want to edit a task and also reschedule it, hold down the OPT key (on Mac only) when making your selection (e.g. edit or set a new date) and the task will be updated per your choice and you will then get another pop-up to take further action (e.g. edit task or convert to another type or whatever)
> X-Callback link to call this command: `noteplan://x-callback-url/runPlugin?pluginID=dwertheimer.TaskAutomations&command=Review%20overdue%20tasks%20%28by%20Task%29`
>**NOTE**: This and the following command both will scan daily notes and also weekly notes for tasks that are overdue. Monthly, Quarterly, and Yearly notes are not currently processed.
### Command `/Review Overdue Tasks as of <Date>`
Expand All @@ -54,7 +50,7 @@ In this version, you will be prompted for a folder in which to search for overdu

Review tasks either on this week's note or tagged for this week

## Reviewing Overdue Tasks in a Separate Window
## Reviewing Overdue Tasks in a Separate Window (not currently enabled)

You can also review tasks in a separate popup window using the command:
`/Process Overdue Items in Separate Window`
Expand Down Expand Up @@ -102,84 +98,12 @@ Select a task or tasks and this command will mark it/them done/complete and crea

### Command `/Mark done and create follow-up in future note`

## Sorting Tasks

### /ts - Tasks Sort (Interactively choose sort order and headings style)

This plugin will sort your tasks in the open note in the Editor interactively so you can choose how you want it to work and output

When you run /ts, it will sort the tasks into task types (open|scheduled|completed|cancelled), and it will ask you how you want to sort within those categories and whether you want the output to have the category type headings or not, e.g.:

```text
#### Open Tasks
- [ ] Open Task
#### Scheduled Tasks
- [>] Forwarded/Scheduled Task >2030-01-01
#### Completed Tasks
- [x] Completed Task
#### Cancelled Tasks
- [-] Cancelled task
```

### /tst - Tasks Sort by Tag

Sort the Tasks in the open note by (the first) #Tag and display with subheadings for each unique tag
[If you want more granular control over whether there are or aren't headings, use /ts]

### /tsc - Tasks Sort by Due Date

Sort the Tasks by Due Date and then Priority
[If you want more granular control over whether there are or aren't headings, use /ts]

### /tstm - Tasks Sort by Tag/Mention

Sort the Tasks in the open note by (the first) #tag (and then by @Mention)
[If you want more granular control over whether there are or aren't headings, use /ts]

### /tsm - Tasks Sort by Mention/Person

Sort the Tasks in the open note by (the first) @Mention and display with subheadings for each unique @mention
[If you want more granular control over whether there are or aren't headings, use /ts]

### /tsd - Task Sort By Default

Sort tasks in note by user setting primary/secondary sort fields
Set the primary and secondary sort order for this default search in plugin preferences

### /tt - Tasks to Top

This command brings all the tasks inside of the currently open note to the top of the note. You can choose whether you want headings (e.g. "Open Tasks", "Sheduled Tasks" etc.) or whether you want just the sorted tasks brought to the top. Note: brings only task lines (not indented underneath)

## Task Sorting Notes

- At this time, the plugin will ignore headings that are attached to the tasks (e.g. tasks indented under root-level #headings). I need to understand/think more about this use case and how to deal with it in sorting.
- Lines are sorted line-by-line. Currently, no provision is made for indented text/content underneath tasks or tasks that are indented themselves under other content. If this is your use case and you can describe how you think it should work very clearly, please contact @dwertheimer on Discord and help me understand this usage.

## Marking All Tasks

### /mat - Mark All Tasks (as completed or open)

This plugin will give you a choice of whether to mark all open tasks as completed or all completed tasks as open.

## Copying Tags/Mentions

### /cta - Copy **all** #tags and @mentions from the previous line

### /cth - Copy **all** #tags and @mentions from the heading the task sits under

### /ctm - Duplicate line for each @mention but change the order so each mention shows up first on its own line (and therefore will be sorted under that @mention heading when using /ts - task sorter)

### /ctt - Duplicate line for each @tag but change the order so each tag shows up first on its own line (and therefore will be sorted under that @mention heading when using /ts - task sorter)

## Plugin Settings

The plugin has a variety of settings you can access through the plugin settings panel in NotePlan Preferences

## Future Features / Todo List

- Sort tasks via template call
- Sort by task due date
- Bring open tasks to top
- (optionally) Leave tasks with dates in place until they are overdue? [use getOverdueTasks()]

## Acknowledgements
Expand Down
Loading

0 comments on commit f841a17

Please sign in to comment.