Skip to content
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

Poc/split navs #49539

Draft
wants to merge 215 commits into
base: main
Choose a base branch
from

Conversation

adamgrzybowski
Copy link
Contributor

Details

Fixed Issues

$
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

This comment has been minimized.

@mountiny
Copy link
Contributor

trim.EDC2126F-EA24-40D4-87A4-E252B86DA87A.MOV

There are no page animations in the settings stack

@JmillsExpensify
Copy link

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 Settings pages. I can do a profile trace if helpful, just let me know.

@mountiny
Copy link
Contributor

Definitely performance is something we need to keep in mind

@adamgrzybowski
Copy link
Contributor Author

@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 🙇

@mountiny
Copy link
Contributor

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.

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

@mountiny
Copy link
Contributor

@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

@adamgrzybowski
Copy link
Contributor Author

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

Screen.Recording.2024-09-25.at.11.52.59.mov

But doesn't that look weird? You can see how one bottom tab bar covers the previous one with animation.

cc: @mountiny

@trjExpensify
Copy link
Contributor

trjExpensify commented Sep 25, 2024

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.

@dubielzyk-expensify
Copy link
Contributor

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

@mountiny
Copy link
Contributor

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.

@dannymcclain
Copy link
Contributor

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.

@adamgrzybowski
Copy link
Contributor Author

#49539 (comment) 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.

#49539 (comment)

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 <StackView />. In the case of workspaces screen and settings root we would need to render the bottom tab bar on top of this stack view. For other screens, we would need to render it somewhere between these cards to have proper animation. But we can't really put anything between these cards. The task will be even harder given the incoming which leaves us with even less wiggle room.

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.

@adamgrzybowski
Copy link
Contributor Author

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.mp4

It 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

@mountiny
Copy link
Contributor

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.

@adamgrzybowski
Copy link
Contributor Author

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.

@shawnborton
Copy link
Contributor

Will run the test builds now 👍

@adamgrzybowski
Copy link
Contributor Author

Just to clarify this part

  • performance issues, @adamgrzybowski worked on improving navigation between Inbox and Search tabs.

Fixes related to the performance aren't on the branch yet. The issue is quite complex and the investigation took some time. We found the root causes of the problem and currently, we are deciding which solution will be the best.

Copy link
Contributor

github-actions bot commented Nov 6, 2024

@adamgrzybowski
Copy link
Contributor Author

@mountiny we could try another build. Performance should be better now 🤞🤞

Copy link
Contributor

github-actions bot commented Nov 8, 2024

@adamgrzybowski
Copy link
Contributor Author

I played with the new build and no longer see the performance problem described here. Could somebody please confirm that? Thanks! 🙇

BTW I think we resolved almost all reported problems. We still have a few that are waiting for native stacks but besides I think the PR seems pretty stable. Three things we would like to focus on now are:

  • cleaning (of course 😄) to prepare for reviews.
  • updating docs
  • preparing for merging native stacks. <- @WojtekBoman already started looking into this one.

@mountiny
Copy link
Contributor

Took it for a quick ride and also could not spot any performance issue on web at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.