Stories
Slash Boxes
Comments

SoylentNews is people

Meta
posted by on Sunday February 26 2017, @01:52AM   Printer-friendly
from the not-actually-an-NCommander-post dept.

Okay, I know it's been a long time since we did one of these but life does intrude on volunteer dev time. Hopefully this one will be worth the wait. Bear with me if I seem a bit off today, I'm writing this with a really fun head cold.

First, what didn't make it into this update but is directly upcoming. Bitpay is still down on account of them changing the API without notifying existing customers or versioning the new API and leaving the old one still up and functional. It's the first thing I'm going to work on after we get this update rolled out but it will basically require a complete rewrite. Don't expect it any earlier than two months from now because we like to test the complete hell out of any code that deals with your money.

Also, adding a Jobs nexus didn't quite make the cut because we're not entirely sure how/if we want to work it. One thing we are certain about, it would not be for headhunters or HR drones to spam us silly but for registered members who have a specific vacancy they need to fill and would like to throw it open to the community.

The API still has some broken bits but it's been low priority compared to what I've been busy with. I'm thinking I'll jump on it after Bitpay unless paulej72 cracks the whip and makes me fix bugs/implement features instead.

There were several other things that I had lined up for post-Bitpay but I can't remember them just now what with my head feeling like it's stuffed full of dirty gym socks.

Now let's throw the list of what did make it out there and go over it in more detail afterwards.

  • Tweaked the themes a bit where they were off.
  • Changed or fixed some adminy/editory stuff that most of you will never see or care about.
  • Fixed a mess of minor bugs not worth noting individually.
  • Improved Rehash installation. It should almost be possible to just follow directions and have a site working in an hour or two now.
  • Added a very restrictive Content Security Policy.
  • Added a link to the Hall of Fame. It was always there, just not linked to.
  • Return to where you just moderated after moderating. (yay!)
  • Return to where you just were after commenting. (yay some more!)
  • Added a field for department on submissions. Editors get final say but if you have a good one, go for it.
  • Added a Community Reviews nexus.
  • Added a Politics nexus.
  • Added <spoiler> tags for the Reviews nexus in case you want to talk about a novel without ruining it for everyone else. They function everywhere though.
  • Changed really freaking long comments to have a scrollbar now instead of being click-to-show.
  • Massively sped up comment rendering on heavily commented stories.
  • Dimming of comments you've already read. (You can turn this off with the controls on the "Comments" tab of your preferences page if it annoys you.)
  • Added a "*NEW*" badge to new comments in case you don't like dimming but still want to easily see new posts. (Disable it the same place as above.)
  • Removed Nested, Threaded, and Improved threaded comment rendering modes (Necessary due to the changes required for the massive speed-up)
  • Added Threaded-TOS and Threaded-TNG comment rendering modes. (TOS is the default)
  • All comment modes now feature collapsible/expandable comments. (Without javascript)

Morning Update: Really digging the constructive criticism. Some quality thoughts in there. Keep them coming and we'll see how fast we can get a few done. --TMB


Before the specifics, I know some of you are going to see the new Threaded modes and be like "that's pretty awesome" and some of you are going to call us dev types very bad names. Well, this ain't the other site. We're not saying "You Shall Use This Because It's New And Shiny". We're saying something had to be done about page load times approaching a full minute on heavily trafficked stories and the way we pulled and rendered comments made up nearly all of that time.

So, the first thing we did was we stopped pulling every single comment and then removing the ones we didn't want to display. Mostly that means that the comment counts in the dropdown menus for Threshold and Breakthrough are on a per-page basis now.

Next we did away with templates for comments. Wildcarded, case insensitive search and replace, even in perl, is horribly slow and that's a large part of how templates worked. The html and related logic is now hardcoded into the source. This did mean though that we had to entirely rewrite all the comment modes logic. Flat and Threaded-TOS are pretty much identical to the old Flat and Threaded, so there shouldn't be any surprises there except that we got rid of the javascript in Improved Threaded and gave every mode collapsible comments with nothing but CSS. Threaded-TNG is new-ish however. It's essentially Nested but without Threshold or every top-level comment being fully visible. If Nested users absolutely cannot live with that, we'll preempt working on the bitcoin rewrite and slap a Nested mode in as well. It shouldn't take but a week, testing included.

Third, we paginated every mode. I know it was nice being able to see every comment on one page but that meant pulling and rendering every comment and that simply doesn't work if a story has over a hundred comments.

The removal of sorting by score we can't roll back though. Its loss was a necessity due to the way we pull and sort only the comments that the user actually requests. Previously, we were pulling every single comment for a story and then removing the ones we didn't want. That was both bloody stupid and slow as hell, so it had to go. Unfortunately it means we have to do things slightly differently. It may make a triumphant return eventually but it would require some moderately tricky coding with the particular way our code is laid out.

Oh and if you have objections to the new Threaded modes, by all means bitch about specifics in comments here and we'll see what we can do to address them. After having spent so much time recently bashing on exactly these bits of code, we're quite familiar with them and changes/additions shouldn't take too terribly long to whip out.

Now to the specifics.

The buttons on the upper left of each comment don't work exactly like the Javascript version did but we do like how they work. The double chevron either shows or hides the comment tree beneath a comment but it does not change their collapsed/expanded state. The single chevron controls the expanded/collapsed state of each comment individually. Adding another button to expand/collapse every individual comment beneath a given comment may be doable but we haven't figured out how so far. It is high on the wish list but not high enough to delay the release any longer than it already has been.

Flat: Flat is still flat but now with a collapse/expand button that functions like the ones from Improved Threaded.

Threaded-TOS: If you can find significant differences between Improved Threaded and Threaded-TOS, let us know because it's probably a bug. The idea was to make it as much like Improved Threaded as technically possible with just CSS but paginated like Nested so we don't have to render more than 100 comments at a go. We defaulted everyone on Nested/Threaded/Improved threaded to Threaded-TOS to minimize the aggravation of unexpected change. Oh, and Breakthrough now takes precedence over Threshold, so high scoring comments will always be visible even if they're responding to blatant trolling.

Threaded-TNG: All comment trees start fully branched out but with the individual comments either expanded or collapsed. "Comment Below Threshold" functionality is gone. Breakthrough gets compared to a comment's score to decide if it gets expanded or collapsed. Play with it a couple minutes; it's not terribly hard to grok. Why do we need this mode if TOS covers most all of the best bits of the three old modes? Because I like it. You don't have to use it. Shut up.

What happened to Nested? What's old is new again. Threaded-TNG more or less is Nested but with the fun bits of Improved Threaded bolted on as well and without the annoyance of having to allow Javascript to run. Minus Threshold functionality. If you spot any serious differences between the two besides those, give us a heads up, because we didn't. It's a very easy mode to code on though, so if you absolutely cannot live without Threshold it's not at all difficult to clone it, add Threshold back in, and call it Nested.

Why not leave the old comment rendering modes in as well as the new ones? Because by rewriting them we got a rendering speed increase around a factor of two+, to go with the factor of two+ increase we got by pulling only the necessary comments instead of every last comment a story has with every page load. This has been becoming necessary as we increasingly go way above the 100 comment mark on busy stories. It's not cool for you lot to have to wait forty-five seconds to load a page of comments and it's even less cool to peg a cpu core for forty-five seconds to deliver it to you. If you ever again find a story that takes 10+s to load, something's going wrong and we'd appreciate a heads up. We think there's still some room in the code for improvement but this was the lowest-hanging fruit.

Now on to the rest of the details.

The Content Security Policy should cover what's required for operation of this site (plus allowing for Stripe payments) and nothing else. If your browser honors CSPs, it should not be possible to get smacked with XSS or inline script injection on this site any more; even if we write code buggy enough to allow it, which we have once or twice.

On dimmed comments... This only functions for logged in users currently as it would take some serious work to get it functioning for individual ACs, even using cookies. What it does is when you load a page of comments, it picks the highest comment ID from that story and marks that comment as read by you. Switching between pages of comments or changing your Threshold/sort order should not update which comments you have read, even if new ones have come in since your last read comment ID was set. Hitting the "Mark All as Read" button or hitting your browser's Refresh button on the main story page should take the stored comment ID and set the opacity to 60% on all the comments with a comment ID equal to or less than that. It's not entirely accurate but it's pretty damned close and it doesn't bloat the db much at all. Oh and read histories get wiped after two weeks of not being updated for a particular user/story combination to save on db space as well.

The new comment badge functions exactly opposite of dimmed comments. It puts "* NEW *" in the title bar of comments you haven't read yet. It's there strictly so you can have the same functionality but dislike the aesthetics of comment dimming. You can technically use both if you really want new comments to stand out but that would just be weird.

Returning to where you last moderated works like this. If you moderate one comment, you'll get sent back to that comment. If you moderate several in one go, you should get sent to the one farthest down the page. Moderating does not update the comment ID of what you've read for dimming purposes.

Returning to where you just made a comment? That's pretty self-explanatory. It also should not update the comment ID of what you've read for dimming purposes.

The Politics nexus. This does not mean we're looking to have even more political stories. The balance of tech/science/etc... to political stories is not going to change nor will the quality of accepted political submissions. It's primarily a way to let people who are sick and bloody tired of seeing politics here set a preference and never see political stories again. It's also handy if you wish to see what political stories we've run recently as clicking on the nexus link on the left of the page will show you only those stories.

The Reviews nexus has been brought up three separate times that I can remember by different groups of people, so we decided to go ahead with it. It's going to be a book/film/software/hardware/etc... review and discussion place. By my understanding, though I'm not really involved, it's getting its own space because some folks wanted to start what amounts to a site book club. Tech books will of course be welcome but it's open to all genres of printed and bound words. Ditto non-book reviews. Just don't go sending in a review of something we normally wouldn't publish news about on the site. Not enough people are going to be interested in your review of the barber shop down the street from your house, so it won't get published.

Spoiler tags, <spoiler>text you don't want casually seen</spoiler>, work both in stories and comments and are just a bit of css trickery that hide the text between them until the person viewing them hovers over the *SPOILER* text. There's a slight delay, so don't think it's not working because it's not immediate. That's intentional so you don't accidentally trigger showing the contained text by briefly crossing it.

By popular demand, <del> tags were also added.

That's all worth mentioning in this site update. Look for another one hopefully in May or late April. If you find any bugs, please slap them up as issues on our github repo or email them to dev@soylentnews.org.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by paulej72 on Sunday February 26 2017, @07:28PM (2 children)

    by paulej72 (58) on Sunday February 26 2017, @07:28PM (#471972) Journal

    What url are you using to access the site. I think our new Content Security Policy may be causing issues. When I tested the frontend servers directly using IP address I saw a page with no CSS.

    When using https://soylentnews.org, [soylentnews.org,] the site is fine when not logged in. When you log in it forces you to that url during the login redirect.

    --
    Team Leader for SN Development
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by Kymation on Sunday February 26 2017, @08:41PM (1 child)

    by Kymation (1047) Subscriber Badge on Sunday February 26 2017, @08:41PM (#471995)

    My bookmark is set to https://www.soylentnews.org/ [soylentnews.org] so that's what I have been using. It's worked up to now, but apparently the www subdomain is no longer resolving correctly. I'll go change my bookmarks.

    The www subdomain should probably do something useful. Maybe you could add a redirect to the URL you want us to use.