Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Consider more conventional tree navigation behaviors #4

Closed
mholt opened this issue Oct 31, 2019 · 5 comments
Closed

Consider more conventional tree navigation behaviors #4

mholt opened this issue Oct 31, 2019 · 5 comments

Comments

@mholt
Copy link

mholt commented Oct 31, 2019

I find it helpful when navigating any tree structure to be able to collapse and expand all nodes, but also go <-- (left) and --> (right) to move into & out of the structure's depth.

Right now, LEFT and RIGHT arrow keys only go UP and DOWN, but would you consider having LEFT and RIGHT jump directly to the adjacent parent/child node in that direction?

Also, the key bindings are really unintuitive for non-vim users. Could we consider using SPACEBAR and SHIFT-* (etc.) for certain actions like expanding/collapsing current node, jumping up or down a page or element, etc? I don't have anything too concrete in mind, but it's a little tricky to use right out of the box. I have to keep referencing the table in the readme, but I feel like I should just be able to figure it out with my arrow keys and spacebar and ctrl/shift keys.

Additionally, the "Collapse all nodes" (H) doesn't seem to be very helpful, as it just replaces everything with a . ... which I can then edit... anyway, I just think there's some room for significant improvement here in the UI.

@skanehira
Copy link
Owner

Right now, LEFT and RIGHT arrow keys only go UP and DOWN, but would you consider having LEFT and RIGHT jump directly to the adjacent parent/child node in that direction?

what it mean like following?

{object}
├──like <-- cursor in there
│  ├──dog
│  └──cat
├──name
│  └──gorilla
└──age
   └──27

using C-j jump to next key as following.

{object}
├──like
│  ├──dog
│  └──cat
├──name <-- cursor in there
│  └──gorilla
└──age
   └──27

using C-k jump to previous key.

{object}
├──like <-- cursor in there
│  ├──dog
│  └──cat
├──name
│  └──gorilla
└──age
   └──27

Also, the key bindings are really unintuitive for non-vim users. Could we consider using SPACEBAR and SHIFT-* (etc.) for certain actions like expanding/collapsing current node, jumping up or down a page or element, etc? I don't have anything too concrete in mind, but it's a little tricky to use right out of the box.

How about using space to expanding/collapsing, c-j and c-k to move next next or previous key?

I have to keep referencing the table in the readme, but I feel like I should just be able to figure it out with my arrow keys and spacebar and ctrl/shift keys.

I added help panel so you can use ? to display it :)

@mholt
Copy link
Author

mholt commented Nov 3, 2019

what it mean like following?

Yep! I think so anyway 😅

How about using space to expanding/collapsing, c-j and c-k to move next next or previous key?

Sure, space is great.

I added help panel so you can use ? to display it :)

Cool, thanks!

@skanehira
Copy link
Owner

I see, I’ll implement :)
Thank you for the idea

@skanehira
Copy link
Owner

@mholt Hi, I implemented following, please update tson and try it :)

  • use space to expand/collapse node
  • use c-j to move next parent node, c-k to move previous parent node.

If you find some bug let me know :)

@mholt
Copy link
Author

mholt commented Nov 4, 2019

Great! Nice improvements, thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants