Skip to content
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

Add support for mind maps #2

Merged
merged 2 commits into from Sep 23, 2023
Merged

Add support for mind maps #2

merged 2 commits into from Sep 23, 2023

Conversation

vedran
Copy link
Contributor

@vedran vedran commented Jun 17, 2023

Hi Yash! I was chatting w/Robert Johnson about the new experimental Mind Map Web SDK in Miro. I figured I could quickly add mind map support into Cardsy rather than building a new app. This PR adds mind map nodes to the list of item types considered for conversion, and then modifies generateCardObjectFor to handle the mindmap item schema, detailed here: https://developers.miro.com/docs/mindmap_mindmapnode .

I'm just waiting on Miro to fix a bug where getSelection() doesn't return mind map child nodes, and once they fix that, this should be good. Here's a video of what I mean:

https://www.loom.com/share/a973e2a62de744de9aeb285bfbd3efc5

@netlify
Copy link

netlify bot commented Jun 17, 2023

Deploy Preview for cardsy-yashbhalodi ready!

Name Link
🔨 Latest commit ac6673e
🔍 Latest deploy log https://app.netlify.com/sites/cardsy-yashbhalodi/deploys/64f9595009e16c0008860b20
😎 Deploy Preview https://deploy-preview-2--cardsy-yashbhalodi.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@YashBhalodi
Copy link
Owner

Hi @vedran!

Thanks for showing interest in Cardsy and contributing.

Regarding the bug you mention, I don't think Miro will consider it as a bug.
Mindmap exists and builds on top of the root node, and without root's existence, the child node's existence become vague.

Basically, what I am saying is that Miro probably wants us to refer to a mindmap node by its root node only, so waiting for Miro to fix that bug doesn't seem like a good idea.

Here is what we can do though.

A) use .getChildren

somehow use the .getChildren method of mindmap root node and get list of all the children of the mindmap and generate cards for them all. You can refer to this.

I tried the above method for a bit, but seems like I am missing something and I don't have bandwidth currently to dig deeper into that. So here is an alternative.

B) manual traversal of mindmap nodes

Let's make a rule that to generate cards from mindmap, user will have to select the root node.
We can get the root node's children from it's children properties recursively and then use board.getById() and generate cards for all this children.

@YashBhalodi YashBhalodi added the enhancement New feature or request label Jun 17, 2023
@vedran
Copy link
Contributor Author

vedran commented Sep 7, 2023

Hi @YashBhalodi . Miro has fixed the bug in the experimental SDK that we also have access to. I've updated the PR with a commit that uses that to access the mind map nodes. Here's a demo: https://www.loom.com/share/d203936980494c71983f52e03681c9f4

What do you think?

@vedran vedran marked this pull request as ready for review September 7, 2023 05:28
@YashBhalodi
Copy link
Owner

Provisionally adds functionality for #1.
This is using MIRO's experimental API and MIRO does not recommend pushing this to production since their output and behavior may or may not change.

However, as the chances of that happening are bit too low in my opinion, I will be merging this.

Thanks @vedran for contributing.

@YashBhalodi YashBhalodi merged commit 6ea10f1 into YashBhalodi:main Sep 23, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants