Oooo Sexy: Inline Comments

pudge on 2008-03-20T18:20:36

Comment replies in Slash, on use Perl and soon on Slashdot, if you have "D2"/"Dynamic Discussions" enabled, will now be inline, on the same page. Ajaxy goodness. Never leave the page to reply to an article or journal or comment. Click Reply, box loads in, type your reply, hit preview, then see preview, then hit submit, then new comment magically appears on the page.


Nice

Smylers on 2008-03-27T13:54:43

Being able to see what you're replying to is a massive advantage.

Thanks.

Reliability first

stu42j on 2008-03-27T14:26:14

The use.perl server really needs to get more reliable before this ajax stuff will be usable. The frequent connection timeouts make it impractical.

Re:Reliability first

pudge on 2008-03-27T15:11:55

Maybe it's you? I have very rare timeouts.

Re:Reliability first

stu42j on 2008-03-27T15:20:33

Nope, not just me.

http://use.perl.org/comments.pl?sid=38429
http://use.perl.org/user/Ovid/journal/35576

Re:Reliability first

pudge on 2008-03-27T16:14:45

Those connection issues were two months ago. I know the site can be slow occasionally, and during code refreshes we can be down of course, but I've noticed no significant connection issues recently.

Re:Reliability first

stu42j on 2008-03-27T16:28:53

The connection issues have been less frequent but certainly haven't gone away. If the downtime is caused by code refreshes, I wouldn't know. Perhaps I'll email you next time it happens.

Re:Reliability first

Aristotle on 2008-03-27T18:17:10

What irks me personally is that the entire eight hundred sixty kilobytes YUI albatross is loaded every other time I visit even though I have disabled the Slash Ajax stuff in my prefs.

I know I can check the box to enable the Ajax UI on any page I look at, should I ever change my mind, and that the Ajax UI then immediately starts working, which means some Javascript is needed. But you’re loading jQuery as well anwyay, which is tiny and perfectly servicable for loading extra libraries on demand. It should be easy to load YUI via jQuery, and to make that conditional on whether the Ajax UI is enabled.

Re:Reliability first

pudge on 2008-03-27T19:35:35

What irks me personally is that the entire eight hundred sixty kilobytes YUI albatross is loaded every other time I visit ...
Then stop clearing your cache! And use a browser that handles compression.

... even though I have disabled the Slash Ajax stuff in my prefs
No, you don't. You have Discussion 2 disabled. That's only one specific thing that uses Ajax on the site

... you're loading jQuery as well anwyay ...
As of a couple of weeks ago.

It should be easy to load YUI via jQuery, and to make that conditional on whether the Ajax UI is enabled.
We don't use YUI for Ajax.

Actually, we don't even use YUI for any of Discussion 2.

You make some valid points, but you really don't know the code nearly well enough to be making the assertions you do.

Re:Reliability first

Aristotle on 2008-03-27T20:46:49

I may not know how Slashcode works, but I am no web dev greenhorn. I know what can be done in HTML with and without Javascript, and the interface I do actually use is trivial to implement without any use of Javascript whatsoever, let alone Ajax. If there are still Ajax features somewhere, they are utterly wasted on me, and so is the site’s bandwidth and mine.

As for the browser cache:

  1. Sorry, but it’s finite. I would like to increase it since I have disk space to spare, but disk cache lookup does not appear to scale tolerably to the GB range in any of the browsers I’ve tried – and with 90 tabs being open routinely (with quite some churn), the 50MB I’ve granted Firefox are pretty tight.

  2. There’s no Expires header in sight when I request those URIs (despite the query string fudging). So the browser is at least going to keep checking whether the files have changed, anyhow.

Re:Reliability first

pudge on 2008-03-27T21:09:24

I am no web dev greenhorn
I didn't imply otherwise. Indeed, I directly limited my claim of what you don't know to Slash, and I noted that you made valid points, but that they didn't apply as you asserted.

If there are still Ajax features somewhere, they are utterly wasted on me
Of course, you don't actually know that. And again, you also don't understand YUI very well since you seem to think it is primarily about Ajax. As to what YOU think is trivial to implement, I am uninterested in knowing.

