Skip to content
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

Merged
merged 16 commits into from
Jul 27, 2023
Merged

feat: composite messages #1997

merged 16 commits into from
Jul 27, 2023

Conversation

MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Jul 24, 2023


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

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:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

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)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@AndroidBob
Copy link
Collaborator

Build 631 failed.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 24, 2023

Test Results

518 tests  +2   517 ✔️ +2   20s ⏱️ ±0s
  75 suites +1       1 💤 ±0 
  75 files   +1       0 ±0 

Results for commit dc058d0. ± Comparison against base commit 6fc88bd.

♻️ This comment has been updated with latest results.

@AndroidBob
Copy link
Collaborator

Build 638 failed.

MohamadJaara and others added 2 commits July 26, 2023 12:22
…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]>
@github-actions
Copy link
Contributor

@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.

develop This PR
d42a5fd2275d8f23be3b7d0bff9335ff4c87edfc 8532357e2f898867e0292e2335be66d32aa9f83c

Is this intentional?

@github-actions
Copy link
Contributor

@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.

develop This PR
d42a5fd2275d8f23be3b7d0bff9335ff4c87edfc 8532357e2f898867e0292e2335be66d32aa9f83c

Is this intentional?

@github-actions
Copy link
Contributor

@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.

develop This PR
d42a5fd2275d8f23be3b7d0bff9335ff4c87edfc 8532357e2f898867e0292e2335be66d32aa9f83c

Is this intentional?

@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

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) },
Copy link
Contributor

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 ?

Copy link
Member Author

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 ->
Copy link
Contributor

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 ?

Comment on lines +122 to +158
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))
}
}
}
Copy link
Contributor

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

Copy link
Contributor

@trOnk12 trOnk12 left a 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

@MohamadJaara MohamadJaara requested review from a team, yamilmedina, Garzas, ohassine and saleniuk and removed request for a team July 26, 2023 12:51
# Conflicts:
#	app/src/main/kotlin/com/wire/android/ui/home/newconversation/NewConversationViewModel.kt
#	kalium
@AndroidBob
Copy link
Collaborator

Build 718 failed.

@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 719 succeeded.

The build produced the following APK's:

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #1997 (dc058d0) into develop (6fc88bd) will decrease coverage by 0.01%.
The diff coverage is 40.00%.

@@              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              
Files Changed Coverage Δ
...wire/android/mapper/RegularMessageContentMapper.kt 24.63% <0.00%> (-3.24%) ⬇️
...rsations/messages/ConversationMessagesViewModel.kt 50.81% <ø> (ø)
...e/android/ui/home/conversations/model/UIMessage.kt 44.32% <15.38%> (-1.55%) ⬇️
.../android/ui/authentication/devices/model/Device.kt 93.75% <100.00%> (ø)
...ui/home/conversations/CompositeMessageViewModel.kt 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fc88bd...dc058d0. Read the comment docs.

@MohamadJaara MohamadJaara added this pull request to the merge queue Jul 27, 2023
@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 736 succeeded.

The build produced the following APK's:

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 27, 2023
@MohamadJaara MohamadJaara added this pull request to the merge queue Jul 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 27, 2023
@MohamadJaara MohamadJaara added this pull request to the merge queue Jul 27, 2023
Merged via the queue into develop with commit 2c70f21 Jul 27, 2023
11 checks passed
@MohamadJaara MohamadJaara deleted the feat/composite_messages/epic branch July 27, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants