-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: composite messages #1997
feat: composite messages #1997
Conversation
# Conflicts: # kalium
# Conflicts: # kalium
Build 631 failed. |
app/src/main/kotlin/com/wire/android/ui/home/conversations/CompositeMessagesViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/conversations/model/MessageTypes.kt
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageItem.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/conversations/model/MessageTypes.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # kalium
Build 638 failed. |
…nu (#2002) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tommaso Piazza <[email protected]>
@MohamadJaara looks like you are rolling back kalium to a previous commitish. This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.
Is this intentional? |
@MohamadJaara looks like you are rolling back kalium to a previous commitish. This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.
Is this intentional? |
@MohamadJaara looks like you are rolling back kalium to a previous commitish. This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.
Is this intentional? |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 689 succeeded. The build produced the following APK's: |
@@ -247,10 +247,20 @@ fun MessagePreview.uiLastMessageContent(): UILastMessageContent { | |||
is WithUser.TeamMemberRemoved -> UILastMessageContent.None // TODO | |||
is WithUser.Text -> UILastMessageContent.SenderWithMessage( | |||
sender = userUIText, | |||
message = UIText.DynamicString((content as WithUser.Text).messageBody), | |||
message = (content as WithUser.Text).messageBody.let { UIText.DynamicString(it) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this crash prone ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, since this code will only be executed when the content is Text
@@ -91,6 +92,33 @@ class RegularMessageMapper @Inject constructor( | |||
message.deliveryStatus | |||
) | |||
|
|||
is MessageContent.Composite -> { | |||
val text = content.textContent?.let { textContent -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can;t we map it inside the mapper ?
val viewModel = hiltViewModelScoped<CompositeMessageViewModel>( | ||
key = "${CompositeMessageViewModel.ARGS_KEY}$messageId", | ||
defaultArguments = bundleOf( | ||
EXTRA_MESSAGE_ID to messageId, | ||
) | ||
) | ||
Column( | ||
modifier = Modifier | ||
.wrapContentSize() | ||
) { | ||
for (index in buttonList.indices) { | ||
val button = buttonList[index] | ||
val onCLick = remember(button.isSelected) { | ||
if (!button.isSelected) { | ||
{ viewModel.sendButtonActionMessage(button.id) } | ||
} else { | ||
{ } | ||
} | ||
} | ||
|
||
val isPending = viewModel.pendingButtonId == button.id | ||
|
||
val state = if (button.isSelected) WireButtonState.Selected | ||
else if (viewModel.pendingButtonId != null) WireButtonState.Disabled | ||
else WireButtonState.Default | ||
|
||
MarkdownDocument(Parser.builder().extensions(extensions).build().parse(text) as Document, nodeData) | ||
WireSecondaryButton( | ||
loading = isPending, | ||
text = button.text, | ||
onClick = onCLick, | ||
state = state | ||
) | ||
if (index != buttonList.lastIndex) { | ||
Spacer(modifier = Modifier.padding(top = dimensions().spacing8x)) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking awesome <3 thanks for the discussion and openess to changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tiny tiny last suggetions from my side
# Conflicts: # app/src/main/kotlin/com/wire/android/ui/home/newconversation/NewConversationViewModel.kt # kalium
Build 718 failed. |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 719 succeeded. The build produced the following APK's: |
Codecov Report
@@ Coverage Diff @@
## develop #1997 +/- ##
=============================================
- Coverage 38.66% 38.65% -0.01%
- Complexity 895 900 +5
=============================================
Files 287 288 +1
Lines 11347 11390 +43
Branches 1460 1466 +6
=============================================
+ Hits 4387 4403 +16
- Misses 6535 6562 +27
Partials 425 425
Continue to review full report in Codecov by Sentry.
|
APKs built during tests are available here. Scroll down to Artifacts! |
Build 736 succeeded. The build produced the following APK's: |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
list of changes
Causes (Optional)
Briefly describe the causes behind the issues. This could be helpful to understand the adopted solutions behind some nasty bugs or complex issues.
Solutions
Briefly describe the solutions you have implemented for the issues explained above.
Dependencies (Optional)
If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.
Needs releases with:
Testing
Test Coverage (Optional)
How to Test
Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.
Notes (Optional)
Specify here any other facts that you think are important for this issue.
Attachments (Optional)
Attachments like images, videos, etc. (drag and drop in the text box)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.