obsidian-kanban icon indicating copy to clipboard operation
obsidian-kanban copied to clipboard

[Bug]: Dataview cannot be rendered in Kanban

Open Missionary2112 opened this issue 2 years ago • 14 comments

Describe the bug

I use Dataview to display a list for files. I embedded a file with Dataview List in Kanban card and it would appear the list there. Just recently, the list appears blank.

  • The file with Dataview |40

  • Embedded file with Dataview show blank list |40

Expected Behavior

It should display embedded file with Dataview List

Steps to reproduce

Step 1: Create a new file with Dataview List Step 2: Embed the file in Kanban card Step 3: See error: The list is blank

Operating system

macOS

Missionary2112 avatar Jun 08 '22 21:06 Missionary2112

Duplicate of #345, #467, #85, #148, #321.

AB1908 avatar Jun 17 '22 23:06 AB1908

Oh yes, please address this soon. Kanban and Dataview working together is amazing!

Bug In my case, I also use Dataview Tables inside my Kanban cards. However, ever since I updated Dataview from 0.4.26 to 0.5.36, all my Dataview content inside the cards are empty. It does mention how many items are inside the table but not the actual content (birthdays, events, story characters, etc.)

The code I use for this example is

Table without ID
link(file.link, Aliases) AS "Name", Description
From #TC/Plot/CList/Character
Where Type = "storyChar"
Sort file.name

03

If I, however, revert Dataview back to 0.4.26, I get back my content.

Expected Behavior (with the additional number of how many items are there in the table) Dataview table can work inside Kanban board. IMG_20220625_221223

That's the status I'm currently in now. I hope they will work together again.

System Mobile user Android v12 Obsidian version 1,2,2 (56)

Yunike08 avatar Jun 25 '22 14:06 Yunike08

I have a hunch on what's happening here but not the technical expertise to pin down what/why. I hope mgmeyers can find the time to look at this. Dataview recently changed its rendering to be React based FWIW.

AB1908 avatar Jun 25 '22 18:06 AB1908

I have a hunch on what's happening here but not the technical expertise to pin down what/why. I hope mgmeyers can find the time to look at this. Dataview recently changed its rendering to be React based FWIW.

What is your hunch?

kometenstaub avatar Jul 29 '22 10:07 kometenstaub

@AB1908 (forgot to tag you above)

kometenstaub avatar Jul 29 '22 10:07 kometenstaub

I assumed it was related to the order of rendering. Dataview renders before the markdown post processor, at least IIRC, which is what may be interfering here. But if this always happened, the embeds should never have worked in the first place.

TL;DR: I have no clue

AB1908 avatar Jul 29 '22 11:07 AB1908

Bizarrely, it is working some of the time. If I put the Dataview code in a card and hit return, the code doesn't render (usually it just says "Loading" forever. But if I enter the field to edit it again, then close it using the X on the card (not Enter), it renders. Does this imply a solution?

salievi avatar Sep 10 '22 08:09 salievi

If I put the Dataview code in a card and hit return, the code doesn't render. But if I enter the field to edit it again, then close it using the X on the card (not Enter), it renders.

I experience exactly the same.

birgittealstrom avatar Oct 22 '22 23:10 birgittealstrom

Bizarrely, it is working some of the time. If I put the Dataview code in a card and hit return, the code doesn't render (usually it just says "Loading" forever. But if I enter the field to edit it again, then close it using the X on the card (not Enter), it renders. Does this imply a solution?

This is the same behavior I experience with this bug: #591

When I enable "Show relative date" in the settings, it seems to update all cards on the board and display properly sometimes.

Would be awesome if this was working

GarrettKaupp avatar Aug 16 '23 16:08 GarrettKaupp

So it seems part of the reason it will work sometimes and not others comes down to if the query is ready when the List formatter runs on the View for this file. Going to see about making a branch on my fork that waits for these to resolves as a first step towards #345. Which in turn would resolve this issue and act as a way to atleast let our swim lanes be populated via metadata. Ideally transitions would also allow for metadata updates in the future but that is out of scope of this issue.

shafferchance avatar Nov 24 '23 07:11 shafferchance

Alright, I'm back again, after some more digging found that the data is coming out of renderMarkdown as expected leaving the issue to React State as both technically use React (however this is more for dataviewjs). So we need a way to connect the two instances. Probably a lift upon a new child being added to the KanbanView by Dataview. If we're working with DQL the nice piece is that we can parse it after and push it into the dom returned therefore eliminating the two separate state issues.

shafferchance avatar Dec 02 '23 09:12 shafferchance

Upon disabling Mark from inside of the MarkdownRenderer component the dataviewjs query renders correctly.

image Will look into making these work together, hunch here is the cloneNodemethod is not quite working deeply and/or it disconnects the DataviewJsRenderer from its DOM nodes.

shafferchance avatar Dec 02 '23 09:12 shafferchance

Re-enabled mark but removed the cloneNode(true) and now things are working as expected.

@mgmeyers Why was a deepClone used here? Would either removing it entirely or creating a handler of a case with cards containing dataviews aren't clone be an acceptable solution?

shafferchance avatar Dec 02 '23 09:12 shafferchance

Ah while testing I think I found the purpose of the clone, looks like if I drag and drop a list all the cards content disappears until I refresh.

shafferchance avatar Dec 09 '23 09:12 shafferchance