LW client-side comment improvements

post by Bakkot · 2014-08-07T20:40:39.371Z · LW · GW · Legacy · 15 comments

Contents

  Custom Comment Highlights
  Delay Before Commenting
  Slate Star Codex Comment Highlighter
None
15 comments

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

Comments sorted by top scores.

comment by NancyLebovitz · 2014-08-07T23:57:13.719Z · LW(p) · GW(p)

Thank you very much.

comment by Larks · 2014-08-09T01:27:45.609Z · LW(p) · GW(p)

Thanks for your work!

comment by Risto_Saarelma · 2014-08-14T06:17:48.486Z · LW(p) · GW(p)

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.

Replies from: Bakkot
comment by Bakkot · 2014-08-14T07:16:24.432Z · LW(p) · GW(p)

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.

comment by Risto_Saarelma · 2014-08-13T05:41:03.423Z · LW(p) · GW(p)

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.)

Replies from: Bakkot
comment by Bakkot · 2014-08-13T06:01:33.675Z · LW(p) · GW(p)

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.

Replies from: Risto_Saarelma
comment by Risto_Saarelma · 2014-08-13T07:15:42.821Z · LW(p) · GW(p)

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.

Replies from: Bakkot
comment by Bakkot · 2014-08-13T17:56:06.248Z · LW(p) · GW(p)

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

Replies from: Risto_Saarelma
comment by Risto_Saarelma · 2014-08-13T18:23:12.613Z · LW(p) · GW(p)

That seems to have fixed it. Thanks.

comment by Armok_GoB · 2014-08-12T23:01:55.008Z · LW(p) · GW(p)

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.

comment by NancyLebovitz · 2014-08-09T22:40:57.330Z · LW(p) · GW(p)

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.

Replies from: Bakkot
comment by Bakkot · 2014-08-09T23:57:12.335Z · LW(p) · GW(p)

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.

comment by A1987dM (army1987) · 2014-08-09T09:26:15.579Z · LW(p) · GW(p)

“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?

Replies from: None
comment by [deleted] · 2014-08-10T02:49:47.253Z · LW(p) · GW(p)

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.

Replies from: Vulture
comment by Vulture · 2014-08-10T19:21:58.771Z · LW(p) · GW(p)

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).