feat: Task Line Modal with given description#3389
feat: Task Line Modal with given description#3389Nizbel92 wants to merge 1 commit intoobsidian-tasks-group:mainfrom
Conversation
|
|
Hi, thank you for offering a contribution to Tasks. My first thought is that this looks it behaves the same as if the user ran the existing Tasks-plugin-provided command to open the Edit Task Modal, which loads the current markdown line in to the Description field (as well as handling any fields on the line). So what is the advantage of this new mechanism please? What am I missing? |
Hi! I guess you're describing a case where the user opens a modal on an existing task or by command from command palette. My idea is the same - I, as a user, want to open a modal with the text selected in the Editor as the description in the modal. But main point is that this feature don't work with the method createTaskLineModal from API, and I can't use this feature in compex action like QuickAdd Capture For example, I have a note with random thoughts as a list or just raw text, click a button (which currently refers to the QuickAdd command), and see the modal with the selected text or the text under the current line as the description in the modal. Thanks! |
|
Thanks for the reply. I didn't explain the question very well, but I can see that what you have done is useful in more situations than the current command. |
|
Transparency note from @claremacrae: I've edited the original description to reinstate the text that was deleted from the new PR template, as best as I can... |
There isn't an existing issue feature request that matches this functionality. The closest match for this request is: But that would need to do more work, because it would need to parse any existing signifiers from the input string. This would need to take care of whether the user's selected format is Tasks Emojis or Dataview format, for example. |
|
I have been giving this a lot of thought. It was kind of you to offer this pull request - thank you. What's neededHowever, the functionality that has been requested by users (in #1945) is considerably more complex than the code in this pull request, because of the need to handle parsing of Emoji or Dataview signifiers from the input line. Additionally, new tests would be required, in addition to the existing API unit tests. And careful documentation is needed too.
My feeling is that it's not reasonable to ask someone new to Typescript to try and implement #1945 to the standard that would be needed to merge a pull request - and I'm afraid I don't have enough spare time to support anyone through learning to do that anymore. Getting helpDo you know anyone with Typescript experience who you could ask to help you with this? |
|
In the meantime I'm setting this to Draft, as it doesn't have tests and user documentation, so isn't suitable for merging. |
I am sorry that I didn't have time to help review and refine this to make it releasable. Someone else is now looking at enabling the editing of existing task lines via the API, so I will close this. |



Types of changes
Changes visible to users:
feat- non-breaking change which adds functionality)docs- improvements to any documentation content for users)Internal changes:
test- additions and improvements to unit tests and the smoke tests)Description
I'm not very familiar with JavaScript and GitHub, so I would appreciate any corrections and advice to ensure my pull request is acceptable. Thank you!
Writing task descriptions repeatedly can be exhausting. To simplify this process, I've added a new function, createTaskLineModalFromString, to the API. This function is similar to createTaskLineModal but allows the description to be passed as an argument. When called, it opens the same modal window but with the description field already filled in.
Please review my changes and provide any feedback or suggestions for improvement.
Motivation and Context
How has this been tested?
I have tested this new function using QuickAdd Capture with the following format:
Screenshots (if appropriate)
Checklist
yarn run lint.Terms