this post was submitted on 14 Jan 2024
4 points (100.0% liked)
/kbin meta
5 readers
2 users here now
Magazine dedicated to discussions about the kbin itself. Provide feedback, ask questions, suggest improvements, and engage in conversations related to the platform organization, policies, features, and community dynamics. ---- * Roadmap 2023 * m/kbinDevlog * m/kbinDesign
founded 1 year ago
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I wasn't able to reproduce the issue on a default kbin setup with KES either on off. The "always expand post bodies" feature of KES only applies to bodies, but I could extend it to support comments as well so that they auto-expand. What I didn't observe was any situations where the expansion bar obscures the text. Do you have a screenshot of that?
Are you running a custom theme?
I know what they mean, because I have the same issue on my work pc (but not at home). I forgot it happens because the personal userstyle I'm using includes CSS to fix this issue entirely.
@speck get yourself Stylus if you don't have it already and try this CSS which works perfectly for me:
Can't guarantee it works with kbin's built in custom CSS functionality, as that one seems to filter out some selectors (no logic behind which).
@shazbot
Basically, what happens without that CSS is that
At no point is the comment ever expanded. When OP says it obscures text, that's just the default state where only x lines of the comment are shown and the bar covers the last line(s). The issue is the comment can't be expanded, so it keeps obscuring the text even when clicked as nothing actually moves.
Looking at the HTML source, I can see five instances of the bar existing at once on the same comment.
I tested just now to turn off my scripts one by one and KES was the culprit. Disabling it fixed the issue. I'll try checking which feature is causing it.
@shazbot @speck
For me, the culprit is the collapsible comments mod (or the standalone script if you're using that one).
edit: The root cause seems to be lines 182 to 190. But the actual troublemaker appears to be on kbin's side, not KES. When the mod's main function finishes, the comment still only has only one .more element like when it began.
I've disabled all other mods and userscripts, so it's not one of those. Also just tried to disable KES (and even the monkey) entirely, running the script from the console instead. No change either, it's still happening.
The code fragment in question copies the comment into a new children container. I'm thinking this probably makes some part of kbin confused, leading to the issues we're seeing.
It might be best to just include the userstyle I'm using in the CSS added by the mod.
This is the code between lines 182 and 190, removing which prevents the issue:
@Pamasich @speck
I have completed an audit of the mod and observed the following issues:
Does not properly unset classes and restore the page to an intact state when turned off: this was having the side effect of making the threaded lines look incorrect when toggling on/off in place. The mod should not leave dangling containers around after it is toggled off. The mod creates an outer container so that the "expando" lines flow all the way down through the child elements, but when turned off, these child elements need to be moved back out of the container to be adjacent to each other and the container removed. => Fixed locally.
Does not properly unset event listeners attached to nested comments. Same as above, tends to leave dangling listeners and does not unset itself cleanly. => In progress.
Because it physically manipulates the DOM and moves sub-comments into their own container down the tree, triggers an event (likely a bug) on Kbin's side whereby any time the DOM is updated for that element, Kbin appends a
more
element (text expansion button) if the text overflows a certain length, even if amore
element is already present. You can test this by creating a dummy div above or below a long comment and then moving the long comment before or after that div. Simply moving its position in the DOM will trigger the creation of anothermore
element inside. And because the mod puts each comment into its own container for the purposes of threading nested chains of comments, this will trigger the creation of as manymore
s as there are indendation levels. So for a comment chain 5 replies deep, there will be 5more
s. This is further exacerbated when toggling the mod on and off, since thesemore
s are not getting wiped and will just keep getting stacked up. Since this is also an upstream issue, our only alternative here is to walk through the tree and remove the extraneousmore
elements after nesting occurs. This is similar to your CSS solution, but instead of masking them, physically deletes them, otherwise we will have a constantly growing tree ofmore
s every time nesting happens. I guess this should also be reported upstream as well. Kbin seems to expect no DOM manipulation to occur, which is reasonable, I suppose, but might be better if the callback doesn't insert themore
element at all if it's already present. => Easy fix on the Kbin side, in progress.