-
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
Implement flexible bottom tab bar #49539
base: main
Are you sure you want to change the base?
Implement flexible bottom tab bar #49539
Conversation
This comment has been minimized.
This comment has been minimized.
trim.EDC2126F-EA24-40D4-87A4-E252B86DA87A.MOVThere are no page animations in the settings stack |
I took this for a quick spin on Chrome/web and it worked fairly well, including properly accounting for the browser back case. One thing I noticed, though I'm not sure if it's related to this PR or not: I occasionally experienced performance issues, where the responsiveness of the page would slow down and almost freeze up for a second or two. I saw this on the |
Definitely performance is something we need to keep in mind |
@mountiny If I understand correctly this is something that we want. Those screens have the bottom tab bar. Other bottom tab screens don't have animations from the beginning. @JmillsExpensify we are still working on adjusting performance tricks for these changes. Please point us to flows that feels slower than before so we can investigate it 🙇 |
Hmm, I dont think we want that, going deeper in the settings should have animations, same as going to a report from LHN has animation @Expensify/design @trjExpensify @JmillsExpensify |
@adamgrzybowski Wanted to report here as well that I think the performance on web for me is gradually getting worse and this morning it's noticeably slow, you can see it here as well which I have recorded for a different bug Screen.Recording.2024-09-25.at.10.12.04.mp4 |
Screen.Recording.2024-09-25.at.11.52.59.movBut doesn't that look weird? You can see how one bottom tab bar covers the previous one with animation. cc: @mountiny |
Yeah, I think that does look weird. The bottom tab bar feels like it's part of page being animated in, rather than persisting across the different pages. |
Yeah that looks a bit off. The view should go over the bottom navigation instead. Though there's another issue to put the bottom navigation on top in workspaces. Which should give us this: CleanShot.2024-09-26.at.11.06.21.mp4 |
d5a8d96
to
0283fa5
Compare
I agree that the bottom tab should not animate if it's staying on another page, too. I would defer to @dubielzyk-expensify and the design team to see how we want to handle this. |
The video that Jon shared is what I would expect and prefer. But if that's not technically feasible at the moment, I would rather have the bottom tabs than the animation. |
That's the problem. It may be tough to implement and if that's okay I would investigate this as follow-up. But let me explain why this is problematic at all. Previously, we had a navigator that displayed a bottom tab bar over every screen within itself. This approach did not allow us to place the bottom tab bar on every screen in the app. Only on screens in this particular navigator. And it definitely did not allow us to display the bottom tab bar conditionally, as in the "Workspaces screen" case. We decided to render the bottom on every screen that requires it instead. This approach gives us a lot of flexibility. We did know that we couldn't create an animation of sliding screen with the bottom tab onto another screen with the bottom tab. But we assumed that as in current use cases, we won't animate screens with the bottom tab so that's not a problem. Let's assume that we want to have this animation and we won't display it on every page but we will figure out a way to do it smarter. All screens that you can open from the menu visible in the video above are on the same level. Screen containing this menu is also on the same level. If that doesn't make sense, please consider the fact that we also need to handle the wide layout with this structure. That means they are rendered with one I am not saying it is impossible. I just want to give you context on how complex is adding this little animation. I have a few tricks in my mind but I would rather focus on this after migrating to the new structure. |
When it comes to performance. I started digging and couldn't reproduce the laggy RHP that you filmed @mountiny. I might have to try the high traffic account or something like that. However, I discovered a different issue when switching to the "Reports" tab. What you can notice in our POC is that you can't see the skeleton loading. The first render of the report screen is delayed in comparison to the main. before.mp4It doesn't look like a big delay but it feels laggy when you click it yourself. I investigate that and it looks like this doesn't happen on the main only by coincidence. I figured out a solution for that and tomorrow I will work on PR that we could merge to the main. It should help with the initial render of heavy screens in general and improve the user experience. Below you can see the test result after.mp4 |
I am fine exploring the animation later @adamgrzybowski, you should definitely test with a high-traffic account at least; you could even try the heavy performance testing account we provided to SWM. Testing with a fresh account is not representative of the users we care about the most. |
FYI: I played around with a solution I found yesterday regarding performance, and it may need more work and investigation. For now, I'll focus on other work left for this PR and get back to perf closer to review. |
030b630
to
a1d9a3a
Compare
Poc/split go up
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Fix tooltips for bottom tab bar and sidebar list
@ 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] |
@mountiny tooltip issues on the bottom tab bar are finally resolved and tests should be fixed. I removed the draft label. BTW Thanks @WoLewicki for the internal review 🙇 |
@adamgrzybowski Is it possible to fix ESLint here. |
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
No need to fix the default IDs and the import issues, lets not add more changes that are not relevant to this PR I have kicked off the build @shubham1206agra @dukenv0307 can you please start with testing and reviewing and make this your top priority? Thanks! |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@adamgrzybowski @WojtekBoman getting crash when signing into my account on the build |
Reviewing... |
|
||
useEffect(() => { | ||
setActiveWorkspaceID(policyID); | ||
}, [policyID, setActiveWorkspaceID]); |
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.
We don't need to add setActiveWorkspaceID
to dependency.
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Asked QA for testing! |
Details
Motivation
This PR started with this feature request: Use persistent bottom tabs in Settings to improve Workspace Editor UX. We realized that the current structure of navigators isn't well-suited to handle features requiring conditional placement of the bottom tab bar. Additionally, after many iterations and discussions about navigation, we had an idea for a structure that meets current needs more effectively and is easier to develop and maintain.
Problem
Currently, the first route in the root navigator is always the
BottomTabNavigator
. This setup means all screens needing the bottom tab bar are nested inside it. All other screens and navigators are stacked on top. This configuration also makes the root navigator responsible for the split view, causing two major issues:Solution
a) Flexible Bottom Tab Bar
We decided to detach the bottom tab bar from the bottom tab navigator. The bottom tab navigator no longer exists. Now, we can render the bottom tab bar on any screen that requires it, even conditionally like on the workspace list page where it should be visible only for the narrow layout.
b) Separating Root Navigator and Split Functionality
We have extracted the logic responsible for managing the split view into a separate custom
SplitNavigator
. Better separation makes it easier to develop new screens and adapt different navigation patterns that don’t follow the usual rules.Other Changes
We've used this opportunity to address other pain points and bugs in the current navigation implementation. In addition to cleaning up old helpers and reorganizing the directory structure, there are a few notable changes:
getAdaptedState
Thanks to the new split navigators managing their own initial state, we were able to simplify the function that generates the initial global state from a link.
linkTo
This function has grown complex over multiple iterations. Small changes could cause hard to detect bugs. We've simplified it significantly and moved much of the logic to the routers of the custom navigators to improve readability and separation of responsibility.
goBack
With the new structure, we've taken the opportunity to rethink the implementation of this function, making it more bulletproof and eliminating some old hard to fix bugs.
tests
To ensure that resolved bugs remain fixed, we've created manual test cases in
NAVIGATION.md
and automated tests intests/navigation/
. These tests also help communicate how the navigation should behave, especially in cases that are exemptions from standard rules.Fixed Issues
$ #44242
PROPOSAL:
Tests
Offline tests
QA Steps
There should be a proper report under attachment screen after reload
There is a proper split navigator under RHP with a sidebar screen only for screens that can be opened from the sidebar
/settings/profile/status
.There is a proper split navigator under the overlay after refreshing page with RHP/LHP on wide screen
/settings/profile/display-name
.There is a proper split navigator under the overlay after deeplinking to page with RHP/LHP on wide screen
/settings/profile/display-name
.The Workspace list page is displayed (SCREENS.SETTINGS.WORKSPACES) after clicking the Settings tab from the Workspace settings screen
/settings/workspaces
)/settings/workspaces
)The last visited screen in the settings tab is saved when switching between tabs
The Workspace selected in the application is reset when you select a chat that does not belong to the current policy
The selected workspace is saved between Search and Inbox tabs
Going up to the workspace list page after refreshing on the workspace settings and pressing the up button
/settings/workspaces/:policyID:/profile
)Going up to the RHP screen provided in the backTo parameter in the url
/settings/profile/address
)There is proper split navigator under the overlay after refreshing page in RHP that includes valid reportID in params
wide layout :
narrow layout :
Navigating back to the Workspace Switcher from the created workspace
Going up to the sidebar screen
Linked issue: #44138
Navigating back from the Search page with invalid query parameters
/search?q=from%3a
)Navigating to the chat from the link in the thread
Expense - App does not open destination report after submitting expense
Linked issue: #49539 (comment)
QBO - Preferred exporter/Export date tab do not auto-close after value selected
Linked issue: #49539 (comment)
Precondition: Workspace with QBO integration connected.
Web - Hold - App flickers after entering reason and saving it when holding expense
Linked issue: #49539 (comment)
Group - App returns to group settings page after saving group name
Linked issue: #49539 (comment)
Going up to a screen with any params
Linked issue: #49539 (comment)
Change params of existing attachments screens instead of pushing new screen on the stack
Linked issue: #49539 (comment)
Navigate instead of push for reports with same reportID
Linked issue: #49539 (comment)
Don't push the default full screen route if not necessary.
BA - Back button on connect bank account modal opens incorporation state modal
Linked issue: #49539 (comment)
Precondition: Use staging server (it can be set in Settings >> Troubleshoot)
App opens room details page when tapping RHP back button after saving Private notes in DM
Linked issue: #49539 (comment)
Opening particular onboarding pages from a link and going back
Linked issue: #50177
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
androidWeb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
iosWeb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4