Show HN: Collapse HN Comments
github.com
github.com
In addition to collapsing threads, it also tastefully identifies new comments: http://i.imgur.com/qs6FDRU.png
It doesn't mess with the layout beyond that, which I like.
By the way, http://hckrnews.com/ itself is wonderful. It's HN, but in chronological order. That seems like a bad thing, but in fact there are only a few dozen submissions per day, and it's easy to pick out the interesting ones.
[1] https://userstyles.org/styles/81626/jellybeans-hacker-news-w...
javascript:var jq=document.createElement("script");jq.src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";document.getElementsByTagName("head")[0].appendChild(jq);window.setTimeout(function(){jQuery.noConflict();jQuery("span.comhead:contains('minutes ago')").parent().parent().css("background","#fdfdf0");jQuery("span.comhead:contains(' 0 minutes ago'), span.comhead:contains(' 1 minutes ago'), span.comhead:contains(' 2 minutes ago'), span.comhead:contains(' 3 minutes ago'), span.comhead:contains(' 4 minutes ago'), span.comhead:contains(' 5 minutes ago'), span.comhead:contains( '6 minutes ago'), span.comhead:contains(' 7 minutes ago'), span.comhead:contains(' 8 minutes ago'), span.comhead:contains(' 9 minutes ago'), span.comhead:contains(' 10 minutes ago') ").parent().parent().css("background","#ffffe9")},500)https://chrome.google.com/webstore/detail/hacker-news-enhanc...
edit: I'll also mention that I use http://hckrnews.com/ as my frontpage for HN.
Notably, it preserves the compactness of the front page. A lot of other styles tend to space out stories on the front page too much, which makes it harder to read through.
I do wish there was a similar theme for Firefox.
I also made one (for Firefox/Greasemonkey),
Naw, everyone replying to the top comment in a post in order to be seen is probably fine.
[0]: https://i.imgur.com/Bp3ra28.png
[1]: https://en.wikipedia.org/wiki/Fitts%27s_law
[2]: https://github.com/defunkt/dotjs
td { vertical-align: top }
td > img { background: repeating-linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0) 38px, rgba(0,0,0,0.3) 38px, rgba(0,0,0,0.3) 40px); margin-top: 4px; height: 12px!important }
div.votearrow { padding-bottom: 3px; background: url('https://i.imgur.com/UVPQXRX.png') !important; width: 20px!important;}I get that some people don't want anything to change on HN - no problem - but what is the harm in adding features that we individually can turn on that would not effect anyone else? Aka, add the features but have them off by default.
Pure speculation, but maybe they know the best hackers will find solutions around all this (e.g. all the extensions linked to in this thread).
I think its ridiculous that something with so much traction gets so little love and people have to create extensions to fix some of the basic site interactions.
https://addons.mozilla.org/en-us/firefox/addon/hn-utility-su...
javascript:(function()%7Bfunction%20getScript(url,success)%7Bvar%20script=document.createElement('script');script.src=url;var%20head=document.getElementsByTagName('head')%5B0%5D,done=false;script.onload=script.onreadystatechange=function()%7Bif(!done&&(!this.readyState%7C%7Cthis.readyState=='loaded'%7C%7Cthis.readyState=='complete'))%7Bdone=true;success();script.onload=script.onreadystatechange=null;head.removeChild(script)%7D%7D;head.appendChild(script)%7DgetScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',function()%7Bif(typeof%20jQuery!=='undefined')%7Bif(!$('body').hasClass('collapsible-comments'))%7B$('body').addClass('collapsible-comments');var%20span_html='%3Cspan%20style=%5C'cursor:pointer;margin-right:10px;%5C'%20class=%5C'expand-handle%5C'%3E%5B-%5D%3C/span%3E';if(window.location.href.indexOf('item?id=')!=-1)%7B$('center%20%3E%20table%20%3E%20tbody%20%3E%20tr:eq(2)%20%3E%20td%20%3E%20table:eq(1)%20span.comhead').prepend(span_html)%7Delse%20if(window.location.href.indexOf('threads?id=')!=-1)%7B$('center%20%3E%20table%20%3E%20tbody%20%3E%20tr%20%3E%20td%20%3E%20table%20span.comhead').prepend(span_html)%7D$('.expand-handle').live('click',function()%7Bcurrent_level_width=parseInt($(this).closest('tr').find('td:eq(0)%20%3E%20img').attr('width'),10);$(this).closest('table').closest('tr').nextAll().each(function(index,el)%7Bvar%20elWidth=parseInt($('tbody%20%3E%20tr%20%3E%20td%20%3E%20img',this).attr('width'),10);if(elWidth%3Ecurrent_level_width)%7Bif(elWidth%3C=inner_level_width)%7Binner_level_width=1000;$(this).hide()%7Dif(inner_level_width==1000&&$('.comment',this).css('display')=='none')%7Binner_level_width=elWidth%7D%7Delse%7Breturn%20false%7D%7D);inner_level_width=1000;$(this).text('%5B+%5D').addClass('expand-handle-collapsed').removeClass('expand-handle');$(this).closest('div').nextAll().hide();$(this).closest('div').parent().prev().hide();$(this).closest('div').css(%7B'margin-left':'18px','margin-bottom':'5px'%7D)%7D);$('.expand-handle-collapsed').live('click',function()%7Bcurrent_level_width=parseInt($(this).closest('tr').find('td%20%3E%20img').attr('width'),10);$(this).closest('table').closest('tr').nextAll().each(function(index,el)%7Bvar%20elWidth=parseInt($('tbody%20%3E%20tr%20%3E%20td%20%3E%20img',this).attr('width'),10);if(elWidth%3Ecurrent_level_width)%7Bif(elWidth%3C=inner_level_width)%7Binner_level_width=1000;$(this).show()%7Dif(inner_level_width==1000&&$('.comment',this).css('display')=='none')%7Binner_level_width=elWidth%7D%7Delse%7Breturn%20false%7D%7D);inner_level_width=1000;$(this).text('%5B-%5D').addClass('expand-handle').removeClass('expand-handle-collapsed');$(this).closest('div').nextAll().show();$(this).closest('div').parent().prev().show();$(this).closest('div').css(%7B'margin-left':'0','margin-bottom':'-10px'%7D)%7D)%7D%7D%7D);var%20current_level_width=0;var%20inner_level_width=1000%7D)();https://chrome.google.com/webstore/detail/social-hotness/aha...
In addition to collapsing, it highlights new comments and shows how many new comments there are on story list pages since you last looked at the full thread.
If you click the "X new" link it adds, it automatically collapses all threads which don't have new comments on page load.
Screenshot of that: https://twitter.com/jbscript/status/462657449497874432/photo...
It will allow you to collapse comment trees on HN.
1: https://github.com/andrewheins/HN-Comment-Hider
edit: This has the collapse button between the voting arrows and username, just like reddit. Seems like something minor, but it's a big detail. (1) I'm used to that location from reddit, and (2) it doesn't move, which isn't the case with many other extensions that have it on the end.
http://i.imgur.com/t46u0C5.png
Thanks Chrome!
Check that and you should be presented with a "Load unpacked extension" that you can use to install extensions locally.
var currentRow = comment.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling;
Lotta parentNodes!
Probably best to sort of consolidate some of these into a few really good ones, but we'll see.
https://github.com/AbdullahDiaa/hn-collapse
https://github.com/AbdullahDiaa/hn-collapse/blob/master/hn-c...
Hope that helps.
[0] https://chrome.google.com/webstore/detail/hacker-news-collap...
Follow other HN users, notifications when replied to, notifications when your karma changes, notifications when followed, comment viewing while on article/video/page, and chat.
would be a nice-to-have on the README
- You can collapse threads (children and parents).
- Use keyboard shortcuts (j-next / k-prev / x-collapse+next)
- Light/Dark Theme
Is there a extension to highlight messages since last visit?
The tree is not really good on longer discussions, you did not find the new messages.