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: Send Text Formatting message #1857

Merged
merged 16 commits into from
Jun 19, 2023
Merged

Conversation

trOnk12
Copy link
Contributor

@trOnk12 trOnk12 commented Jun 13, 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

No way to send text with formatting options (Bold, Italic, Header)

Causes (Optional)

Not implemented.

Solutions

Created a new MessageComposeInputType called RichTextFormattingMessage, so when clicking the RichText icon button when typing a (new/edit/ephemeral) message, it will show the text formatting options.

Currently some of the logic is living inside the composables, but this will hopefully change as soon as we have the refactor on message composer so we can better split stuff.

Testing

How to Test

  • Open App
  • Open Conversation
  • Start a new message -> Select TextFormatting/RichText Icon so new options are shown
  • By clicking on any of the given options it will add its markdown where the cursor is, if you need to wrap a text with these options you will need first to select the text you want and then click on the option you want.

Multiple markdowns are accepted.

Attachments (Optional)

| rich text icon button | rich text options |

@trOnk12 trOnk12 marked this pull request as draft June 13, 2023 12:32
@AndroidBob
Copy link
Collaborator

Build 1 failed.

@alexandreferris alexandreferris changed the title Feat/text formatting/send feat: Send Text Formatting message Jun 13, 2023
@alexandreferris alexandreferris self-assigned this Jun 13, 2023
@alexandreferris alexandreferris marked this pull request as ready for review June 14, 2023 09:30
@AndroidBob
Copy link
Collaborator

Build 2 failed.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 14, 2023

Unit Test Results

  71 files    71 suites   41s ⏱️
476 tests 475 ✔️ 1 💤 0

Results for commit f8f2ab1.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #1857 (f8f2ab1) into develop (5c34780) will decrease coverage by 0.13%.
The diff coverage is 32.07%.

@@              Coverage Diff              @@
##             develop    #1857      +/-   ##
=============================================
- Coverage      37.23%   37.10%   -0.13%     
  Complexity       809      809              
=============================================
  Files            276      276              
  Lines          10511    10558      +47     
  Branches        1378     1390      +12     
=============================================
+ Hits            3914     3918       +4     
- Misses          6198     6243      +45     
+ Partials         399      397       -2     
Impacted Files Coverage Δ
...android/ui/home/messagecomposer/MessageComposer.kt 0.00% <ø> (ø)
...id/ui/home/messagecomposer/MessageComposerInput.kt 0.00% <0.00%> (ø)
...home/messagecomposer/state/MessageComposerState.kt 44.16% <0.00%> (-5.56%) ⬇️
.../messagecomposer/state/MessageComposeInputState.kt 44.82% <5.26%> (-7.96%) ⬇️
...e/android/ui/home/conversations/model/UIMessage.kt 45.96% <56.09%> (-0.70%) ⬇️
...in/kotlin/com/wire/android/mapper/MessageMapper.kt 63.36% <62.50%> (+2.78%) ⬆️

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 bc56d7f...f8f2ab1. Read the comment docs.

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 3 succeeded.

The build produced the following APK's:

@alexandreferris alexandreferris requested review from a team, gongracr, yamilmedina, mchenani and ohassine and removed request for a team June 14, 2023 19:05
Comment on lines 126 to 145
@Stable
data class NewMessage(
val attachmentOptionsDisplayed: Boolean = false,
val richTextFormattingOptionsDisplayed: Boolean = false
) : MessageComposeInputType()

@Stable
data class EditMessage(
val messageId: String,
val originalText: String,
val richTextFormattingOptionsDisplayed: Boolean = false
) : MessageComposeInputType()

@Stable
data class SelfDeletingMessage(
val selfDeletionDuration: SelfDeletionDuration,
val isEnforced: Boolean,
val attachmentOptionsDisplayed: Boolean = false
val attachmentOptionsDisplayed: Boolean = false,
val richTextFormattingOptionsDisplayed: Boolean = false
) : MessageComposeInputType()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to add in each type instead of directly into the sealed class, otherwise the value wouldn't update into the screen.

@alexandreferris alexandreferris requested a review from saleniuk June 19, 2023 09:59
@AndroidBob
Copy link
Collaborator

Build 4 failed.

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 5 succeeded.

The build produced the following APK's:

@alexandreferris alexandreferris added this pull request to the merge queue Jun 19, 2023
Merged via the queue into develop with commit f51dde9 Jun 19, 2023
@alexandreferris alexandreferris deleted the feat/text_formatting/send branch June 19, 2023 12:24
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