Description: I often use "n" to jump to a hook ("hunk" in diff terms) but then Rietveld lacks a shortcut to move the indicator line-by-line. So I have to fall back to use the mouse to double-click a line to add comments.
This change adds a/d shortcuts to move the indicator to the next/prev line in side-by-side view. The difficulty here is that I had to add "temporary" hooks on the JavaScript side that become "real" hooks when a comment is added. This is to not break the n/p movement between hooks.
This version is live here: http://rvtests.appspot.com (Don't forget to reload to get the latest script.js and to login to leave comments by pressing enter.)
> Description: > I often use "n" to jump to a hook ("hunk" in diff terms) but then > Rietveld lacks a shortcut to move the indicator line-by-line. So I > have to fall back to use the mouse to double-click a line to add > comments.
> This change adds a/d shortcuts to move the indicator to the next/prev > line in side-by-side view. The difficulty here is that I had to add > "temporary" hooks on the JavaScript side that become "real" hooks when > a comment is added. This is to not break the n/p movement between > hooks.
> This version is live here: http://rvtests.appspot.com > (Don't forget to reload to get the latest script.js and to login to > leave comments by pressing enter.)
Initially I thought about using the arrow keys too, but then I didn't want to change the default behavior in browsers (move page up and down).
Now that I read your comment, it sounds much like that my concerns don't count in real life :) It should be possible to modify the change to use arrow keys.
On Mon, Feb 20, 2012 at 8:08 PM, Guido van Rossum <gu...@python.org> wrote:
> Hmmm... In Mondrian we used up/down arrows for this. It would move the blue > line and scroll 1 line. And IIRC o to open a comment (or c?).
In Rietveld we use the Enter key to comment, c to collcapse all comments o isn't used on side-by-side view.
> On Feb 20, 2012 10:39 AM, <albrecht.a...@googlemail.com> wrote:
>> Reviewers: GvR, M-A,
>> Description: >> I often use "n" to jump to a hook ("hunk" in diff terms) but then >> Rietveld lacks a shortcut to move the indicator line-by-line. So I >> have to fall back to use the mouse to double-click a line to add >> comments.
>> This change adds a/d shortcuts to move the indicator to the next/prev >> line in side-by-side view. The difficulty here is that I had to add >> "temporary" hooks on the JavaScript side that become "real" hooks when >> a comment is added. This is to not break the n/p movement between >> hooks.
>> This version is live here: http://rvtests.appspot.com >> (Don't forget to reload to get the latest script.js and to login to >> leave comments by pressing enter.)
1. When you hit DOWN enough times the blue line goes off the page. In Mondrian we solved this by simultaneously scrolling the window up by the same amount (so the blue line stays put relative to the window but moves down relative to the text).
2. Mixing DOWN and 'n' is confusing -- if you use DOWN to go past the next chunk, 'n' moves the blue line *up*, apparently it doesn't keep track of where you are on the page.
On Fri, Feb 24, 2012 at 5:19 AM, <gvanros...@gmail.com> wrote: > Looking at the test site I see two problems:
> 1. When you hit DOWN enough times the blue line goes off the page. In > Mondrian we solved this by simultaneously scrolling the window up by the > same amount (so the blue line stays put relative to the window but moves > down relative to the text).
Done. Position of the viewport is now updated when up/down key is pressed.
> 2. Mixing DOWN and 'n' is confusing -- if you use DOWN to go past the > next chunk, 'n' moves the blue line *up*, apparently it doesn't keep > track of where you are on the page.
Thanks! I've missed that.
An updated version with both changes is now live on my testing instance. The changeset is updated accordingly.
> Yes, JavaScript sucks. :-(
agreed... you can test for hours and there's still strange behavior or even worse: a questionable internal state of variables :)
<albrecht.a...@googlemail.com> wrote: > On Fri, Feb 24, 2012 at 5:19 AM, <gvanros...@gmail.com> wrote: >> Looking at the test site I see two problems:
>> 1. When you hit DOWN enough times the blue line goes off the page. In >> Mondrian we solved this by simultaneously scrolling the window up by the >> same amount (so the blue line stays put relative to the window but moves >> down relative to the text).
> Done. Position of the viewport is now updated when up/down key is pressed.
>> 2. Mixing DOWN and 'n' is confusing -- if you use DOWN to go past the >> next chunk, 'n' moves the blue line *up*, apparently it doesn't keep >> track of where you are on the page.
> Thanks! I've missed that.
> An updated version with both changes is now live on my testing > instance. The changeset is updated accordingly.
>> Yes, JavaScript sucks. :-(
> agreed... you can test for hours and there's still strange behavior or > even worse: a questionable internal state of variables :)
Much better. I found some odd anomalies (off-by-one errors?):
- using DOWN I cannot reach the lowest point where I can get with 'n' or 'N' (between the last line of the file and the table footer saying OLD ... NEW)
- after going all the way down with 'N', UP sends me to the top of the file except one line up
- using UP I cannot reach the highest point (*above* the OLD ... NEW table header)
- from that highest point, UP goes one line *down*
- it's a little jarring that hitting DOWN from the highest point scrolls the viewport so much
> On Thu, Feb 23, 2012 at 9:03 PM, Andi Albrecht > <albrecht.a...@googlemail.com> wrote: >> On Fri, Feb 24, 2012 at 5:19 AM, <gvanros...@gmail.com> wrote: >>> Looking at the test site I see two problems:
>>> 1. When you hit DOWN enough times the blue line goes off the page. In >>> Mondrian we solved this by simultaneously scrolling the window up by the >>> same amount (so the blue line stays put relative to the window but moves >>> down relative to the text).
>> Done. Position of the viewport is now updated when up/down key is pressed.
>>> 2. Mixing DOWN and 'n' is confusing -- if you use DOWN to go past the >>> next chunk, 'n' moves the blue line *up*, apparently it doesn't keep >>> track of where you are on the page.
>> Thanks! I've missed that.
>> An updated version with both changes is now live on my testing >> instance. The changeset is updated accordingly.
>>> Yes, JavaScript sucks. :-(
>> agreed... you can test for hours and there's still strange behavior or >> even worse: a questionable internal state of variables :)
> Much better. I found some odd anomalies (off-by-one errors?):
> - using DOWN I cannot reach the lowest point where I can get with 'n' > or 'N' (between the last line of the file and the table footer saying > OLD ... NEW)
> - after going all the way down with 'N', UP sends me to the top of the > file except one line up
> - using UP I cannot reach the highest point (*above* the OLD ... NEW > table header)
> - from that highest point, UP goes one line *down*
All of the above came from not handling the edge cases correctly.
> - it's a little jarring that hitting DOWN from the highest point > scrolls the viewport so much
I've addressed the edge cases and limited the scrolling to when it's really needed in my latest changeset. My testing instance runs that latest version.
Looks great, except the viewport now no longer adjusts when you move the blue line. I'm not sure if I care though. But I really hope someone else can review the JS code for style and substance...
<albrecht.a...@googlemail.com> wrote: > Thanks for the thorough testing!
> On Fri, Feb 24, 2012 at 4:46 PM, Guido van Rossum <gu...@python.org> wrote: >> On Thu, Feb 23, 2012 at 9:03 PM, Andi Albrecht >> <albrecht.a...@googlemail.com> wrote: >>> On Fri, Feb 24, 2012 at 5:19 AM, <gvanros...@gmail.com> wrote: >>>> Looking at the test site I see two problems:
>>>> 1. When you hit DOWN enough times the blue line goes off the page. In >>>> Mondrian we solved this by simultaneously scrolling the window up by the >>>> same amount (so the blue line stays put relative to the window but moves >>>> down relative to the text).
>>> Done. Position of the viewport is now updated when up/down key is pressed.
>>>> 2. Mixing DOWN and 'n' is confusing -- if you use DOWN to go past the >>>> next chunk, 'n' moves the blue line *up*, apparently it doesn't keep >>>> track of where you are on the page.
>>> Thanks! I've missed that.
>>> An updated version with both changes is now live on my testing >>> instance. The changeset is updated accordingly.
>>>> Yes, JavaScript sucks. :-(
>>> agreed... you can test for hours and there's still strange behavior or >>> even worse: a questionable internal state of variables :)
>> Much better. I found some odd anomalies (off-by-one errors?):
>> - using DOWN I cannot reach the lowest point where I can get with 'n' >> or 'N' (between the last line of the file and the table footer saying >> OLD ... NEW)
>> - after going all the way down with 'N', UP sends me to the top of the >> file except one line up
>> - using UP I cannot reach the highest point (*above* the OLD ... NEW >> table header)
>> - from that highest point, UP goes one line *down*
> All of the above came from not handling the edge cases correctly.
>> - it's a little jarring that hitting DOWN from the highest point >> scrolls the viewport so much
> I've addressed the edge cases and limited the scrolling to when it's > really needed in my latest changeset. My testing instance runs that > latest version.
> -- > Andi
>> -- >> --Guido van Rossum (python.org/~guido)
> -- > You received this message because you are subscribed to the Google Groups "codereview-list" group. > To post to this group, send an email to codereview-list@googlegroups.com. > To unsubscribe from this group, send email to codereview-list+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/codereview-list?hl=en-GB.
On Sun, Feb 26, 2012 at 4:10 AM, Guido van Rossum <gu...@python.org> wrote:
> Looks great, except the viewport now no longer adjusts when you move > the blue line. I'm not sure if I care though. But I really hope > someone else can review the JS code for style and substance...
When doesn't the viewport adjust correctly? In the last version I've changed that when moving the blue line with up/down the viewport only adjusts when the blue line moves out of the viewport (in contrast to the previous version where the viewport was adjusted with every up/down move).
> On Sat, Feb 25, 2012 at 9:25 AM, Andi Albrecht > <albrecht.a...@googlemail.com> wrote: >> Thanks for the thorough testing!
>> On Fri, Feb 24, 2012 at 4:46 PM, Guido van Rossum <gu...@python.org> wrote: >>> On Thu, Feb 23, 2012 at 9:03 PM, Andi Albrecht >>> <albrecht.a...@googlemail.com> wrote: >>>> On Fri, Feb 24, 2012 at 5:19 AM, <gvanros...@gmail.com> wrote: >>>>> Looking at the test site I see two problems:
>>>>> 1. When you hit DOWN enough times the blue line goes off the page. In >>>>> Mondrian we solved this by simultaneously scrolling the window up by the >>>>> same amount (so the blue line stays put relative to the window but moves >>>>> down relative to the text).
>>>> Done. Position of the viewport is now updated when up/down key is pressed.
>>>>> 2. Mixing DOWN and 'n' is confusing -- if you use DOWN to go past the >>>>> next chunk, 'n' moves the blue line *up*, apparently it doesn't keep >>>>> track of where you are on the page.
>>>> Thanks! I've missed that.
>>>> An updated version with both changes is now live on my testing >>>> instance. The changeset is updated accordingly.
>>>>> Yes, JavaScript sucks. :-(
>>>> agreed... you can test for hours and there's still strange behavior or >>>> even worse: a questionable internal state of variables :)
>>> Much better. I found some odd anomalies (off-by-one errors?):
>>> - using DOWN I cannot reach the lowest point where I can get with 'n' >>> or 'N' (between the last line of the file and the table footer saying >>> OLD ... NEW)
>>> - after going all the way down with 'N', UP sends me to the top of the >>> file except one line up
>>> - using UP I cannot reach the highest point (*above* the OLD ... NEW >>> table header)
>>> - from that highest point, UP goes one line *down*
>> All of the above came from not handling the edge cases correctly.
>>> - it's a little jarring that hitting DOWN from the highest point >>> scrolls the viewport so much
>> I've addressed the edge cases and limited the scrolling to when it's >> really needed in my latest changeset. My testing instance runs that >> latest version.
>> -- >> Andi
>>> -- >>> --Guido van Rossum (python.org/~guido)
>> -- >> You received this message because you are subscribed to the Google Groups "codereview-list" group. >> To post to this group, send an email to codereview-list@googlegroups.com. >> To unsubscribe from this group, send email to codereview-list+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/codereview-list?hl=en-GB.
> -- > --Guido van Rossum (python.org/~guido)
> -- > You received this message because you are subscribed to the Google Groups "codereview-list" group. > To post to this group, send an email to codereview-list@googlegroups.com. > To unsubscribe from this group, send email to codereview-list+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/codereview-list?hl=en-GB.
<albrecht.a...@googlemail.com> wrote: > On Sun, Feb 26, 2012 at 4:10 AM, Guido van Rossum <gu...@python.org> wrote: >> Looks great, except the viewport now no longer adjusts when you move >> the blue line. I'm not sure if I care though. But I really hope >> someone else can review the JS code for style and substance...
> When doesn't the viewport adjust correctly? In the last version I've > changed that when moving the blue line with up/down the viewport only > adjusts when the blue line moves out of the viewport (in contrast to > the previous version where the viewport was adjusted with every > up/down move).
Either way is fine with me. I notice Mondrian has the behavior of your previous version in this respect.