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
 

They always obscure part of the text, no matter what. I juat want the full text.

nb that I use KES so maybe that's where the issue is?

Edit: should probably mention that this is on mobile, android

Edit 2: the code snippet below, provided by @pamasich, seems to have fixed the issue. I added it to my mobile browser (Firefox nightly) via the Stylus add-on:

div.more:not(:nth-child(1 of .more)) {
    display: none;
}

Edit 3: Latest KES update seems to have fixed the issue. More deets here: https://kbin.social/m/enhancement/t/777616 Thanks @shazbot

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (7 children)

@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:

let children = previousComment.querySelector('.children');
if (!children) {
    // If not, create one
    children = document.createElement('div');
    children.className = 'children';
    previousComment.appendChild(children);
}
// Insert comment into children container
children.prepend(comment);

[–] [email protected] 2 points 10 months ago (4 children)

@Pamasich

I have resolved the aforementioned issues with a hotfix on the testing branch; please test when time permits. Executive summary:

  1. The mod fully restores the DOM tree to its original state when toggled off. It is now possible to toggle the mod on and off on the same page without reloading, and changes will behave as expected.
  2. For reasons of security, the mod no longer allows clicking the post headers or post body as a means of collapsing/expanding comments. This was attaching unnecessary listeners to elements on the page, with no way of clearing them when toggled off (besides hard refreshing). Now the only approved way of expanding/collapsing is to use the +/- icon or colored bars.
  3. The mod erroneously modified the CSS of profile pictures to give them rounded borders, which was unspecified by its intended behavior and documented nowhere in the description. Now they conform to the standard square format.
  4. The superfluous mores are being removed now for comments with overflow text. What I thought would be a quick fix turned into hours, and I thought I was losing my marbles over this one for a long time, since the tree clearly showed numerous duplicate mores, but only one per comment was being shown at runtime of the script. At first, I did not seriously think that the mod was completing its runtime cycle prior to the duplicate mores being spawned, but indeed this is what was happening. For now, I have added a 20ms sleep before clearing the extra mores, and this seems to suffice to let them propagate before the mod can continue with the cleanup phase. This seems satisfactory for now, short of attaching observers to wait for the duplicate mores to appear.

I believe that covers everything. It should be possible to switch the mod on and off at will now and see no adverse effect.

[–] [email protected] 2 points 10 months ago (3 children)

Teardown isn't working for me, tried multiple devices and turned my custom styling off.

After teardown this is how the site looks like to me. Also, it seems you need to remove the mores on teardown too. The more issue is now fixed when the mod is active, but appears again after teardown.

[–] [email protected] 2 points 10 months ago

You're right, looks like I missed something that was obscured by custom styling.

And good catch on the mores appearing on teardown. This mod is turning out to be quite a beast. Thanks for testing.

load more comments (2 replies)
load more comments (2 replies)
load more comments (4 replies)