LWN.net Logo

LWN Comment Features Update

From:  Jason Smith <jhs-AT-proven-corporation.com>
To:  lwn-AT-lwn.net
Subject:  LWN Comment Features Update
Date:  Thu, 17 Jul 2008 23:42:46 +0700
Message-ID:  <487F7686.8040707@proven-corporation.com>

I have updated fancyLWNComments to work with the new LWN presentation.
LWN readers can download it or see screenshots at
http://www.proven-corporation.com/software/lwn/ or by searching for
"lwn.net" at userscripts.org.

fancyLWNComments is a Greasemonkey script that makes comment threads a
bit more pleasant. The idea is to make some comments less important than
others in terms of screen real estate. Comments you have seen already or
comments from guests can be minimized so that you scan right over them.

   * Collapse comments to save screen space
   * Optionally hide comments you have seen already.
   * Optionally hide comments from guest accounts.
   * Color coding for quick scanning of the thread

If you track LWN threads often and you want to see only the new stuff,
then this is the script for you.

-- 
Jason Smith
Proven Corporation
Bangkok, Thailand
http://www.proven-corporation.com



(Log in to post comments)

LWN Comment Features Update

Posted Jul 19, 2008 0:16 UTC (Sat) by pr1268 (subscriber, #24648) [Link]

> ...recent site changes at LWN.

Changes? What changes? I haven't noticed anything obviously different here. :-)

Not that I'm complaining--one of the reasons I was originally drawn to LWN was/is its simple and straightforward interface. That still appears to be the case, even with the "changes" I don't seem to notice.

Well, maybe I did notice some unfamiliar check boxes and radio buttons on the My Account → Customization page. But, I hardly ever go there anyway.

Thanks for the update, and thanks to the GreaseMonkey developers for the script. I'll certainly give it a try.

LWN Comment Features Update

Posted Jul 19, 2008 6:03 UTC (Sat) by zorro (subscriber, #45643) [Link]

Installed it but don't see the extra Comments menu in the sidebar. Anyone else had more luck?

LWN Comment Features Update

Posted Jul 19, 2008 6:26 UTC (Sat) by jhs (guest, #12429) [Link]

Hi.  The script should come out of the box applying to anything under lwn.net/Articles/.  Do
you happen to be accessing the site under a different domain (www.lwn, maybe)?  Also, please
check that Greasemonkey is enabled within Firefox and that the script is enabled within
Greasemonkey.

If all that seems fine, then what OS and browser are you using?  Maybe I can duplicate your
bug.  I've tested it with Firefox 2 and 3 under Windows and Linux but IMO it can be a little
touch and go.

Thanks.

LWN Comment Features Update

Posted Jul 19, 2008 17:17 UTC (Sat) by zorro (subscriber, #45643) [Link]

Didn't have Greasemonkey enabled. Works now, thanks!

LWN Comment Features Update

Posted Jul 19, 2008 22:02 UTC (Sat) by TxtEdMacs (subscriber, #5983) [Link]

I have Greasemonkey enabled itself and on Firefox.  I also looked in the Account Customization
and saw nothing like the sample.

Last night it said I had to restart Firefox, which I have.  I can think of two potential
problems.  I am warned whenever data is sent as clear text, e.g. passwords that show asterisks
but are unencrypted.  I have seen that interfere with some other functionality.  The other is
that I retain a number of tabs between shutdown and restarting, I have noticed that despite
the setting, if I do not manually refresh each tab it retains the information from the last
time it was refreshed. [I assure you my about:config is set properly, it just does not seem to
work when I close all tabs each day instead of crashing the browser.]

Any suggestions?

LWN Comment Features Update

Posted Jul 19, 2008 23:17 UTC (Sat) by csawtell (guest, #986) [Link]

It works, but to get it to go I had to:-

Use the link in the LH column to log out of LWN.
Close Firefox.
Restart Firefox
Log into LWN
Click on '+' sign box beside "Comments".

Intuitive? Not in a million years.

I just happen to have been using computers for 30+ years and have discovered that I can often
get things to work by intelligent fiddling.

I'm hoping that I can lighten the highlight colours by editing the script.

Otherwise it's rather nice.

btw,

I use a ThinkPad, which has a 1024x768 screen, and the LWN Articles are a pixel or three too
wide causing the horizontal scrollbar to be activated.
Please could you make the script adjust the width of the table, or what ever it is, to make
the pages fit properly?

OTOH, Jon might care to change the original HTML which he uses?

LWN Comment Features Update

Posted Jul 19, 2008 23:54 UTC (Sat) by TxtEdMacs (subscriber, #5983) [Link]

RE: Click on '+' sign box beside "Comments"

The "+" sign was not showing on my page.  Thanks for the advice.  I still suspect my Firefox
configuration(s) are part of the problem.  I allowed temporary java and javascripts that I
guess were locked, but that too yielded no obvious sign of the missing symbol.

I will run through it one more time.  If it works I will write, otherwise wait or do without.
As some said the comments are already set up nicely.

LWN Comment Features Update

Posted Jul 20, 2008 0:46 UTC (Sun) by csawtell (guest, #986) [Link]

Is the GreaseMonkey icon / Avatar showing up in the bottom RH corner of the Firefox window?

And what version of FF are you running?
( Help -> About Firefox )
It's the number to the right of the word "Gecko" that's the magic.

LWN Comment Features Update

Posted Jul 20, 2008 11:06 UTC (Sun) by TxtEdMacs (subscriber, #5983) [Link]

RE: Is the GreaseMonkey icon / Avatar showing up in the bottom RH corner of the Firefox
window?

Yes, had not noticed previously.  Left mouse button can disable/enable it and the right shows
it to be enabled (noticed that when the icon is faded, the right button still says it is
enabled, but lacks the check symbol).  Other options shown:

No scripts installed! (faded)
User scripts commands ... (faded)
New user scripts ... (active)
Manage user scripts ... (active) [saw this box previous, empty]
Enabled (active)

RE: ... version of FF are you running
2.0.0.12 under the Ubuntu 6.06 desktop, 32bit version.

and the number to the right of Gecko: 20080201

I am running behind on the update, because any day now I will be moving to a later version.
However, I have discovered a strange flaw when I run my dual monitor setup, which requires (so
far) the use of the nVidia proprietary video driver.  Both the legacy and the next version
once installed makes it impossible to reach an X terminal.  I can exit X to use the command
line, which I will do on a server, but I would rather not resort to on a desktop.  [The
version of Ubuntu having this problem is 7.10, I had been a bit leery about a quick move to
8.04 having read the complaints here shortly after its release.]

I would not put too much effort into my set of components, because my hardware is relatively
old, as is my desktop and even the Ff version.  I can live with the comments section as is
without difficulty.  Moreover, I expect soon to be using a more recent version of Firefox when
I upgrade my desktop.  Indeed, if it would help the account I reserve for maintenance has a
running version of the second beta of Firefox 3.  I could test to see how well Greasemonkey
works there.

LWN Comment Features Update

Posted Jul 20, 2008 5:25 UTC (Sun) by jhs (guest, #12429) [Link]

Hi.  The "+" sign is a small image that is embedded in the script as a base64 string and then
rendered using Firefox's special "data:" URL.  This avoids the need to go out and fetch an
image over the network.  Perhaps you are having trouble because your Firefox won't render the
data: URL.

Originally I made the word "Comments" not clickable because other headings (e.g. "Recent
Features") are not clickable.  But now that I hear about some users not seeing the "+" or "-"
expander, I think I will update the software so the word itself can explode/implode all the
options.

Thanks for your feedback.

LWN Comment Features Update

Posted Jul 20, 2008 11:14 UTC (Sun) by TxtEdMacs (subscriber, #5983) [Link]

As I indicated in the previous comment, I am running behind current hardware and software.
Therefore, do not expend too much effort to make my system work, since I too am attempting to
move to later software on the desktop and browser versions.

I know that some retained the Firefox 1.5 version, which I could not understand when I was a
bit active testing the beta.  Indeed I moved to version 2 before it was "ready" and happily
never looked back.  Indeed while I am still using an older version of Firefox 2, I am
determined to move to 3 when I upgrade my desktop.  I ran every one of the alphas, but one I
missed and up to beta 2 where my system was too behind the times to work on the later
versions.  So please focus your efforts where they do the most good.

LWN Comment Features Update

Posted Jul 20, 2008 12:01 UTC (Sun) by jhs (guest, #12429) [Link]

Well, I've already pushed out a new version that makes the whole "Comments" label clickable.
So you might be able to re-install the script and get the functionality there.

Another option is go to to about:config and search for "widget open" (it should show up under
the Greasemonkey namespace).  Set the value to "true" and then the panels will appear open by
default when you view an article.

Hope that helps!

LWN Comment Features Update

Posted Jul 20, 2008 16:57 UTC (Sun) by TxtEdMacs (subscriber, #5983) [Link]

This may tell a bit more about the problem I am seeing:

RE: Another option is go to to about:config and search for "widget open" (it should show up
under the Greasemonkey namespace).

Only have three Greasemonkey settings: enable, lastupdate and version.  Should I insert it
manually?

Values, respectively: true, 1216571699116 and 0.8.20080609.0

Perhaps more important, despite the line "Manage user scripts" seeming to be active, there is
no content.  That is, when I go there despite the edit option nothing is showing.

I am going to go through the logout, shutdown and reopen to see what if any changes result.
If I see no difference, I will remain silent.

LWN Comment Features Update

Posted Jul 20, 2008 5:13 UTC (Sun) by jhs (guest, #12429) [Link]

Hi.  Thanks for the feedback.  For the record, yes the options are in an expandable "Comments"
section which appears in the left sidebar for all LWN articles (matching the wildcard
"lwn.net/Articles/*" in fact).

I'm sorry if it's not intuitive, although I should point out that a million years is quite a
long time.  It started out for my own private usage but I went ahead and published it as-is
last year.

It is very easy to change the colors.  They are in a variable in the first executable line of
code in the script.  My first attempt was to pop up a color selection dialog when you click
the colored boxes on the left, but it didn't work out too well, so I might fall back to a
simple text input with the hex values.

I've used a Thinkpad too (R60) and I don't think I've seen the bad width problem that you
mention, but I like your idea and I suspect it will be easy to implement.  So I'll get back to
you on that.

LWN Comment Features Update

Posted Jul 20, 2008 15:23 UTC (Sun) by jhs (guest, #12429) [Link]

I pushed out a new version that lets you change the colors right from the GUI.  Just click on
the little colored boxes next to each type of comment and a prompt comes up where you can
input any hex color value.

LWN Comment Features Update

Posted Jul 21, 2008 9:51 UTC (Mon) by jhs (guest, #12429) [Link]

Okay, once you pointed out the horizontal scroll bar, I realized that it happens to me on
practically every page and now it is driving me crazy.

I pushed out a new version with a "Correct Width" option, which when enabled will prevent
comments from overextending on the right side.  It works for me on Firefox 3 (even with a
browser width of 800px or so); but untested on version 2.

That effect actually seems to me like a bug, although whether in LWN or Firefox, I'm not sure.
It happens because non-HTML comments ("Plain text" is selected in the form) are wrapped in a
<pre> tag, which does not seem to obey the width restrictions of the CSS.  My fix generates a
normal HTML version and, while it can mess up the flow of some posts, I feel like I can't live
without it already.

Thanks again for the feedback.  Perhaps in a month or so, I will announce a new version that
implements all the features requested in this thread.

LWN Comment Features Update

Posted Jul 21, 2008 0:03 UTC (Mon) by mrons (subscriber, #1751) [Link]

Thanks for this script. It's working very well for me.

I don't know if it's doable but an extra feature I'd like to see is a filter for the front
page that changes the "comments (10 posted)" to something like "comments (10 posted, 5
unread)"

If the number of unread comments is hard to track, is it possible to just change the colour,
say, of "comment" if there are unread comments?

LWN Comment Features Update

Posted Jul 21, 2008 4:15 UTC (Mon) by jhs (guest, #12429) [Link]

The script only works within the /Articles subdirectory of the site. I suspect, however that I could activate it for the entire LWN site and have it fix the "comments: XX" text in the article summaries as well as the color-coding within the articles themselves. That is probably not too difficult, although I'm a bit of a Greasemonkey noob.

More importantly, since each comment has an ID (which it extracts from the "[Link]" anchor), the script only keeps a record of seen IDs. Without visiting the page and building a list of post IDs, the script has no idea what is seen and unseen yet. A solution is to maintain an additional mapping from article IDs to the number of seen articles, and just compare the number we store locally vs. the total number of comments LWN counts. Yes, I think that could work.

This is an interesting idea. I will add it to the TODO list. At the moment, the only way to keep track of the progress is to track the Git RSS feed directly.

LWN Comment Features Update

Posted Jul 21, 2008 6:32 UTC (Mon) by njs (guest, #40338) [Link]

I was expecting that when I read a page of comments, that would automatically mark them read
for the next time I came back.  Apparently, though, I have to hit the "mark all read" button
instead.  Which is okay, but... if it's intended to work this way, then could we please have
another "Mark all read" button at the *bottom* of the page, so we don't have to remember to
scroll back up and hit it after reading the comments on a page?

LWN Comment Features Update

Posted Jul 21, 2008 8:02 UTC (Mon) by jhs (guest, #12429) [Link]

Thanks for the feedback.  The original version did mark all read automatically, but I didn't
like it, as I often open a page in a tab and then never get around to reading it--or I only
read the article but not the comments.

I think a button at the bottom should be pretty easy, so I'll add that to the TODO and
implement it for the next version.

LWN Comment Features Update

Posted Jul 21, 2008 13:20 UTC (Mon) by Los__D (subscriber, #15263) [Link]

Maybe also add the possibility to auto-mark read pages, as an option?

LWN Comment Features Update

Posted Jul 21, 2008 13:52 UTC (Mon) by jhs (guest, #12429) [Link]

Yes perhaps it could be an option.  Honestly, it's easy to implement but the most difficult
part is making the UI work halfway decently.  It's a very small area, with little horizontal
space.  So it quickly becomes crammed with config widgets.

Anyway I will add this to the TODO as well.  In my opinion, there's nothing wrong with a
zillion checkboxes going down in a line.  I think people who care about long LWN threads and
who install Greasemonkey have already met the power-user prerequisite.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds