85

History

  • June 6, 2012: Fixed an issue that can cause major problems with chat.
  • December 17, 2013: Fix an incompatibility with the Winter Bash code.

Screenshot

Before:

comments without threading

After:

comments with threading

About

Instead of showing comments in chronological order, this user script displays them in a threaded view, making it easier to follow conversations in long comment threads.

It uses heuristics similar to the @-reply recognition (but it is a little bit more flexible).

It should be noted that this may obviously change the order in which comments are displayed, so you cannot rely on a chronological order anymore. In most cases this doesn't matter, but sometimes it just might.

Update 2011/07/10: As suggested by George Edison, now offers a button to undo the threading on a particular post, in case you want to see the comments in their regular order. I'm not 100% happy with the UI, but I guess it's good enough. The script also got a little smarter about finding the replied-to comment.

Download

install / update scriptview source

Platform

I have tested this script in Chrome (Windows 7), Chromium (Fedora 14), and Firefox + Greasemonkey (both OSes).

Contact

This script is created by Benjamin Dumke-von der Ehe. Note that this is a free-time project of mine, and has nothing to do with my employment at Stack Overflow. See my profile for contact details; you can also often find me in the Tavern on Meta Stack Exchange chat.

18
  • hm, can one award a bounty to a "question"? as in "reward the author for this awesome script"? Commented Feb 21, 2011 at 8:46
  • Working well with opera too.
    – LifeH2O
    Commented Aug 8, 2011 at 14:43
  • It seems like that, recently, it stopped displaying the @mention in threads. While I can live with this in threaded mode, it removes a bit of context in unthreaded mode. Commented Mar 20, 2012 at 22:50
  • @Nullable I don't understand. The script doesn't change the content of the comments. What exactly do you mean?
    – balpha Staff
    Commented Mar 29, 2012 at 20:28
  • @balpha, sorry about that, my bad. I thought it did it, that it still happens after I disable it. I think I just misunderstood the algorithm it uses for detecting threads. Commented Mar 30, 2012 at 0:14
  • WOuld it be possible for this to 'minimise' some threads on a button click or something...? Commented Sep 11, 2012 at 10:12
  • @Pureferret Can you give an example of what you mean by that?
    – balpha Staff
    Commented Sep 11, 2012 at 11:08
  • In your example I might not care about what happened after Slaks replied to Pekka, so I'd like someway to hide replies after that, i.e. minimise them. Commented Sep 11, 2012 at 11:57
  • @Pureferret Hmm, I see your point, but it's somewhat problematic in that this script really only does guesswork (even if fairly educated guesswork) as to what is a reply to what. I fear that with such a functionality as you request, it creates a too confident impression of its abilities.
    – balpha Staff
    Commented Sep 12, 2012 at 10:16
  • But if it's minimising the wrong stuff (because it's not a reply) it's going to be threading wrongly too? The error should be consistant and tracable to the root cause, if the minimisation runs on what is being threaded already. I've not looked at the source yet but I'd imagine that's how it's written. Commented Sep 12, 2012 at 10:33
  • @Pureferret You're absolutely right, it would be identical. I'm not thinking about technical issues, more conceptual issues. It should also be noted that most comment threads are fairly short, and any additional user interface functionality creates an additional burden, so you'd have to weigh the two. I don't actually have strong feelings about your proposal; I'm just not quite convinced.
    – balpha Staff
    Commented Sep 12, 2012 at 12:15
  • 1
    userscripts.org is down :( Is there a GitHub mirror or something? I'd also really like it if a browser extension (especially Chrome) was available, so it would automatically sync to all my desktops. I'd be happy to handle the conversion for you, if you can tell me where to get the source ;D Commented Jun 3, 2014 at 16:05
  • 1
    404 error on bitbucket.org/balpha/user-scripts/raw/tip/threading-comments/….
    – user598527
    Commented Jan 28, 2021 at 22:31
  • 1
    @VidathD: hover over the comments, it'll appear to the top left of the first comment. See the screenshot in my answer post below, where it is visible. When you click it, threading is turned off, and the button becomes a 'thread' button; the button disappears when you mouse out again. Commented May 4, 2022 at 16:40
  • 1
    @fixer1234: You'd post an 'answer' here on Stack Apps, I guess. Note that the unthread/thread toggle works fine for me in current versions of Chrome, Firefox and Safari, at least for the release I recovered (see my answer below). Commented May 4, 2022 at 16:41

3 Answers 3

8

Balpha's Userscripts repository is gone, and no replacement has been made available yet.

So I recovered the script from my browser and put it in a gist:

It continues to work without issue:

Screenshot of this post with 2 comments, threaded by the script

2
  • Does it still work? I haven't used it in many years.
    – balpha Staff
    Commented May 4, 2022 at 16:24
  • 3
    Miraculously, it absolutely does! I added a screenshot to prove it. :-) Commented May 4, 2022 at 16:30
2


Very nice comments thread. Could it be made to display threads 1 deep (like Stack Apps basically does), and maintain the chronological order of the original comments?

For example (imagine dates where appropriate):

I love it! One small request: can you please add a button to undo the
rearrangement? Sometimes it's easier to see the comments in their original
order. –  Nathan Osman♦ Feb 20 '11 at 6:03

   -- hm, can one award a bounty to a "question"? as in "reward the author for
   this awesome script"
      Tobias Kienzler Feb 21 '11 at 8:46

   -- Working well with opera too. –  LifeH2O Aug 8 '11 at 14:43

It seems like that, recently, it stopped displaying the @mention in threads.
While I can live with this in threaded mode, it removes a bit of context in
unthreaded mode. –  Teo Klestrup Röijezon Mar 20 '12 at 22:50

@Nullable I don't understand. The script doesn't change the content of the
comments. What exactly do you mean? –  balpha♦ Mar 29 '12 at 20:28
1

I'm using the following matches to run on all metas and also on SO in Portuguese.
Area51 is matched by *.se.com/*.

// @match       *://*.askubuntu.com/*
// @match       *://*.mathoverflow.net/*
// @match       *://*.serverfault.com/*
// @match       *://*.stackapps.com/*
// @match       *://*.stackexchange.com/*
// @match       *://*.stackoverflow.com/*
// @match       *://*.superuser.com/*

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .