Thursday, October 25th, 2007
Glen Lipka has been thinking about Trees. He looked around for patterns for building them, and couldn’t find anything. Then he looked at examples such as the Ext Tree component and ended up writing up his dream tree:
- Hover. This is a problem with Vista as well. If itâ€™s clickable, then it should afford clicking. The best way to do this is with a color change in the background. EXT and Vista do this very well in Menus, but they forget about it in the Tree. Trees need clear hover states. This is my number one pattern in general for trees and it is missing in tons of JS trees out there.
- Bigger target. The hover in the above step needs to be wide. As wide as the whole tree. Plus it needs to have a little padding. Give the user a decent target to hit. Donâ€™t make them hit a tiny spot. Give them breathing room. David Foltz says, â€œDonâ€™t make the user play target practiceâ€. He is right.
- Keyboard shortcuts are good when the tree is focused, but what about when itâ€™s blurred. Keyboard shortcuts donâ€™t work when tree is blurred. In Vista the â€œon stateâ€ changes to be lower contrast on blur, so that itâ€™s easier to tell that moving the mouse will have no effect. In the EXT example, it doesnâ€™t change. This causes issues. I actually asked the engineers to turn keyboard shortcuts off, and it seems that the keyboard option is not easily turn-off-able.
The pattern I actually like with keyboard shortcuts better than this example is to move the â€œselectorâ€ or â€œhoverâ€ with the keyboard, and NOT the onstate. Moving the onstate changes the right side. This is OK in an operating system, but not OK in a web application, where latency is much greater. Interestingly, Vista is different than XP on this score. Vista moves the hover state, although it looks like the onstate. And XP actually moves the onstate. Ugh, this is all a mess.
Ok, the bottom line is: Keyboard shortcuts for web trees should move the hover state and require an enter or spacebar. This is the same pattern as keyboard shortcuts in raw HTML.
- Bigger On state. It should be clearer that you are ON a selection. It should be a background color going as wide as the whole tree.
- Should not collapse the entire tree. The root node on a tree with only one root node should not collapse. Even though I see this in lots of trees including Microsoft, I think its terrible. Why would the user want to collapse the tree down to one node? It makes no sense to me.
Posted by Dion Almaer at 8:27 am