[iOS]Fix: Oddly formatted text hangs Gutenberg#1352
Merged
Conversation
1 task
koke
approved these changes
Sep 5, 2019
Member
koke
left a comment
There was a problem hiding this comment.
It still takes a couple seconds on an iPhone XS, and moving the cursor around is pretty slow, but it's so much better than before and at least it shouldn't crash now 😅
Contributor
Author
|
Thanks for the review @koke 🎉 Yes I noticed that it is still not super good but couldn't detect more improvement points ATM 🤔 |
Member
|
Just for reference, I was looking at the performance tab in Chrome while testing this on iOS, and the cursor moving is slow because both of RichText's |
daniloercoli
added a commit
that referenced
this pull request
Sep 19, 2019
…rg-mobile into add/autosave-monitor * 'develop' of https://github.com/wordpress-mobile/gutenberg-mobile: [iOS]Fix: Oddly formatted text hangs Gutenberg (#1352) Remove redundant bg color within button appender (#1348) Update bundles Update package.json version to 1.12.0 # Conflicts: # bundle/android/App.js # bundle/android/App.js.map # bundle/ios/App.js # bundle/ios/App.js.map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1354
WPiOS PR
Root Cause Analysis
I used Time Profiler to see what's taking so long and it turns out the enumeration on attributes was taking so long. So I put beginEditing/endEditing calls to make the updates as a batch.
This is still not perfect because it is a very long text but I observed that on a iPhone 6 simulator the opening of the page dropped from ~55secs to ~5secs.
About Text Getting Invisible
Also, you might observe that text appears as invisible. This is a known iOS behavior about rendering very long text inside a non-scrolling UITextView. If you split the block at some point you can observe that the text is visible again. The ideal world for iOS would be allowing the text scroll inside a smaller viewport, that way the text color doesn't get invisible. We had the same issue on HTML mode and I fixed it that way. Although as far as I know real devices are performing better compared to simulators about this, so we might not need to worry a lot currently.
To test:
WPiOS App Tests
Checkout the branch of WPiOS PR
Run
rake dependenciesFollow the instructions in the issue
Verify that the screen is not hanging for a long time
Apart from this, some smoke test is done in paragraph/heading blocks to make sure we are not causing regression.
Update release notes:
RELEASE-NOTES.txt.