Bookmarklet to Hide Nested Comments

post by witzvo · 2013-10-16T05:55:12.029Z · LW · GW · Legacy · 3 comments

Contents

  How do I try it?
  What's the code?
None
3 comments

When reading comments on Less Wrong, I sometimes find myself reading reply after reply deep into a discussion when I really shouldn't be. If I had stopped and thought, I would have said, let's move on to the next thread. Similarly, I've seen comments that pose an interesting question or raise an interesting point get derailed because the first response to that post nitpicks on some issue and reply after reply delve into that. By the time I get to another child of the original comment that addresses its main point, I've exhausted myself.

This is nobody's fault but my own: the nesting mechanism is sound, the default behavior is reasonable, and the show/hide features are right there, but I don't find myself using them as much as I should.

As an experiment to see if I can improve my behavior I created this bookmarklet: Hide Nested Comments

EDIT: The link isn't working right now. It should link to: javascript:var%20cl=$$('div.comment');for(var%20i=0;i<cl.length;i++){a=cl[i];if(a.parentNode.parentNode.id!='comments')hidecomment(a.id.replace(/^[^_]*_/,''),a)};void(0);

but it doesn't. Sorry. Presumably I'm in violation of some security policy by attempting to make a bookmarklet in a post. If you trust me, you can create a bookmark with that as the destination yourself, but the directions below about dragging won't work.

What it does is pretty simple: it hides all comments on a post that aren't top level comments. This way, the default is that I don't see all the followups unless I decide that the subject matter is important enough that I want to wade into it. It makes it more effort to dig into subjects that interest me, but (hopefully, at least) I'll get less distracted where I shouldn't and a few more clicks won't kill me.

The biggest drawback I'm aware of right now is that it means that I'll start missing interesting content that's buried under uninteresting content (arguably I'm missing most of those anyway). A fancier version might, for example, label the hidden posts with the maximum buried karma.

Anyway, it's an experiment. Feel free to try it yourself and report back, or tell me why you think it's a terrible idea.

How do I try it?

One way is to turn on your browser's bookmark toolbar and drag the above link onto that toolbar. Click on it on the toolbar to use it. If you don't like the results, just refresh. Another way, in Firefox, is to right-click (control-click on Mac) on the link and choose bookmark this link.

What's the code?

The javascript that makes the bookmarklet work is:

var cl=$$('div.comment'); // a list of all the comment divs on the page
for (var i=0; i<cl.length; i++) {
a=cl[i]; // take each in turn (forgot "var", sigh)
if (a.parentNode.parentNode.id!='comments') hidecomment(a.id.replace(/^[^_]*_/,''),a); // unless it's top-level, hide it
};
void(0);
// (yeah, I could use .each(...), but I didn't; it's just a hack at the moment anyway)

3 comments

Comments sorted by top scores.

comment by witzvo · 2013-10-29T18:15:19.323Z · LW(p) · GW(p)

Usage report: I've been using this bookmarklet for about two weeks now. I've found that I successfully do reduce the amount of time I spend getting lost in low-priority comment threads by using it. I still manage to pursue comments of interest to me. For me it's a net positive.

It's less clear that it'd be good for the site if it was widely adopted. It might be, since it would drive attention toward "high-level discussion" and away from interesting asides. A drawback would be that the discussions in those asides wouldn't be monitored as closely.

Anyway, there seems to be no danger of that from the level of response on this page.

comment by Viliam_Bur · 2013-10-16T07:43:26.223Z · LW(p) · GW(p)

I guess it should be relatively easy to add this button directly to the site, if enough readers like it.

comment by BaconServ · 2013-10-16T07:03:29.552Z · LW(p) · GW(p)

It's no less a hack than a button built-in to the site to do the same thing would be a hack. I can verify the posted script is harmless.