Closed DudeThatsErin closed 1 month ago
Thank you.
Can the steps to reproduce be shortened: why does BRAT need to be installed?
When I originally opened this (I just copied and pasted everything to this report) Obsidian Kanban hadn't released full capability for Tasks in the official release.
I haven't had time recently to check to see if it is in the official release yet.
It is in the official release. I am working on a simpler and more precise reproduction - so there's no need to update...
Here is a reproduction without redundant steps, and that does not require knowledge of the Kanban plugin:
Expected result: A due date emoji is added to the card
Actual result: The following error message is displayed:
I have Obsidian Tasks v7.4.0 and Kanban v2.0.51 and whenever I am creating a new card and the tasks pane pops up above the editor (I'll have another bug report on that one as it is always staying up)
I don't exactly understand, but to help inform where you would log that: whether or not the Tasks menu shows inside the Kanban UI is totally controlled by Kanban source code, not Tasks.
Workaround noted in https://github.com/mgmeyers/obsidian-kanban/issues/985:
@mgmeyers noted in https://github.com/mgmeyers/obsidian-kanban/issues/985#issuecomment-2161644701:
@claremacrae It seems the issue here comes from these lines:
The assumption here is that
markdownFileInfo
is an instance ofMarkdownView
which is not the case when editing a Kanban card (which is aKanbanView
).
@mgmeyers - there are two options here:
id
and depends on
fields in the Auto Suggest menu.1 is better for users, and is less complexity in the Tasks code.
Can you see a way of adding/enabling 1 to the mechanism you created in #2778 please?
- If edits cannot be saved, then make Tasks not include id and depends on fields in the Auto Suggest menu.
See the uses of globalThis.SHOW_DEPENDENCY_SUGGESTIONS
for where to change...
My comment from https://github.com/mgmeyers/obsidian-kanban/issues/985#issuecomment-2161673813:
I can probably make it so that Tasks doesn’t offer Dependency suggestions if the edits cannot be saved. Which will remove the requirement to be able to save the file.
Hi Clare. I took a look at what could be done on my end. Unfortunately things are a bit complicated. I can provide a save
function with kanban's version of markdownFileInfo
. The only issue is that edits to cards are temporary, i.e. they aren't saved to the view's state or the disk until the user commits them by pressing enter. This allows users to cancel edits.
How does the forced save support dependency suggestions? Maybe there's another approach I could take on my end to support this.
Hi Matthew. Thanks very much for looking in to this.
I should give some more background info...
Prior to Tasks 7.4.0, Auto-Suggest only ever modified the line being edited, and nothing else in the vault.
However, 7.4.0 added this specific feature - copied from the docs:
It was really irritating for users to have to:
🆔 id
to a task⛔ depends on id
to the task that depended on the first task....The above screenshotted facility allows this to be done in one step.
Getting it to work reliably required me to ensure that Tasks saved the new id
value, and updated its cache of tasks, before trying to adding the depends on
value. See https://github.com/obsidian-tasks-group/obsidian-tasks/pull/2876.
And the code for that is exactly the code that is causing the error message in Kanban now, as my saving assumed use of MarkdownView
.
The only issue is that edits to cards are temporary, i.e. they aren't saved to the view's state or the disk until the user commits them by pressing enter. This allows users to cancel edits.
That is a really helpful thing to know.
In that case, I really think the best compromise for now is for me to make Tasks not offer Dependency suggestions if the editor is not a MarkdownView
.
The fix for this is now released, in Tasks 7.5.0.
Please check that this issue hasn't been reported before.
Expected Behavior
No error should appear.
Current behaviour
I have Obsidian Tasks v7.4.0 and Kanban v2.0.51 and whenever I am creating a new card and the tasks pane pops up above the editor (I'll have another bug report on that one as it is always staying up) and I go to add anything like a due date or start date or whatever, it gives this error.
Debug Info:
Steps to reproduce
Note from maintainer: See https://github.com/obsidian-tasks-group/obsidian-tasks/issues/2896#issuecomment-2178988383 below for a reproduction without redundant steps, and that does not require knowledge of the Kanban plugin.
Which Operating Systems are you using?
Obsidian Version
1.6.3
Tasks Plugin Version
7.4.0
Checks
Possible solution
Copying over from Obsidian Kanban as you requested!