From 26f69c2027f8f29daafef70d03ddf60c7113aabe Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 12 Dec 2022 12:02:48 +0530 Subject: [PATCH] feat(common): match node collapse behaviour with the lobste.rs site --- .../kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt index 40ac652f..f25df8e7 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt @@ -77,6 +77,10 @@ fun LazyListScope.node( htmlConverter: HTMLConverter, toggleExpanded: (CommentNode) -> Unit, ) { + // Skip the node if neither the node nor its parent is expanded + if (!node.isExpanded && node.parent?.isExpanded == false) { + return + } item { CommentEntry( commentNode = node,