-
-
Notifications
You must be signed in to change notification settings - Fork 220
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 executeToggleTaskDoneCommand to Tasks Api #2781
Conversation
Hi, thanks for doing this. I’m a bit confused by the checkboxes about documentation, but please do supply user documentation and tests for this. Many thanks. |
Added! |
I have really mixed feelings about this. On the one hand, it's nice to see the code being reused. On the other hand, there are ideas to rewrite the Tasks serializer code in the next few months, to make it more flexible... and exposing the current implementation means I will feel obliged to maintain support for the current code indefinitely. |
The thinking is to use ideas from this design: |
Totally fair. What if the serializer related API looked like this instead? /**
* Retrieves task details from a Tasks Emoji Formatted string
*
* @param line he markdown string of the task to be deserialized
* @returns {TaskDetails}
*/
deserializeEmojiTaskLine(line: string): TaskDetails;
/**
* Retrieves task details from a Dataview formatted string
*
* @param line he markdown string of the task to be deserialized
* @returns {TaskDetails}
*/
deserializeDataviewTaskLine(line: string): TaskDetails; This is all Kanban really needs, and would allow the implementation details to be under your control. |
I appreciate the suggestion.... I still won't be able to try this out for a few days, but from reading the code, here are a few more thoughts... By exposing That's because Also, the So the interactions between other plugins and any user's custom statuses in Tasks may well be a source of hidden bugs. So it all seems a bit confused to me. What is published and documented for users is (a lot of) the |
@mgmeyers, it would probably help to see how you are using this in the Kanban code... Is the code visible? |
It is! Here's where I extract task details from Kanban strings: I remove any empty values from the object, and then this data eventually gets passed to this component that renders the task details: https://github.com/mgmeyers/obsidian-kanban/blob/main/src/components/Item/DateAndTime.tsx#L175-L193 Here I first convert the key to an icon (e.g., dueDate -> 📅) then convert the value to a string if it isn't one already. |
Just discovered this and wanted to add this to the discussion: Looks like dataview is doing manual parsing of task emoji fields. |
FYI, I've paired this down to just exposing the |
Thank you. |
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.
Many thanks for your contribution. May we please ask for a couple of small changes to release this?
@ilandikov I've updated according to your suggestions. Let me know if you see any other issues. |
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.
Looks great. Could you please take a look at one line of documentation and I think we are good to go =)
Thanks @mgmeyers ! =) |
Also just released in Tasks 7.2.0 - many thanks! |
Description
This PR exposes the
toggleLine
function and the two task serializers through the API.Motivation and Context
In combination with #2778, these API updates give the Kanban plugin everything it needs to add nearly full support for the task plugin.
How has this been tested?
Tests have been run. The API functionality has been validated through the latest Kanban beta.
Screenshots (if appropriate)
Screen.Recording.2024-04-23.at.11.29.24.AM.mov
Types of changes
Changes visible to users:
fix
- non-breaking change which fixes an issue)feat
- non-breaking change which adds functionality)feat!!
orfix!!
- fix or feature that would cause existing functionality to not work as expected)docs
- improvements to any documentation content for users)vault
- improvements to the Tasks-Demo sample vault)contrib
- any improvements to documentation content for contributors - see Contributing to Tasks)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)chore
- examples include GitHub Actions, issue templates)Checklist
yarn run lint
.Terms