Ah, good point.
I took a look at how the official Lemmy UI uses child_count
, and it appears to use the number verbatim in its “X more replies” link. So if a comment tree were to include deleted comments, but child_count
includes the deleted ones, I’d assume the displayed number would be incorrect.
Also, it appears that it only displays a load more link if no child comments are currently loaded for that comment and child_count
is bigger than 0.
Interesting! If there are two deleted comments underneath 2157873, that could indeed explain the two “missing” comments.
It really doesn’t matter much to the user how many comments are going to be loaded next in my opinion, and that keeps it simple on our end.
Here’s what trips me up: even if I don’t display the number, I still need to know whether extra comments can be loaded on that depth. If not I don’t want to display a “Load more”. You could of course let the “Load more” load hidden comments at any level of that subtree, but I think that causes unexpected behavior.
Maybe this clarifies what I’m talking about:
In the case on the right, there’s an unexpected downward shift of content which may disorient the user.
The SvelteKit + TypeScript combo is such a breeze to work with!
And compared to other languages, JavaScript scores pretty well in performance benchmarks. It has a lot more going for it than people give it credit for.