Skip to content

Commit

Permalink
Comment action bar fixes (#593)
Browse files Browse the repository at this point in the history
The "Show action bar by default for comments" setting now only affects comment trees in post listing views, not single comments in the user's inbox (replies/mentions), saved comments, or profile comments. This gives them convenient access to the action bar for single comments they're likely to want to interact with.

Also allow user to toggle action bar visibility for inbox replies and mentions by long tapping on the comment body (not just the comment header), which makes this behaviour consistent with long tapping on comments in normal post listings.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
  • Loading branch information
a1studmuffin and dessalines authored Jun 13, 2023
1 parent aa3e113 commit 0d7730b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ fun CommentMentionNode(

var viewSource by remember { mutableStateOf(false) }
var isExpanded by remember { mutableStateOf(true) }
var isActionBarExpanded by remember { mutableStateOf(false) }
var isActionBarExpanded by remember { mutableStateOf(true) }

Column(
modifier = Modifier.padding(horizontal = LARGE_PADDING),
Expand Down Expand Up @@ -353,7 +353,9 @@ fun CommentMentionNode(
comment = personMentionView.comment,
viewSource = viewSource,
onClick = {},
onLongClick = {},
onLongClick = {
isActionBarExpanded = !isActionBarExpanded
},
)
AnimatedVisibility(
visible = isActionBarExpanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ fun CommentReplyNode(

var viewSource by remember { mutableStateOf(false) }
var isExpanded by remember { mutableStateOf(true) }
var isActionBarExpanded by remember { mutableStateOf(false) }
var isActionBarExpanded by remember { mutableStateOf(true) }

Column(
modifier = Modifier.padding(horizontal = LARGE_PADDING),
Expand Down Expand Up @@ -351,7 +351,9 @@ fun CommentReplyNode(
comment = commentReplyView.comment,
viewSource = viewSource,
onClick = {},
onLongClick = {},
onLongClick = {
isActionBarExpanded = !isActionBarExpanded
},
)
AnimatedVisibility(
visible = isActionBarExpanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ fun UserTabs(
account = account,
moderators = listOf(),
isCollapsedByParent = false,
showActionBarByDefault = appSettingsViewModel.appSettings.value?.showCommentActionBarByDefault ?: true,
showActionBarByDefault = true,
enableDownVotes = enableDownVotes,
showAvatar = showAvatar,
)
Expand Down

0 comments on commit 0d7730b

Please sign in to comment.