this post was submitted on 18 Jun 2023
39 points (100.0% liked)

Kbin Userstyles and Userscripts

15 readers
1 users here now

Custom CSS and JS to help improve your Kbin experience! ### Userscripts Greasy Fork ### Stylesheets UserStyles.world ### Userscript managers

founded 1 year ago
 

Download it from greasyfork

This userscript for kbin enhances the comment section adjusting the layout and adding a line to the left of each comment and its replies that lets you collapse them. The design is inspired by some custom subreddit stylesheets, and new reddit surprisingly enough (you know what they say about broken clocks)

Personally, I think this is the best way to handle collapsing comments here's a screenshot.

A video of it in action

If you don't have a userscript manager extension installed, you can install Tampermonkey, and then open the greasyfork link.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago (1 children)

@artillect I found a weird bug/interaction! When you have the script (v1.2.1) as-is and enable media previews in the sidebar settings, a bunch of comments begin collapsed. It happens in this thread so it can be used for testing. Most of your comments are auto-collapsed.

The click handler on comments is triggered, as shown by this modification:

    // Add event listener to comment
    comments[i].addEventListener('click', function(){console.log("CLICK on comment " + i); toggleReplies(event, comments[i], expando)});

It spams a bunch of log lines in the console. I'm guessing the auto media preview is implemented by simulating clicks on comments, but I haven't checked the code.

[–] [email protected] 1 points 1 year ago (1 children)

I also found a fix: listen for 'mouseup' instead of 'click'. However, this still collapses comments when you try to select text so that's still not good.

[–] [email protected] 1 points 1 year ago (1 children)

Sorry, just noticed 1.3 is out, doh.
With fulltoggle off, the bug is solved, but it remains when it is enabled.

I also couldn't find the config menu anywhere and added openConfigMenu() to to async function to actually change the setting. Hm.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Hmm, I'll see what I can do about fixing the bug with enable media previews. I just fixed the issue with comments collapsing when you try to highlight text, try updating to 1.3.1. The config should be accessible in your user menu in the top right, I think I might move it into its own icon in the menu so it's more visible

Edit: It wasn't actually fixed in 1.3.1, but I have fixed it properly now