-
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
[navigation-refactor] Style based approach for the three pane layout #22437
[navigation-refactor] Style based approach for the three pane layout #22437
Conversation
src/libs/Navigation/AppNavigator/getRootNavigatorScreenOptions.js
Outdated
Show resolved
Hide resolved
src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.js
Outdated
Show resolved
Hide resolved
Will this also solve the problem with the RHP not animating when opening and closing right? Can we add that issue to the fixed issues section too and include it in testing once we move this further? |
Yes, animations for the RHP should work now |
nice added the issue link to the PR body |
@mananjadhav 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] |
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.
@mananjadhav Are you able to prioritize this review and testing? its important PR, thanks!
The performance findings are not great. We need to think of our Guides who have hundreds of policies and during a day they can go through hundreds of chats. Will this make the app unusable for them? @WoLewicki @adamgrzybowski |
@mountiny I would take 1 day to start the review, feel free to reassign if this more urgent to be reviewed earlier. |
@mountiny I think the performance issue is also present in the current solution, when you push many reports to the stack, you can see that typing etc. becomes slower and slower. I believe right now it is just more visible with the animation of RHP present. I think all the communicators suffer from getting slower and slower until you reload the page, so I wouldn't see it as so much of a blocker. On the other hand, I think we should revisit the problem of infinite pushing of the screens to the stack imo since this would resolve this performance problem. |
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
@mountiny I can start this one, I can see it's not picked by anybody else. Want me to check this? |
@mananjadhav go ahead 👍🏼 |
This comment was marked as resolved.
This comment was marked as resolved.
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
@adamgrzybowski Can you put in the description to do |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.60-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.60-0 🚀
|
The tests were passing |
@shubham1206agra updated the instructions |
@adamgrzybowski @mountiny Anything specific needed to QA here? |
@mvtglobally nothing specific really, this already had the QA regression done before merging, we might be able to link some issue back to this if there are some weird issues found during the regression test suite testing |
I appreciate trying to be thorough with testing, but this definitely should not have been merged |
@arosiclair I was on a fence with this one but my reasoning was:
apologies if there will be something critical hard to resolve, I hope that would be caught with the regression testing |
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.60-3 🚀
|
Hi all! Figured I'd explicitly call out #26421 - landscape iPad layout is weird now - as a new regression that stems from this; I'll be investigating as well but since I'm coming into this a little cold - if you have any thoughts they are welcome! |
} | ||
// We need to force state rehydration so the CustomRouter can add the CentralPaneNavigator route if necessary. | ||
navigationRef.resetRoot(navigationRef.getRootState()); | ||
}, [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.
@mountiny I believe this is the RCA of the issue, you've just created
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.
Thanks!
component={DesktopSignInRedirectPage} | ||
/> | ||
</RootStack.Navigator> | ||
<View style={styles.rootNavigatorContainerStyles(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 are we pushing the whole navigation to the right with marginLeft?
Then later reset it with transform on screens.
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.
cc: @allroundexperts @mananjadhav @adamgrzybowski @aimane-chnaif
I am looking into this issue #31573. We do have a solution #31573 (comment). But I am trying to understand this better.
any ideas on above query? |
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth, | ||
|
||
// We need to translate the sidebar to not be covered by the StackNavigator so it can be clickable. | ||
transform: [{translateX: isSmallScreenWidth ? 0 : -variables.sideBarWidth}], |
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.
Transforming interferes with the native browser selection functionality which caused #31573
Luckily we can use marginLeft here which works fine.
Details
This is the implementation of the style based approach for the three pane layout.
Instead of using
ThreePaneView
to achieve the wide layout we are using styles to adjust positions of the cards in theStackView
. Doing it this way we don't have to remount theNavigationContainer
after resizing.react-navigation patch
This PR has a patch for
react-navigation
to not detach theHome
screen even if the navigator has thedetachInactiveScreens
option. It's necessary to keep rendering theHome
screen in wide view even if we have more screens on the stack.This is hardcoded for our structure for now but we are planning to create a feature and push it upstream to have an option to disable detaching for specific screens. We may want to create an issue for that @mountiny
Performance
During testing with @WoLewicki, we did notice that if the user pushes a bigger number of chats on the stack, the animations may be a little laggy. For my computer, this starts to happen somewhere around 20 chats.
We were searching for the cause but we didn't find anything specific. We came to the conclusion that:
ThreePaneView
is much leaner thanStackView
. But to remove the necessity to remountNavigationContainer
on resize we need to useStackView
in both, narrow and wide layouts.Additionally, we found a screen that always has problems with performance. It's the profile screen with routes like
a/:id
We may want to create an issue to figure out why the first render of this screen is so slow and look for optimization or add a loading state.
Fixed Issues
$ #20404
$ #22372
Tests
run npm install to make sure the patch is applied
Test if the inputs keep the state after resizing e.g. input on the search screen.
Test if RHP is animating properly
Verify that no errors appear in the JS console
Offline tests
QA Steps
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
web.mov
Mobile Web - Chrome
androidWeb.mov
Mobile Web - Safari
iosWeb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov