-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix Modal animations #2505
fix Modal animations #2505
Conversation
@parasharrajat As per the PR title, is this still WIP? Also, can you confirm whether you need to provide tests for Mobile Web, Desktop, and iOS? |
@jasperhuangg Yup main task is finished but I was scrutinizing it. Also, I saw other requests being brought into this issue. |
…harrajat-animation
…harrajat-animation
…harrajat-animation
@jasperhuangg Updated Screenshots. Ready for review. |
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.
A few questions.
@@ -136,6 +136,9 @@ class EmojiPickerMenu extends Component { | |||
renderItem={this.renderItem} | |||
keyExtractor={item => `emoji_picker_${item.code}`} | |||
numColumns={this.numColumns} | |||
removeClippedSubviews | |||
maxToRenderPerBatch={this.numColumns} | |||
windowSize={3} |
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.
What does this have to do with your issue? This just seems like a FlatList optimization that doesn't have anything do with your changes. NAB but I think it's better to do this in a separate PR.
Also, can you clarify why you're using 3 for windowSize? Not good to have hard coded numbers so good to clarify with a comment.
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.
This component is very laggy. Author of the component mentioned this so he disabled the animations. I put these changes to make the animation smooth so that I can enable animation on this component.
Window size will not be reused so I put it directly over here. It just means to create three Windows where one window is equal to visible area of component. I will add the comments
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 forgot to mention that there are other PRs on emoji picker which is optimizing it So I don't need to submit a PR for now. If in future issues persist with Emoji Picker I will handle them as a separate issue.
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.
+1 for @jasperhuangg comments here.
@parasharrajat appreciate you adding value here but please do limit changes to ones affecting the issue you are assigned so that we can manage which bugs and issues are being handled and where. random fixes make it much harder to track when a bug was fixed.
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 added these changes as per request #2335 (comment). I saw that the animation was pretty laggy so I thought to put these for optimizing the animation.
Should I just enable the animation and remove these changes?
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.
Ah ok, thanks I missed this comment. No need to remove changes but if we are increasing the scope we need to add that context to the description of the original issue so we should:
- Update the issue you are working on to show each problem we are solving (show that it is broken)
- Ask QA to test the same flows and prove that it is fixed.
Otherwise, we're just adding random stuff and it's hard to have a good history.
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.
Sure, Thanks. Updating now.
@@ -68,6 +68,9 @@ class EmojiPickerMenu extends Component { | |||
renderItem={this.renderItem} | |||
keyExtractor={item => (`emoji_picker_${item.code}`)} | |||
numColumns={this.numColumns} | |||
removeClippedSubviews | |||
maxToRenderPerBatch={this.numColumns} | |||
windowSize={3} |
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.
same as above
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 was able to confirm locally that removing these line fixes a regression
@@ -397,8 +408,6 @@ class ReportActionCompose extends React.Component { | |||
onClose={this.hideEmojiPicker} | |||
onModalShow={this.focusEmojiSearchInput} | |||
hideModalContentWhileAnimating | |||
animationInTiming={1} |
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.
Why are we removing this? There's a comment above saying why they're there.
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.
So It was added to disable the animation as the author found it laggy but I was requested to enable animation on emoji picker thus I removed it. I will remove the comments as well.
@jasperhuangg Please let me know how should I proceed here based on my comments over review? |
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.
Looks good! Thanks for clarifying my concerns.
@@ -59,6 +60,10 @@ const propTypes = { | |||
|
|||
// Whether to show the title tooltip | |||
showTitleTooltip: PropTypes.bool, | |||
|
|||
// The ref to the search input | |||
// eslint-disable-next-line react/forbid-prop-types |
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.
Surely we will use this enough times that a reusable propTypes
is better than PropTypes.object.isRequired
?
@@ -87,7 +92,13 @@ class OptionsSelector extends Component { | |||
} | |||
|
|||
componentDidMount() { | |||
this.textInput.focus(); | |||
this.unsubscribeTransitionEnd = this.props.navigation.addListener('transitionEnd', () => { |
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.
What transition are we listening for the end of here?
Does this work for all screens that might use this component in the future?
Can we add some context about why this change was needed so that others have a better idea whether to follow this example or not?
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.
Sure. We used this as Interaction Manager has issues on Web. This transition waits for the Navigation transition to finish. This component is being used for only Screen components so this works fine. But it's a good idea to mention it in a comment. Oh, PR is merged. I will open follow-up PR.
Let me know If we should handle this in a different way.
@@ -136,6 +136,9 @@ class EmojiPickerMenu extends Component { | |||
renderItem={this.renderItem} | |||
keyExtractor={item => `emoji_picker_${item.code}`} | |||
numColumns={this.numColumns} | |||
removeClippedSubviews | |||
maxToRenderPerBatch={this.numColumns} | |||
windowSize={3} |
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.
+1 for @jasperhuangg comments here.
@parasharrajat appreciate you adding value here but please do limit changes to ones affecting the issue you are assigned so that we can manage which bugs and issues are being handled and where. random fixes make it much harder to track when a bug was fixed.
this.emojiSearchInput.focus(); | ||
} | ||
this.emojiFocusInteractionHandle = InteractionManager.runAfterInteractions(() => { | ||
if (this.emojiSearchInput && !this.props.isSmallScreenWidth) { |
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.
Why only when we have a small screen width what about tablet ?
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.
Yeah, this is a bigger device (!isSmallScreenWidth) but we can remove this check as emojiSearchInput
is already null for native devices.
@@ -161,7 +170,7 @@ class ReportActionCompose extends React.Component { | |||
if (this.textInput) { | |||
// There could be other animations running while we trigger manual focus. | |||
// This prevents focus from making those animations janky. |
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.
Please elaborate on why this is helpful. Which "interaction" are we waiting to finish ?
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.
So When the modal screen is being closed, we want to wait for those before focusing on it. And I noticed that manual focus is causing a lot of issues so I think it's better to put focus after Interactions, we have no side effects.
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.
Is there some way to see which "interactions" we are waiting for? Or am I misunderstanding what this method does? Which janky animation are we fixing specifically with this? Is there a before/after video we can share to verify the change does what it should and so QA can verify the change as well?
I'm not seeing anything at all about the emoji picker in the test steps so those will also need to be updated.
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.
+1 @parasharrajat Can you updated the test steps to include something about the emoji picker? It's not super apparent that it's a modal and it might get missed in QA.
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.
Sure @jasperhuangg
🚀 Deployed to staging in version: 1.0.34-3🚀
|
I believe this PR caused a regression |
I don't think so but I will debug it and see. anyways I am putting up a follow up PR for few changes so I will fix this regression (if its from same PR) on that |
Yeah, I was just looking at the checklist here and finding that this PR looked like the only potential culprit, but I'm not able to reproduce the bug. |
Okay, actually I have figured out how to reproduce the regression, and I'm 90% sure it was indeed caused by this PR. |
Was able to confirm that these lines were the source of the regression. Going to revert here |
I am feeling like I need to test the app deeply before finalizing a PR. I am seeing that there have been couple of regressions. |
@parasharrajat This PR has been reverted, so'll need to include these original changes in your follow-up too |
🚀 Deployed to production in version: 1.0.39-5🚀
|
Please review.
Details
Details can be read #2335 (comment)
Fixed Issues
Fixes #2335Tests / QA Steps
Tested On
Screenshots
Web
animation-web.mp4
Mobile Web
animation-mWeb.mp4
Desktop
animation-des.mp4
iOS
Not able to record it as I have MAC VM but the animation on IOS works smoothly.
Android
animation-mobile.mp4