MarkMindCkm / obsidian-enhancing-mindmap

obsidian plugin editable mindmap,you can edit mindmap on markdown file
MIT License
567 stars 51 forks source link

enhancement of the way of jumping between node with keyboard #139

Closed khad1r closed 7 months ago

khad1r commented 7 months ago

jumping between node with keyboard been so confusing as it moving by chosing the relative distance between the current node with node to the direction as when navigating with keyboard the node sometime jump to another branches

current way of jumping between node is by using traverse Depth First. but the current implementation is by full traverse all the tree node from the root to find the closest one to the selected node relative to the arrow key

in here i propose the way of navigating base on its hierarchy here the demo

https://github.com/khad1r/obsidian-enhancing-mindmap/assets/60246846/bd66e58d-8dcc-4899-8a5e-95b66fb409ba

here are the rule

this feature is actualy work best with my other the pull request #138
here some demo with default navigation but ctrl + [arrow-up|down|left|right] from #138 is using this PR feature to moving between node

https://github.com/khad1r/obsidian-enhancing-mindmap/assets/60246846/1b0ebc16-3cd0-4a14-96dc-18515935720b

[!NOTE] when using default layout / clockwise when moving using up or down at root children might moving not the way you expect as the way this implemented is by moving throught root.children array

MarkMindCkm commented 7 months ago

good work!

khad1r commented 7 months ago

Thank you @MarkMindCkm But this PR is independent from #138 So I might have to create another PR to actually integrated this feature

Gonna look at it again later this day