generated from obsidianmd/obsidian-sample-plugin
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 custom grouping, with 'group by function' option #2028
Merged
claremacrae
merged 129 commits into
obsidian-tasks-group:main
from
claremacrae:add-group-by-function
Jun 11, 2023
Merged
feat: Add custom grouping, with 'group by function' option #2028
claremacrae
merged 129 commits into
obsidian-tasks-group:main
from
claremacrae:add-group-by-function
Jun 11, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Total credit for this goes to Jules Omlor. I just updated it to work with the current Tasks code, and added initial tests. Co-Authored-By: Jules Omlor <jules@haunted.host>
This will mean there is a lot less to document. And I will gradually expose Task facilities, and document them as they become stable.
In preparation for machine-generating documentation.
And add some TODOs
It's easier to not do that, and allow users to do it optionally, than to do it on all fields and find that things like tags with underscores in are broken.
… is not releasable ... as it cannot return a string value, due to name-clash with existing recurrence field in Task.
I think it will be more useful for task.priority to refer to the name. Currently, it gives the number. Needs more thought.
…pertyExamples.test.ts
…ropertyExamples.test.ts
…s to TaskPropertyExamples.test.ts
…pertyExamples.test.ts
…rtyExamples.test.ts
…yExamples.test.ts
…yExamples.test.ts
For recent changes in test file names.
claremacrae
changed the title
feat: Add custom grouping, with 'group by function' code
feat: Add custom grouping, with 'group by function' option
Jun 10, 2023
claremacrae
added
the
scope: scripting
Issues to do with custom filters, custom sorting and similar
label
Jul 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
scope: grouping
Changes to the grouping capabilities
scope: scripting
Issues to do with custom filters, custom sorting and similar
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A powerful, flexible mechanism to give users a lot of control over custom grouping rules.
Credit: This work was only made possible by @hauntedhost, who kindly taught me how to evaluate user-supplied functions in TypeScript.
Examples (taken from the docs)
?
) and|| ""
are needed because the due date value may be null.New Features
group by function
feature, for custom grouping by many of the properties of taskstask.description
task.status.symbol
task.status.nextStatusSymbol
custom-formatting of date headings
, when grouping by date fieldsgroup by due
docs for examplesNew Documentation
Scripting
Enabling changes
Task
whose names match the corresponding query instructions:created
done
due
scheduled
start
happens
(and alsohappensDates
)recurring
(for future use)TODO
Not all fields are exposed yet, as some will require refactoring to avoid them in a way that is consistent with the current filter instructions.
Notable omissions:
task.priority
task.file.path
task.file.fileName
task.file.root
task.file.folder
task.heading
Motivation and Context
There have been quite a few requests for variations on existing grouping options. This enables many of those to be done in one single step.
How has this been tested?
group by function
instructions ever break, we will know.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:
refactor
- non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)test
- additions and improvements to unit tests and the smoke tests)Checklist
yarn run lint
.Terms