From c5ec6cd680b45c15d05715dd6073b9d00202a0f8 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 19 Jul 2023 21:58:08 +0530 Subject: [PATCH] Revert "Revert "fix(common): make text in comments screen selectable"" This reverts commit 401214794d587a687885ffc0721fb9bf07b8a2a5. --- .../claw/common/comments/CommentEntry.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 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 2350564a..f93049d1 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 @@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Public import androidx.compose.material3.MaterialTheme @@ -70,7 +71,7 @@ internal fun CommentsHeader( modifier = Modifier.padding(16.dp).fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp), ) { - PostTitle(title = postDetails.title) + SelectionContainer { PostTitle(title = postDetails.title) } TagRow(tags = postDetails.tags.toImmutableList()) Spacer(Modifier.height(4.dp)) @@ -84,7 +85,9 @@ internal fun CommentsHeader( } if (postDetails.description.isNotBlank()) { - ThemedRichText(htmlConverter.convertHTMLToMarkdown(postDetails.description)) + SelectionContainer { + ThemedRichText(htmlConverter.convertHTMLToMarkdown(postDetails.description)) + } Spacer(Modifier.height(4.dp)) } Submitter( @@ -169,10 +172,12 @@ internal fun CommentEntry( Modifier.clickable { uriHandler.openUri("https://lobste.rs/u/${comment.user.username}") }, ) if (commentNode.isExpanded) { - ThemedRichText( - text = htmlConverter.convertHTMLToMarkdown(comment.comment), - modifier = Modifier.padding(top = 8.dp) - ) + SelectionContainer { + ThemedRichText( + text = htmlConverter.convertHTMLToMarkdown(comment.comment), + modifier = Modifier.padding(top = 8.dp) + ) + } } } }