I would like to increase it since I have disk space to spare ...
That is your choice.

There's no Expires header in sight when I request those URIs
Yes. There doesn't need to be. We use Cache-Control/max-age. Now, that is not there either right now, but it was there recently and will be back again soon.

Re:Reliability first

Aristotle on 2008-03-27T21:37:38

So how about giving an example of how a feature I use requires YUI stuff, instead of skirting the matter with “you don’t know what it’s for” hints?

Here’s a summary of how I use the site: I read the site mainly via several search.pl feeds, and hit the site in the browser only to read comments, which I’ve set to nested mode, and to leave comments, which I do via the Reply links that lead me to a page with a very plain HTML form. None of these interactions happen without a page load.

What part of this requires any Javascript?

Re:Reliability first

pudge on 2008-03-27T21:55:49

So how about giving an example of how a feature I use requires YUI stuff
/me mumbles something about pearls before swine

Re:Reliability first

Aristotle on 2008-03-27T22:43:06

Right, I shouldn’t have expected an actual, straight answer. So, I’ve blocked images.use.perl.org and cleared my cache. Nothing appears to have broken, other than missing stylesheet.

But I’m sure there’s something I need YUI for that I don’t know anything about.

Re:Reliability first

pudge on 2008-03-27T23:37:22

Right, I shouldn’t have expected an actual, straight answer
Correct. When you act like I owe you something, you get nothing.

Re:Reliability first

Aristotle on 2008-03-28T02:07:18

Well, use.perl is where the community is, so I have to put up with Slashcode. I suppose that given sufficient effort, the resultant complaints can be interpreted as a sense of entitlement; refusing to address any of the actual issues is then a reasonable response.

Re:Reliability first

pudge on 2008-03-28T02:29:13

Well, use.perl is where the community is, so I have to put up with Slashcode
And I have to put up with you. I think I got the worse of the bargain.

Re:Reliability first

Aristotle on 2008-03-28T03:35:50

Such is the curse of success.

Re:Reliability first

ChrisDolan on 2008-04-30T04:28:05

Hi Chris,

I've been fighting the same problems on a website I'm working on (using scriptaculous instead of YUI, but the same issues with large JS). I've got a couple of easy tricks to get huge compression.

I use yuicompressor to squish my JS and then gzip it. Simple .gz content works smoothly on all browsers except Safari. To make it work with Safari too, all you have to do is name your file .jsgz instead of .js.gz and then do the following in your apache conf:

    <files *.jsgz>
      ForceType text/javascript
      Header set Content-Encoding: gzip
    </files>
With those tricks, I predict use.Perl.org can get about a factor of 20 compression. The tricks work on CSS files too with a lower compression ratio.

If the above interests you, I'd be happy to volunteer an hour or two to dig into slashcode to help implement -- basically a simple tool to make the gz files. I run my tool a mod_perl launch time, but it could be part of any deploy step.

I agree that cache mitigates the problem, but it's so easy to fix that the payoff is worthwhile.

Hidden comments

stu42j on 2008-03-28T15:24:00

Is there an option I can change so that Score:1 comments will not be hidden by default? I looked in the D2 Prefs link and the standard user Preferences but couldn't find it. --thanks.

Re:Hidden comments

stu42j on 2008-03-28T15:29:39

Maybe it is not score:1 that is the problem so here is an example. On this journal below, there is a comment titled "nearlyfreespeech.net" but it does not show up. Not even with a "1 hidden comment" link.

http://use.perl.org/user/renodino/journal/35971

Re:Hidden comments

pudge on 2008-03-28T16:21:29

See that widget thingy with the white and dark grey slider bars? Drag those around. This changes your thresholds.

Re:Hidden comments

stu42j on 2008-03-28T16:38:10

Ah, I probably moved those around not realizing it was doing anything. Also, it doesn't quite work. If I move the slider to 0 Hidden all this blank space opens up where the comments should be but they are still not visible. If I reload the page, they are now visible so it is not really a problem.

Also, I am using Firefox 3 B4, in case that is the problem.

Re:Hidden comments

pudge on 2008-04-03T00:41:46

This should be fixed now. Did a major overhaul and upgrade of a lot of the D2 stuff for this week.