fix: Chat - App displays mention suggestion for sometime when we remove spaces before#29957
Conversation
|
@cubuspl42 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Lint issues |
My bad, fixed. |
|
Hey @cubuspl42, did you have any luck getting this tested/reviewed? |
| useEffect(() => { | ||
| if (value.length < previousValue.length) { | ||
| // A workaround to not show the suggestions list when the user deletes a character before the mention. | ||
| // It is caused by a buggy behavior of the TextInput on iOS. Should be fixed after migration to the Fabric Arc. |
There was a problem hiding this comment.
Arc -> Arch (or just "Fabric")
|
|
||
| calculateMentionSuggestion(selection.end); | ||
| }, [selection, calculateMentionSuggestion]); | ||
| }, [selection, value, previousValue, calculateMentionSuggestion]); |
There was a problem hiding this comment.
Both value and previousValue are necessary, right?
There was a problem hiding this comment.
I would omit both values from dependencies, but in that case, we get a lint error – it requires both to be present
There was a problem hiding this comment.
Oh, sure. The truth is that we opt-out quite often from that lint... In this case I would go whichever path is less likely to create another regression...
There was a problem hiding this comment.
I agree with you @cubuspl42, we should follow the path that is less likely to create another regression.
|
We are over 1000 commits behind Even if there are no Git conflicts on the textual level, such diversion can:
|
Reviewer Checklist
Screenshots/VideosWebfix-suggestions-remove-space-again-web.mp4Mobile Web - Chromefix-suggestions-remove-space-again-android-web-compressed.mp4Mobile Web - Safarifix-suggestions-remove-space-again-ios-web.mp4DesktopiOSfix-suggestions-remove-space-again-ios.mp4Androidfix-suggestions-remove-space-again-android-compressed.mp4 |
|
@lakchote This is our second try, as previously, we reverted the changes because of a regression caused by a tricky iOS React Native bug. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/lakchote in version: 1.3.90-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.90-2 🚀
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 1.3.91-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀
|


Details
This is a workaround to stop the suggestions list from showing on the removal of symbols before the "@".
The original idea caused a regression, so we have to go with a workaround until the migration to the Fabric Architecture.
Fixed Issues
$ #28170
PROPOSAL: #28170 (comment)
Tests
Same as QA.
Offline tests
Same as QA.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mp4
Mobile Web - Chrome
mWeb.mp4
Mobile Web - Safari
video_2023-10-02_09-29-41.mp4
Desktop
desktop.mov
iOS
Simulator.Screen.Recording.-.iPhone.15.-.2023-10-19.at.13.16.32.mov
Android
android.mov