Eric Hodel (drbrain) wrote,
Eric Hodel

  • Mood:

Comment Threading

Today I added pagination to the entry view pages. (We're starting to get entries with 100+ comments in them, and the pages are taking a bit too long to render.)

Next up is comment collapsing, but that feels a bit more difficult. Livejournal, for example, has some really fancy algorithm for doing it that looks really good.

Where there is a root comment with a reply that then has a bunch of replies, the root comment and its reply are not collapsed, but all of the 3rd-level children will be collapsed.

It seems that a thread can go as much as 5 deep before it is collapsed if it is linear.

Also, collapsing is only triggered if there's N comments, where I think N is 50.

I guess I should try to wander through the livejournal code base and see if any of it makes enough sense to figure out how they do things so awesomely.

There's just one other question I have... How do I fetch only the comments I need for a page? Right now I fetch all the comments then throw away the ones I don't need (this probably isn't a big deal).

  • Seattle welcomes me home

    Tonight I arrived home from a NYC friends' wedding in Memphis and decide I wanted a burger at Dick's. Unfortunately Dick's failed me in the burger…

  • (no subject)

    Today I saw the police taxi.

  • (no subject)

    I think all police vehicles in washington have license plates ending in D.

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.