Fix context menu when long press on url and email link#12987
Conversation
|
@marcochavezf @parasharrajat One of you needs to 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] |
|
I will start the review today |
|
It is much more involved than I thought. |
| <TouchableWithoutFeedback | ||
| onPress={props.onPreviewPressed} | ||
| onPressIn={() => props.isSmallScreenWidth && canUseTouchScreen() && ControlSelection.block()} | ||
| onPressOut={() => ControlSelection.unblock()} | ||
| onLongPress={showContextMenu} | ||
| > |
There was a problem hiding this comment.
I didn't expect these to be changed. But let me test these first.
|
Sorry for the delay on this. I am currently away. I will actively review it when I am back. |
|
Hi @b1tjoy, could you fix the conflicts? |
marcochavezf
left a comment
There was a problem hiding this comment.
Thanks for the changes @b1tjoy, the code LGTM so far! I'm leaving a few comments:
|
Apologies for the delay on this, I was on/off for the last two weeks. My first thought is that solution is very complex and complex than what I thought it be. I will try to simplify it or remove unnecessary changes. Normally, I suggest breaking it into multiple PRs but it is fine. I will start testing and the review. |
|
Hi @parasharrajat, let me know if you're actively reviewing this PR, happy to help to review/test it in spare cycles if not. |
|
Happy to have hands on this. |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-01-12.at.12.02.40.movMobile Web - ChromeScreen.Recording.2023-01-12.at.15.56.06.movMobile Web - SafariScreen.Recording.2023-01-12.at.15.47.32.movDesktopScreen.Recording.2023-01-12.at.16.03.47.moviOSScreen.Recording.2023-01-12.at.17.06.38.movAndroidScreen.Recording.2023-01-12.at.16.10.05.mov |
|
Hi @b1tjoy, could you fix again the conflicts? I was OOO, apologies for the delay here. I'm going to continue reviewing it asap once the conflicts are resolved 🙇🏽 |
|
@marcochavezf Sorry for my late response. Conflicts resolved. |
marcochavezf
left a comment
There was a problem hiding this comment.
LGTM, I tested all possible scenarios, and seems everything is working fine 👍🏽 Thanks @b1tjoy for all the effort here!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Lolz, I was finally reviewing it. But it is fine I will still check for code patterns. |
|
🚀 Deployed to staging by @marcochavezf in version: 1.2.54-0 🚀
|
|
🚀 Deployed to production by @AndrewGable in version: 1.2.54-2 🚀
|
|
Heyy, coming from this #14301 issue. Our contributors find this PR introduces the issue, specifically the usage of Thank you! |
|
Going through the issue and PR, it looks like the changes made in this PR is intended to solve the issue in native and mWeb or particularly touch screen devices. This issue reported suggest that the feature of long press should not be available for Web and Desktop. So, we prevented the Long Press Context Menu for Web and Desktop with these changes |
Details
When long press on URL/email link in comment, "Copy URL to clipboard" or "Copy e-mail to clipboard" does not show, this PR fix it by replace
LongPressGestureHandlerwithPressableinPressableWithSecondaryInteraction.Because of the limitation of gesture responder system of react-native, only the inner
Pressablein a nestedPressabletree can catch long press event, and because of the limitation of react-native-render-html, we can not pass necessary data to the innerPressableto display context menu. So we use React Context API to let the inner pressable component display context menu in it's long press event handler.But use
Pressablecause some regressions, this PR fix the regressions too. Regressions need to notice:Since we can pass props data to
IOUActioninReportActionItem, I use prop drilling to fix regressions with IOU card rather than Context API.Fixed Issues
$ #8311
PROPOSAL: #8311 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting 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)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** 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)Screenshots/Videos
Web
macOS-Chrome-2022-11-24-155600.mp4
Mobile Web - Chrome
Android-Chrome-2022-11-24-155904.mp4
Mobile Web - Safari
iOS-Safari-2022-11-24-155428.mp4
Desktop
macOS-Desktop-2022-11-24-161527.mp4
iOS
iOS-native-2022-11-24-154812.mp4
Android
Android-native-2022-11-24-161045.mp4