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

[Rich text editor] Add full screen mode #1447

Merged
merged 9 commits into from
Sep 29, 2023
Merged

Conversation

jonnyandrew
Copy link
Contributor

@jonnyandrew jonnyandrew commented Sep 28, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

To follow in a later PR:

  • Refactor the large TextComposer.kt file and split UI components into multiple files.

Motivation and context

Screenshots / GIFs

Screen_recording_20230928_144233.webm

Checklist

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/47yqMW

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 97 lines in your changes are missing coverage. Please review.

Comparison is base (fa82639) 57.86% compared to head (5b702c1) 58.30%.

❗ Current head 5b702c1 differs from pull request most recent head 9356c8b. Consider uploading reports for the commit 9356c8b to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1447      +/-   ##
===========================================
+ Coverage    57.86%   58.30%   +0.44%     
===========================================
  Files         1130     1132       +2     
  Lines        30079    30219     +140     
  Branches      6147     6189      +42     
===========================================
+ Hits         17404    17619     +215     
+ Misses       10065     9960     -105     
- Partials      2610     2640      +30     
Files Coverage Δ
...id/features/messages/impl/MessagesStateProvider.kt 90.00% <100.00%> (-0.25%) ⬇️
...s/impl/messagecomposer/MessageComposerPresenter.kt 93.29% <100.00%> (+0.03%) ⬆️
...sages/impl/messagecomposer/MessageComposerState.kt 100.00% <100.00%> (ø)
...pl/messagecomposer/MessageComposerStateProvider.kt 95.23% <100.00%> (+4.32%) ⬆️
...composer/components/TextInputRoundedCornerShape.kt 83.33% <83.33%> (ø)
...ent/android/features/messages/impl/MessagesView.kt 58.76% <85.71%> (+0.06%) ⬆️
...gnsystem/theme/components/BottomSheetDragHandle.kt 80.76% <80.76%> (ø)
...ssages/impl/messagecomposer/MessageComposerView.kt 64.58% <66.66%> (+9.02%) ⬆️
...res/messages/impl/ExpandableBottomSheetScaffold.kt 77.14% <77.14%> (ø)
...ent/android/libraries/textcomposer/TextComposer.kt 74.41% <74.69%> (+21.13%) ⬆️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import io.element.android.features.messages.impl.attachments.Attachment
import io.element.android.libraries.textcomposer.MessageComposerMode
import io.element.android.wysiwyg.compose.RichTextEditorState
import kotlinx.collections.immutable.ImmutableList

@Immutable
@Stable
Copy link
Contributor Author

Choose a reason for hiding this comment

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

richTextEditorState is mutable

color = ElementTheme.colors.textSecondary,
RichTextEditor(
state = state,
registerStateUpdates = !subcomposing,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disable most of the editor functionality if it's just being measured for a subcomposition. This prevents it gaining focus and mutating the state.

Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks. Maybe add this comment also in the code?

@jonnyandrew jonnyandrew marked this pull request as ready for review September 28, 2023 14:27
@jonnyandrew jonnyandrew requested a review from a team as a code owner September 28, 2023 14:27
@jonnyandrew jonnyandrew requested review from bmarty and removed request for a team September 28, 2023 14:27
@du82
Copy link

du82 commented Sep 28, 2023

It would be cool if there was a way to permanently enable the rich text editor instead of having to tap two things for it

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

color = ElementTheme.colors.textSecondary,
RichTextEditor(
state = state,
registerStateUpdates = !subcomposing,
Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks. Maybe add this comment also in the code?

@jonnyandrew jonnyandrew enabled auto-merge (squash) September 29, 2023 08:47
@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jonnyandrew jonnyandrew merged commit 53cf82f into develop Sep 29, 2023
12 checks passed
@jonnyandrew jonnyandrew deleted the jonny/rte-full-screen branch September 29, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants