Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Better keyboard-driven navigation, any? - yes...

by shmem (Chancellor)
on Jul 28, 2008 at 09:13 UTC ( [id://700487]=note: print w/replies, xml ) Need Help??


in reply to Re: Better keyboard-driven navigation, any? - yes...
in thread Better keyboard-driven navigation, any? - yes...

I somewhat regret you announced it so in a hurry;

That's not something you have to regret, but I - if so. But I don't. The earlier the prototype is out, the earlier bug reports or feature requests come in, which could question the overall design.

So if it's public almost after start of writing, it doesn't happen that after finishing the audience says

"not only is this all incomprehensible, but the ink is ugly and the paper is from the wrong kind of tree."

And hey, you said it yourself - it's already usable ;-)

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^3: Better keyboard-driven navigation, any? - yes...
by blazar (Canon) on Jul 28, 2008 at 22:05 UTC

    I personally believe that since shmem's script has been here publicized, I'd better also publicly copy here my first draft of review on his code. This has taken some time due to my own lazyness and thus may not be completely consistent over time, but I'm confident that it mostly is. I'm copying it here out of my own scratchpad.


    I've tried the beast: all in all, I already like it!

    Key driven navigation must be turned off whenever a textarea is entered, or a text field. Sadly, there's no uniform id for composition textareas or title textboxes...

    Is this the case? If it were, then indeed it would be extremely annoying. But then I've tried e.g. to go to the node consideration text field, both with the hot key and scrolling with the mouse. Then I did not consider the node and move out of it say, with a Tab. And I could start using the keybindings again - seamlessly. Or did I misunderstood anything?

    To disable, enter document.onkeypress = ''; in a suitable javascript console (e.g.firebug). Oh.. that reminds me... Firefox only, I guess. Haven't checked IE yet.

    I believe that the javascript: pseudo-protocol may do. Again, FF has it: don't know 'bout IE, let alone other browsers.

    all sections:
    • p - go to posts / replies section
    • [...]
    • p - go to posts / replies section: at first I found this behaviour counter-intituitive. On a second thought, it still is counter-intuitive: (the difference being that on the first one my reaction was along the line of "this damn thing doesn't work!" while now I know "I have to press p first...") I have a list of nodes, and I do not necessarily view the first one as having a quite different nature from the replies. Specifically, the p key is useful and should stay, but if possible j should bring to the first reply as well, and k on the first reply should be an alias with m. If possible!
    • n - go to nodelets: hadn't even thought of that, but works fine for me!
    • c - set focus and jump to chatterbox entry box: ditto!
    • m - jump to main node: I have found this not to work when switching to some other navigation mode. I would expect that once I tab a few times or click in an "empty" point, it would do. By contrast, v always brings me to the vote button, which means that it should be roughly doable
    • ? - show alert box with key bindings: very good!
    main section:
    • + - set ++ vote for current post
    • [...]

    I'm giving you my impression in terms of UI:

    posts:
    • + - set ++ vote for current post: very good! One annoying detail with the partial keyboard driven navigation I was using before is that I left the radio button selected and while moving down I would occasionally change a ++ into a --. Of course the cure is simply a tab away or a click out of the button, which is, after all twice the effort, or 100% more. Yours is definitely clearer and faster.
    • - - set -- vote for current post: here, I'm afraid I must tell you of the first actual bug, although the behaviour has changed over the past few days. As of the last time I tried, i.e. this morning, - plainly doesn't work with an error alert. Yesterday . did the trick instead: I'm sure that this is in connection with me not having selected the null vote in my preferences. Today, pressing . doesn't vote -- but doesn't do anything either. I wonder if a solution is possible at all, that would work with both kinds of user settings...
    • . - set 0 vote for current post: ditto, I don't have it. But, as a feature request and if possible at all, I'd like it to clean the vote anyway.
    • v - set focus and jump to "vote!" button: this is also perfect; much faster than moving to in any other way I have access to.
    • t - jump to note composition text area: to be fair, I'm not sure what this is for.
    posts and nodelets:
    • j - down one post/nodelet
    • [...]
    • j - down one post/nodelet: in terms of UI, there's another gotcha similar to that with the main post. Precisely, one gets the feeling that repeatedly pressing j she will get "to the end." At some point, however, posts do not scroll down any more: of course that's when you've hit the last one. And you do realize it, but you have that fraction of second of psychological unesiness with it, if you know what I mean: I believe that hitting it one more time on the last node should either give a clear visual indication that there no more posts, or more simply and IMHO intuitively act as an alias for v. Vice versa, hitting k on v "should" bring back to the last reply. I'm also afraid to have spotted another possible bug. Namely, when for some reason I switch to some other navigation method (and I was forced to, because of the aforementioned difficulties with +, . and -) j and k ended up not moving between posts but between links within a post, and no way to "escape."
    • k - up one post/nodelet: ditto!
    • l - set focus on first link in current post/nodelet: good!
    • From there, access links with the <Tab> key: ISTR having had some difficulties with this too, within posts, not nodelettes, but as a general rule I've not toyed too much with it.
    posts:
    • r - set focus on reply link
    • [...]
    • r - set focus on reply link: I must say that while for v it is very sensible to only set focus on the vote button, because one may change his mind, I would consider a very good idea to have this key actually open the reply link in a new window/tab and switch to it. If one changes her mind, then she can always close it.
    --
    If you can't understand the incipit, then please check the IPB Campaign.

      It seems like I have to explain a bit better how the navigation is implemented and why so...

      Now to your post - thanks for the feedback! In what follows I'll address some or most of the issues you raised.

      p - go to posts / replies section: ... if possible j should bring to the first reply as well, and k on the first reply should be an alias with m. If possible!

      Hm well - 'm' is just a shortcut to invoke window.scroll(0,0) from any context without loosing the actual context and index. There's currently no key for 'go to root context and clear navigation info'. 'k' on the first item could be made into 'go to current parent context item', but 'j'... well, it seems that hashes in JavaScript don't lose order of definition, for empty collections that could be made into 'invoke first subkey'. I'll look into that.

      update3: fixed. 'j' and 'k' now advance collections. Try on e.g. 'Newest Nodes'.

      - - set -- vote for current post: here, I'm afraid I must tell you of the first actual bug

      Check your version - that should work in $current (at least, "works for me"[tm] ;-) Also '+' and '0'. Update: acknowledged, once you are in the 'p' context you can't vote on the OP any more... update2: fixed. 'R' takes to root context, 'P' to parent/root node of current node. There's been a workaround -just go from posts context to nodelet, and voting works on the op again ;-)

      j - down one post/nodelet: ... and k ended up not moving between posts but between links within a post, and no way to "escape."

      See 'p' - 'j' could default on end of collection 'go to next collection in parent context'. As with "no way to escape" - hitting the access key for the parent context brings back to that. If it doesn't it's a bug ;)

      From there, access links with the <Tab> key:
      Currently all lists accessible with 'l' are a context which you can navigate with the up/down key, i.e. tab browsing is only necessary where the 'l' key doesn't respond.
      t - jump to note composition text area: to be fair, I'm not sure what this is for.

      That's for textareas where you enter text composing a node. If you leave the text area with 'tab', get up with 'm' or scroll about with page-up/page-down, hitting 't' returns to the text area where the cursor was left (initially it's at the bottom, after the signature). After leaving the textarea with <Tab> the focus sits on the 'Preview' button, so don't navigate with the space bar, since that invokes the button.

      r - set focus on reply link: I must say that while for v it is very sensible to only set focus on the vote button, because one may change his mind, I would consider a very good idea to have this key actually open the reply link in a new window/tab and switch to it. If one changes her mind, then she can always close it.

      That would go against all other link navigation, where a link is only focussed. I think that hitting return (or Ctrl-Return) on a link is far better than opening a window per default, only to have to close it afterwards.

      Again, thanks for your feedback, it actually helped me to improve some things and made my hack clearer to myself by composing an answer :-)

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://700487]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found