LW client-side comment improvements

by Bakkot1 min read7th Aug 201415 comments


Site Meta

All of these things I mentioned in the most recent open thread, but since the first one is directly relevant and the comment where I posted it somewhat hard to come across, I figured I'd make a post too.


Custom Comment Highlights

NOTE FOR FIREFOX USERS: this contained a bug which has been squashed, causing the list of comments not to be automatically populated (depending on your version of Firefox). I suggest reinstalling. Sorry, no automatic updates unless you use the Chrome extension (though with >50% probability there will be no further updates).

You know how the highlight for new comments on Less Wrong threads disappears if you reload the page, making it difficult to find those comments again? Here is a userscript you can install to fix that (provided you're on Firefox or Chrome). Once installed, you can set the date after which comments are highlighted, and easily scroll to new comments. See screenshots. Installation is straightforward (especially for Chrome, since I made an extension as well).

Bonus: works even if you're logged out or don't have an account, though you'll have to set the highlight time manually.

Delay Before Commenting

Another script to add a delay and checkbox reading "In posting this, I am making a good-faith contribution to the collective search for truth." before allowing you to comment. Made in response to a comment by army1987.

Slate Star Codex Comment Highlighter

Edit: You no longer need to install this, since Scott's added it to his blog. Unless you want the little numbers in the title bar.

Yet another script, to make finding recent comments over at Slate Star Codex a lot easier. Also comes in Chrome extension flavor. See screenshots. Not directly relevant to Less Wrong, but there's a lot of overlap in readership, so you may be interested.

Note for LW Admins / Yvain
These would be straightforward to make available to all users (on sufficiently modern browsers), since they're just a bit of Javascript getting injected. If you'd like to, feel free, and message me if I can be of help.


15 comments, sorted by Highlighting new comments since Today at 11:30 AM
New Comment

Thank you very much.

Thanks for your work!

The widget shows items under "comment score below threshold" threads, but clicking on those comments in the widget panel doesn't do anything. Ideal behavior would be to open the "comment score below threshold" JavaScript link when clicking the item, possibly also to use a different rendering color for these items in the widget to go along with the bad thread filtering spirit and give the user an opportunity to skip them without reading.

This whole project is making me think that websites like LW with moderately complex use patterns could just be database APIs on the server side and have the client side HTML rendering and all made entirely in JavaScript so that people could do drastic usability changes by just changing the default frontend source. Of course that would also make hostile botting much easier.

Good catch. Don't think I'm going to change the behavior, as there's complex cases where there's no obvious behavior: suppose you have a highly upvoted comment, whose parent and grandparent are both below the threshold. Do you color it in the widget differently from its parents? Do you expand both its parent and grandparent when it's clicked on, in order that it be on the page and thus scrollable to? Do you mark its parent somehow so the reader knows that comment wouldn't normally have been displayed?

So I think I'm OK with clicking on a comment which is hidden doing nothing. It's maybe worth greying out such comments in the list, so as not to confuse people when nothing happens, but I feel like this mostly just ends up highlighting them, so I'm not going to put that in the main script. If you want that feature, though, I pushed it to an alternative branch on the github repo, and you can find it here. Comments will remain greyed even if you've un-hidden their parents, but will become scrollable to.

Should this remember the previous timestamp when you revisit a page and new comments have been posted? It seems to always start out showing 0 new comments for me before I manually adjust the time. (The SSC one does show me comments after the previous visit when I revisit a page.)

The way it currently works - at least, the way I designed it, and the way it seems to work for me - is that it doesn't remember anything between visits, but rather determines which comments are new since your last visit by looking at the highlight provided by LW's server. If there were comments made since your last visit, they should be highlighted with or without the script; no custom highlighting will be performed until you manually change the timestamp.

If you aren't seeing new comments highlighted, it's (almost certainly) because LW isn't highlighting them - maybe you're logged out, or loaded the page elsewhere, or have never visited the page? [In this way the LW script differs from the SSC script, because the LW server regards "never visited" as "nothing new" whereas my SSC script regards "never visited" as "everything new".]

The reason I did it this way is that LW, unlike SSC, is itself keeping a record of which comments are new since your last visit, which works even if you loaded the page on another computer (but the same account). I didn't want to mess with the built-in mechanism, only allow you to change it per-visit if necessary.

I always see the widget showing 0 new comments when entering pages, even when there are new comments LW is highlighting with the pink border.

Huh. Try the most recent version (as of just now).

That seems to have fixed it. Thanks.

Wish I could upvote this 1000 times. This will probably do far more for this site than 1000 articles of mere content. Certainly, it will for my enjoyment and understanding.

How do I edit the date/time?

I've tried changing numbers and refreshing the page, and the date/time just reverts to what it was.

Don't refresh - just hit enter, or otherwise defocus the textbox (click anywhere else on the page, or hit tab). It'll apply automatically and only lasts while the page is loaded; the time you enter doesn't get saved when you reload.

[-][anonymous]7y 1

“The collective search for truth” might sound a bit too grandiose if this is implemented server-side (but I'm primed by reading this ChristianKl comment); maybe “In posting this, I am making a good-faith contribution to refining the art of human rationality” (as per the LW tagline) or similar?

[-][anonymous]7y 7

How about... "Are you sure you'd like to post this?"

Any other message would have probably immediately driven me a way from this place.

I'd agree with that for a default implementation, but as a userscript I like the "collective search for truth" one better.

Best of all, I think it would be cool to have a server-side implementation with the text customizable, set by default to "Are you sure you'd like to post this?" (and possibly opt-in).