[Website usability] Scroll to new comments (v0.3)

post by dbaupp · 2011-08-08T14:08:30.127Z · score: 13 (14 votes) · LW · GW · Legacy · 10 comments

Contents

  Changelog
None
10 comments

I wrote a short userscript1 that allows for jumping to the next (or previous) new comment in a page (those marked with green). I have tested it on Firefox nightly with the Greasemonkey addon and Chromium. Unfortunately, I think that user scripts only work in Chromium/Google Chrome and Firefox (with Greasemonkey).

Download here (Clicking the link should offer a install prompt, and that is all the work that needs to be done.)

It inserts a small box in the lower right-hand corner that indicates the number of new messages and has a "next" and a "previous" link like so:

Clicking either link should scroll the browser to the top of the appropriate comment (wrapping around at the top and bottom).

The "!" link shows a window for error logging. If a bug occurs, clicking the "Generate log" button inside this window will create a box with some information about the running of the script2, copying and pasting that information here will make debugging easier.

I have only tested on the two browsers listed above, and only on Linux, so feedback about any bugs/improvements would be useful.

(Technical note: It is released under the MIT License, and this link is to exactly the same file as above but renamed so that the source can be viewed more easily. The file extension needs to be changed to "user.js" to be able to run as a user script properly)

Changelog

v0.1 - First version

v0.2 - Logging & indication of number of new messages

v0.3 - Correctly update when hidden comments are loaded (and license change). NOTE: Upgrading to v0.3 on Chrome is likely to cause a "Downgrading extension error" (I'd made a mistake with the version numbers previously), the fix is to uninstall and then reinstall the new version. (uninstall via Tools > Extensions)


1 A segment of javascript that runs in the web browser as the page is loaded. It can modify the page,  e.g. inserting a bit of html as this script does.

2 Specifically: the url, counts of different sets of comments, some info about the new comments, and also a list of the clicks on "prev" and "next".

10 comments

Comments sorted by top scores.

comment by Oscar_Cunningham · 2011-08-08T14:53:23.503Z · score: 4 (4 votes) · LW(p) · GW(p)

Awesome. Thank you.

Bug report: The next button doesn't always work. I can't pin down exactly what circumstances cause this but it seems to happen only if the comment I'm currently on has no children.

I using Firefox 5 on Windows 7, and have comments sorted by "Old".

comment by dbaupp · 2011-08-08T23:39:48.523Z · score: 1 (1 votes) · LW(p) · GW(p)

Thanks!

How does it not work? e.g. doesn't do anything, or scrolls to a random spot.

comment by Oscar_Cunningham · 2011-08-09T08:10:21.671Z · score: 0 (0 votes) · LW(p) · GW(p)

Doesn't do anything.

comment by dbaupp · 2011-08-09T09:28:37.607Z · score: 0 (0 votes) · LW(p) · GW(p)

Hmmm, I have an tiny idea what might be happening, but I haven't been able to reproduce it yet, so I'm unwilling to dive in and change things.

If that bug occurs to you (or anyone else) again, could you post a link to the specific comment(s) it occurs on? Thanks!

comment by Oscar_Cunningham · 2011-08-09T12:31:47.617Z · score: 0 (0 votes) · LW(p) · GW(p)

I accessed this post while it had 27 comments. For me, they were all unread. The "next" button failed to do anything when I was on this comment (i.e. when the top of my screen was aligned with the top of that comment).

Pressing the "prev" button did nothing when the top of my screen was aligned with these comments: http://lesswrong.com/lw/70c/why_are_certain_trends_so_precisely_exponential/4mce

http://lesswrong.com/lw/70c/why_are_certain_trends_so_precisely_exponential/4mcf

http://lesswrong.com/lw/70c/why_are_certain_trends_so_precisely_exponential/4mcc

http://lesswrong.com/lw/70c/why_are_certain_trends_so_precisely_exponential/4mcd

http://lesswrong.com/lw/70c/why_are_certain_trends_so_precisely_exponential/4men

comment by dbaupp · 2011-08-09T13:26:07.996Z · score: 0 (0 votes) · LW(p) · GW(p)

Thank you for that! Unfortunately, I can't reproduce your bug (and it's not what I thought it might be): I went through and added the "new comment" marker to those comments and their children, to try to simulate the circumstances, but everything worked fine for me. I'll update the script to include some logging (EDIT: done).

Has it happened on any other pages?

comment by Oscar_Cunningham · 2011-08-09T14:23:41.333Z · score: 1 (1 votes) · LW(p) · GW(p)

Aha! The problem is at my end, I've been viewing LessWrong zoomed-in slightly. Resetting to the default level of zoom prevents the error from happening.

comment by dbaupp · 2011-08-09T15:01:22.453Z · score: 0 (0 votes) · LW(p) · GW(p)

Nice! Thanks for the effort nonetheless.

comment by Pavitra · 2011-08-08T15:44:22.395Z · score: 1 (1 votes) · LW(p) · GW(p)

This makes my life easier. Have some karma!

comment by drethelin · 2013-09-07T16:42:23.243Z · score: 0 (0 votes) · LW(p) · GW(p)

was using this for a long time on one computer, just switched to another. This is invaluable.