1. 6

I was surprised to discover that “Your Threads” only goes back one month. I wanted to follow up with someone on an old thread, but can’t find it.

I tried search (https://lobste.rs/search) but there’s no obvious way to restrict the search to my own comments.

Is there some way to get a page that lets me go through all my comments, sorted newest to oldest?

Feel free to wipe this story if it’s inappropriate. I’m not sure the right place to ask this.

  1.  

  2. 6

    According to @pushcx two months ago, there is currently no page that lists all of your comments: https://lobste.rs/s/cgtc2w/happy_7th_anniversary_lobsters#c_hfknb5.

    Approaches for implementing this feature

    Around the time of that thread, I looked into how to edit the Lobsters source code to add this feature, though I didn’t get as far as a patch. The “Your Threads” page runs the CommentsController#threads action. That action includes a call @showing_user.recent_threads(20, …, …). In that call to #recent_threads, 20 is the amount argument, which is used as a LIMIT clause in the query. So one way to implement this would be to paginate the “Your Threads” page and change User#recent_threads to take an offset as well as a limit.

    Another way to allow seeing your old comments would be to introduce new UI to the Comments page, which is different from Your Threads in that it shows comments without the context of the whole thread, and it already supports pagination. The /comments and /comments/page/2 URLs could be made to accept a user parameter like /comments/shawn and /comments/shawn/page/2, similar to the existing /threads/:user route. The user parameter would filter the displayed comments to only those by that user. Implementing that would require changing CommentsController#index to filter the comments if that parameter exists. UI to set that URL parameter would be nice but probably not necessary for the first version.

    I stopped short of implementing one of these approaches and making a pull request because I ran into difficulties setting up a local version of Lobsters to test changes on. If I get Lobsters running locally, there is another, smaller code change I would contribute first, to make sure I have the process down. So if anyone wants to try implementing one of the approaches above, please, go ahead.

    Can any Lobsters maintainer comment on whether the “paginated full comment history” feature would be accepted if a pull request were made? Right now other users’ comment history is limited to their last 20 comments – that isn’t a deliberate design decision, right?

    1. 3

      Can any Lobsters maintainer comment on whether the “paginated full comment history” feature would be accepted if a pull request were made? Right now other users’ comment history is limited to their last 20 comments – that isn’t a deliberate design decision, right?

      I do not understand limiting comment history to the last 20 comments to be a deliberate design decision, and I have from time to time wanted to look further back in my own comment history. Consistent with the PR being of sufficient quality to merge I don’t see a prima facie reason this specific feature would be rejected.

      1. 2

        IIRC the issue stems from a desire to Do Pagination In Lobsters Correctly And Consistently Errywhere, but my data is at best many months old.

      2. 2

        Thanks for the detailed and correct post. The page has always had the last 20 threads a user has commented on, and the lack of pagination is not considered a feature.

        @friendlysock is correct below that this is a “perfect is the enemy of good” thing. I attempted a fix with pagy (seemed appropriately small with a straightforward API) but it had a bug with bad user input the maintainer wontfixed saying it’s OK if a site 500s because a user edited a URL. I’d also like the pagination to be stable, so oldest stuff has the lowest page number and doesn’t change page number as new stories/comments come in. I dunno how to handle the latest pages like /comments when they aren’t a “full page” of 20 comments, though, as having that page list one or two comments is lousy and having it list 20-39 is weird. So I figured I’d like it simmer in the background and see if I had any better idea in a few more months.

      3. 2

        If anybody replied, you should (might?) have an email with a link.