From 3a15eea2fdbb5e662f8ee386d505ccb3295de036 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 26 Jun 2024 12:01:16 +0530 Subject: [PATCH] Revert "fix(common): temporarily disable collapsible comments feature" Doesn't fix the bug. This reverts commit 7ae94ee2e6142c22f3e7e20b15e776920584aa37. --- .../dev/msfjarvis/claw/common/comments/CommentEntry.kt | 4 ++-- .../dev/msfjarvis/claw/common/comments/CommentNode.kt | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt index e9caf95e..e7de53cd 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt @@ -130,7 +130,7 @@ private val CommentEntryPadding = 16f.dp internal fun CommentEntry( commentNode: CommentNode, htmlConverter: HTMLConverter, - @Suppress("UNUSED_PARAMETER") toggleExpanded: (CommentNode) -> Unit, + toggleExpanded: (CommentNode) -> Unit, openUserProfile: (String) -> Unit, modifier: Modifier = Modifier, ) { @@ -139,7 +139,7 @@ internal fun CommentEntry( modifier = modifier .fillMaxWidth() - /*.clickable { toggleExpanded(commentNode) }*/ + .clickable { toggleExpanded(commentNode) } .background(MaterialTheme.colorScheme.background) .padding( start = CommentEntryPadding * commentNode.indentLevel, 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 2c296a89..0a6227c8 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 @@ -103,12 +103,10 @@ private fun LazyListScope.node( toggleExpanded: (CommentNode) -> Unit, openUserProfile: (String) -> Unit, ) { - /* - // Skip the node if neither the node nor its parent is expanded - if (!node.isExpanded && node.parent?.isExpanded == false) { - return - } - */ + // Skip the node if neither the node nor its parent is expanded + if (!node.isExpanded && node.parent?.isExpanded == false) { + return + } item(key = node.comment.shortId) { CommentEntry( commentNode = node,