fix: mentions rendered incorrectly - WPB-21687#4664
Open
johnxnguyen wants to merge 2 commits intorelease/cycle-4.18from
Open
fix: mentions rendered incorrectly - WPB-21687#4664johnxnguyen wants to merge 2 commits intorelease/cycle-4.18from
johnxnguyen wants to merge 2 commits intorelease/cycle-4.18from
Conversation
|
Contributor
Test Results1 883 tests 1 855 ✅ 2m 22s ⏱️ For more details on these failures, see this check. Results for commit 2a2ad3c. Summary: workflow run #25189422378 |
|
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.



Issue
It has been observed that in some cases mentions are rendered incorrectly, as shown here:

It's suspected that this is due to the sender of the text message incorrectly calculating the range of the mention to only include the name and not the the @ prefix. For instance, in the message
Hello @Bruno! How are you?the mention range that is sent in the protobuf message should be location 6 with length 6 (encompassing@Bruno). But if instead the mention range is location 7 length 5 (encompassingBruno) then the iOS app will render the mention incorrectly as shown in the previous attachment.This PR accounts for this hypothetical case by checking if the mention range includes the prefix @. If it does not, it will check that the string has a @ prefix available and if it does will adjust the mention range to encompass also this @ prefix. Then it proceeds as normal with the mention rendering. The result is:
Testing
Since it is not know how to reproduce this hypothetical case, there are no steps. However it seems to have something to do with copying and pasting a message containing mentions on the web app and sending the message, then editing the message to apply the mentions.
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: