-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Attachment shortcuts support on native devices #18407
Conversation
@luacmartins @rushatgabhane 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] |
@azimgd let me know when this is ready for review, thanks! |
@rushatgabhane the code is ready to be reviewed. I will complete the checklist and add screenshots shortly. |
@rushatgabhane ready. |
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.
@azimgd code looks good to me! and tests well on android
left a small change request to use functional component.
onCycleThroughAttachments: PropTypes.func.isRequired, | ||
}; | ||
|
||
class Carousel extends React.Component { |
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.
non blocking: @azimgd could we please write this as a functional component? Because we're migrating everything to it anyway
@@ -219,7 +219,7 @@ class AttachmentCarousel extends React.Component { | |||
const nextIndex = this.state.page - deltaSlide; | |||
const nextItem = this.state.attachments[nextIndex]; | |||
|
|||
if (!nextItem) { | |||
if (!nextItem || !this.scrollRef.current) { |
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.
could you please help me understand why we made this change?
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.
I assume that was some sort of a race condition happening on Android where scrollRef was undefined upon scroll.
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-05-24.at.01.15.54.movMobile Web - ChromeScreen.Recording.2023-05-24.at.04.07.43.movMobile Web - SafariScreen.Recording.2023-05-24.at.04.04.49.movDesktopScreen.Recording.2023-05-24.at.03.57.58.moviOSScreen.Recording.2023-05-24.at.03.55.29.movAndroidWhatsApp.Video.2023-05-23.at.23.57.27.mp4 |
@azimgd we need to fix the conflicts caused by prettier merged to main https://expensify.slack.com/archives/C01GTK53T8Q/p1683669159014609 |
@azimgd conflicts |
updated. |
@azimgd could you please run prettier and push the diff to make the checks happy ✅ |
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.
Looking good. We just need to address @rushatgabhane's comment.
Hey @rushatgabhane would you mind taking a look one more time please. @luacmartins I haven't implemented functional component initially as the |
@azimgd okayy, thank you for converting it! We have a lint error, can you please fix that and then we're good to go! |
@rushatgabhane are we good to add |
sure, sounds good! |
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.
@luacmartins LGTM! 🚀
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
✋ 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/luacmartins in version: 1.3.18-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.18-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.18-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.18-2 🚀
|
Details
Fixed Issues
$ #18268
PROPOSAL: #18268
Tests
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
scroll.mov
Mobile Web - Chrome
Screen.Recording.2023-05-05.at.20.52.53.mov
Mobile Web - Safari
scroll2.mov
Desktop
desktop.mov
iOS
![Uploading Screen Shot 2023-05-05 at 21.17.15.png…]()Android
IMG_3149.MOV