-
Notifications
You must be signed in to change notification settings - Fork 749
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: improve performance when changing composer mode #7691
Rich text editor: improve performance when changing composer mode #7691
Conversation
LogError: Error: Could not find the Dangerfile at tools/danger/dangerfile-lint.js - does a file exist at dangerfile-lint.js in tools/danger?.
at /usr/src/danger/distribution/platforms/GitHub.js:166:27
at step (/usr/src/danger/distribution/platforms/GitHub.js:44:23)
at Object.next (/usr/src/danger/distribution/platforms/GitHub.js:25:53)
at fulfilled (/usr/src/danger/distribution/platforms/GitHub.js:16:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
danger-results://tmp/danger-results-5ac9f88b.json |
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.
LGTM!
@@ -363,6 +370,9 @@ class RichTextComposerLayout @JvmOverloads constructor( | |||
} | |||
|
|||
override fun renderComposerMode(mode: MessageComposerMode) { | |||
if (this.composerMode == mode) return |
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.
It's worth noting that MessageComposerMode.Quote
and MessageComposerMode.Reply
are not data class, so maybe ==
will not work as expected here.
When replying to someone, then (without sending the message), reply to someone else, does the original sender name updates properly?
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.
It's worth noting that MessageComposerMode.Quote and MessageComposerMode.Reply are not data class, so maybe == will not work as expected here.
I just changed it so they're data classes too (I don't really remember why they weren't in the first place).
When replying to someone, then (without sending the message), reply to someone else, does the original sender name updates properly?
Yes, both before and after making Reply
a data class.
09f71af
to
f4c071b
Compare
SonarCloud Quality Gate failed. |
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.
LGTM!
Type of change
Content
Store the current
MessageComposerMode
so we can diff and avoid unnecessary updates.Also, only change some layout params for the editor if we don't want to animate the full screen change (keeps compatibility with both Element Android and Element X).
Motivation and context
Element X stopped properly responding to input as the
renderComposerMode
method was being triggered for each change (on Element Android this is not so noticeable). It also had some issues with resizing the editor properly.As both apps share most of this code, it's better to also handle it properly here.
Screenshots / GIFs
Tests
It's quite difficult to test, as it wasn't a noticeable issue in Element Android.
There should be no issues when writing or 'flashes'.
Tested devices
Checklist