Conversation
WoLewicki
left a comment
There was a problem hiding this comment.
I left some comments, please answer them 🎉
|
|
||
| return ( | ||
| <FreezeWrapper keepVisible={!isSmallScreenWidth}> | ||
| <FreezeWrapper> |
There was a problem hiding this comment.
Why did you remove this? Is the sidebar still clickable if you e.g. navigate to different reports twice? I think it was handling a case where you have the sidebar visible all the time and navigate deeper in the main stack, but maybe the navigation structure changed in a way that it is not necessary right now?
There was a problem hiding this comment.
FYI I tested this fix locally and the list is still fully clickable on the web, and causes no issues on mobile. It seems plausible that the nav structure changed and this is no loner a case
There was a problem hiding this comment.
keepVisible completely disables freezing for a 'big' screen. I believe the original idea of this chunk was to freeze it directly in such cases. I wonder why we used this approach before. It might be a leftover from the previous navigation structure
| // would be visible at the beginning of the back animation then | ||
| if (navigation.getState().index - (screenIndexRef.current ?? 0) > 1) { | ||
| InteractionManager.runAfterInteractions(() => setIsScreenBlurred(true)); | ||
| if (navigation.getState().index - (screenIndexRef.current ?? 0) >= 1) { |
There was a problem hiding this comment.
Does the issue with beginning of animation not occur anymore? And did you try to run it in the new arch? I think the case with InteractionManager was needed there only and I think we will want to enable it on web ASAP too.
There was a problem hiding this comment.
I can't pinpoint the any issues with the animations. I haven't tested with new arch though.
There was a problem hiding this comment.
Animation of goBack works ok for me. I haven't tried it with a new arch yet, but it shouldn't be an issue
There was a problem hiding this comment.
FYI I also gave it a spin and wasn't able to experience anything weird related to animations.
|
@perunt, is the purpose of this PR to ensure that the hidden screen freezes when there are two or more screens in the stack navigator? |
|
I would say the purpose was to freeze the hidden screen once we have two or more screens in the stack. One reliable method to reproduce this issue is to log out and then log in again. It occurs when the stack has two screens. In all other cases, it works as intended. |
|
okay thank you for the confirmation @situchan please review the PR when you have time 🙇 |
|
Hey @perunt 👋 Great work ! I was testing out your PR alongside with this PR and It works great. Only thing I want to flag is these two PR appears to go together. For example, only with your PR we still see the slowness between switch but there's no such hang observed. Now, to improve the slowness between switch, the linked PR is important. I just wanted to flag the above and also below is how these two PRs look together. Beforebefore.mp4Afterafter.mp4 |
|
hey @hurali97 If not, have you had a chance to test the switching on the main branch, where the issue with multiple renderItem calls doesn't seem to reproduce? Is the performance still an issue in that scenario? The key concern here is that on the first switch, we encounter a page that completely freezes for 15-20 seconds, which we need to avoid. If there's an alternative solution, I'd be eager to explore it. The difference might be due to |
I am referring to both the initial switch and the subsequent switches. If you notice in the After video, both the initial and subsequent switches are quick which happens because of the PR I linked. What I am trying to say is your PR for sure fixes the multiple renderItem calls but we still have some slowness in screen rendering after the switch. The switch happens quickly but not the rendering. The PR I linked fixes that and now with both of these PRs we have quick switching, no extra renderItem calls and quick rendering as well.
Below you can see how main behaves with your PR changes only. We have no extra renderItem calls and quick switching but delayed rendering. Mainmain_.mp4Both PRs combinedafter.mp4 |
@hurali97 at least this PR won't cause another performance regression right?
this is already existing bug on main right? |
From an overview, doesn't look like there will be a regression but we need to test here because in this PR we have some changes to the Freeze wrapper.
That's correct and this is what's addressed in this PR |
|
Ahh, now I understand—I was concerned my PR might be causing some slowness. Great work on your part! The page loading appears much faster now. I'm confident users will definitely notice the improvemen |
Indeed, this PR should not lead to any further performance regression. At least, I haven't observed any such issues so far. |
|
@situchan, can you please take a look at this? |
|
yes reviewing today |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safariweb.movMacOS: Desktop |
|
@perunt can you please add platform screenshots? |
|
And there's conflict |
it was a web issue, i have screen records for it in |
…into perunt/perf-lhn-list
|
This also happens on main so out of scope. But is this bug already reported or being fixed elsewhere? After switching to wrench tab and back, not found page shows Screen.Recording.2024-03-08.at.7.49.04.PM.mov |
| if ((navigation.getState()?.index ?? 0) - (screenIndexRef.current ?? 0) > 1) { | ||
| InteractionManager.runAfterInteractions(() => setIsScreenBlurred(true)); | ||
|
|
||
| if ((navigation.getState()?.index ?? 0) - (screenIndexRef.current ?? 0) >= 1) { |
There was a problem hiding this comment.
I see that you changed to >= 1 from > 1. Isn't this opposed to this comment?
// we don't want to freeze the screen if it's the previous screen because the freeze placeholder
// would be visible at the beginning of the back animation then
There was a problem hiding this comment.
I see that we no longer use the placeholder component. I guess this comment was not changed after the placeholder was removed. I will do it now
There was a problem hiding this comment.
@perunt this actually caused regression.
As this affects all platforms, please test and add remaining platforms, not only web.
this branch:
Screen.Recording.2024-03-11.at.10.54.20.PM.mov
main:
Screen.Recording.2024-03-11.at.10.54.42.PM.mov
There was a problem hiding this comment.
@situchan, thanks for pointing it out.
I retested it, and it looks like a freshly added nullish coalescing operator can let me remove this check, so I assume we can't receive navigation immediately in some cases. I'm adding the rest of the recordings.
|
It doesn't make sense to link #35602 in |
switched to the correct one #36420 (comment) @situchan, can I somehow speed up merging this PR? |
I am just waiting for #36927 (comment) from @getusha to confirm that it's safe. |
|
There's performance lag a bit when opening Search page on both main and this branch. I don't find any difference. Screen.Recording.2024-03-11.at.10.36.53.PM.mov |
hayata-suenaga
left a comment
There was a problem hiding this comment.
code looks good to me
are there blocking issues or conversations to be resolved before we merge this PR?
|
I don't know about such issues, so it's clean from my side |
|
hayata-suenaga
left a comment
There was a problem hiding this comment.
@perunt please check the regression described in this comment.
|
@hayata-suenaga I'm resolving this, thanks! |
|
@situchan could you retest when you have time? 🙇 |
|
testing |
|
The code is now simplified and affects only web platform. |
hayata-suenaga
left a comment
There was a problem hiding this comment.
thank you so much for your work @perunt 😄
|
✋ 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/hayata-suenaga in version: 1.4.52-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.52-6 🚀
|
here I'm trying to address the bug described: #36420 (comment)
discussion: https://expensify.slack.com/archives/C05LX9D6E07/p1708011570713419
Details
Fixed Issues
$ #36420 (comment)
PROPOSAL:
Tests
Offline tests
QA Steps
NOTE: This issue occurs only once when you navigate to this screen for the first time.
Alternate method to reproduce the issue:
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-12.at.08.31.32.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-12.at.08.33.24.mp4
MacOS: Chrome / Safari
Untitled.mov
MacOS: Desktop
Untitled.mov