Thread decoration: update preview with new changes

This commit is contained in:
ganfra 2023-09-13 16:36:35 +02:00
parent e7869e7c14
commit 62cabff39a
2 changed files with 20 additions and 4 deletions

View file

@ -707,7 +707,7 @@ private fun ContentToPreviewWithReply() {
body = "A long text which will be displayed on several lines and" + body = "A long text which will be displayed on several lines and" +
" hopefully can be manually adjusted to test different behaviors." " hopefully can be manually adjusted to test different behaviors."
), ),
inReplyTo = aInReplyToReady(replyContent, true), inReplyTo = aInReplyToReady(replyContent),
groupPosition = TimelineItemGroupPosition.First, groupPosition = TimelineItemGroupPosition.First,
), ),
isHighlighted = false, isHighlighted = false,
@ -729,7 +729,8 @@ private fun ContentToPreviewWithReply() {
content = aTimelineItemImageContent().copy( content = aTimelineItemImageContent().copy(
aspectRatio = 5f aspectRatio = 5f
), ),
inReplyTo = aInReplyToReady(replyContent, false), inReplyTo = aInReplyToReady(replyContent),
isThreaded = true,
groupPosition = TimelineItemGroupPosition.Last, groupPosition = TimelineItemGroupPosition.Last,
), ),
isHighlighted = false, isHighlighted = false,
@ -751,11 +752,10 @@ private fun ContentToPreviewWithReply() {
private fun aInReplyToReady( private fun aInReplyToReady(
replyContent: String, replyContent: String,
isThreaded: Boolean,
): InReplyTo.Ready { ): InReplyTo.Ready {
return InReplyTo.Ready( return InReplyTo.Ready(
eventId = EventId("\$event"), eventId = EventId("\$event"),
content = MessageContent(replyContent, null, false, isThreaded, TextMessageType(replyContent, null)), content = MessageContent(replyContent, null, false, false, TextMessageType(replyContent, null)),
senderId = UserId("@Sender:domain"), senderId = UserId("@Sender:domain"),
senderDisplayName = "Sender", senderDisplayName = "Sender",
senderAvatarUrl = null, senderAvatarUrl = null,

View file

@ -702,6 +702,22 @@ internal fun TextComposerReplyPreview() = ElementPreview {
onResetComposerMode = {}, onResetComposerMode = {},
enableTextFormatting = true, enableTextFormatting = true,
) )
TextComposer(
RichTextEditorState("", fake = true),
canSendMessage = false,
onSendMessage = {},
composerMode = MessageComposerMode.Reply(
isThreaded = true,
senderName = "Alice",
eventId = EventId("$1234"),
attachmentThumbnailInfo = null,
defaultContent = "A message\n" +
"With several lines\n" +
"To preview larger textfields and long lines with overflow"
),
onResetComposerMode = {},
enableTextFormatting = true,
)
TextComposer( TextComposer(
RichTextEditorState("A message", fake = true), RichTextEditorState("A message", fake = true),
canSendMessage = true, canSendMessage = true,